Fangrui Song [Thu, 23 Jan 2020 19:52:03 +0000 (11:52 -0800)]
[ELF] --no-dynamic-linker: don't emit undefined weak symbols to .dynsym
I felt really sad to push this commit for my selfish purpose to make
glibc -static-pie build with lld. Some code constructs in glibc require
R_X86_64_GOTPCREL/R_X86_64_REX_GOTPCRELX referencing undefined weak to
be resolved to a GOT entry not relocated by R_X86_64_GLOB_DAT (GNU ld
behavior), e.g.
csu/libc-start.c
if (__pthread_initialize_minimal != NULL)
__pthread_initialize_minimal ();
elf/dl-object.c
void
_dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
{
/* We modify the list of loaded objects. */
__rtld_lock_lock_recursive (GL(dl_load_write_lock));
Emitting a GLOB_DAT will make the address equal &__ehdr_start (true
value) and cause elf/ldconfig to segfault. glibc really should move away
from weak references, which do not have defined semantics.
Temporarily special case --no-dynamic-linker.
Reid Kleckner [Thu, 23 Jan 2020 20:11:50 +0000 (12:11 -0800)]
[PDB] Simplify API for making section map, NFC
Prevents API misuse described in PR44495
Nathan Ridge [Tue, 21 Jan 2020 21:55:43 +0000 (16:55 -0500)]
[clangd] Add C++20 concepts support to TargetFinder
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73140
Nathan Ridge [Tue, 21 Jan 2020 18:21:08 +0000 (13:21 -0500)]
[clangd] Add C++20 concepts support to findExplicitReferences() and semantic highlighting
Summary: Fixes https://github.com/clangd/clangd/issues/259
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73124
Roman Lebedev [Thu, 23 Jan 2020 20:10:02 +0000 (23:10 +0300)]
Revert "[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`"
Likely makes bots angry.
This reverts commit
a4cfb15d15a8a353fe316f2a9fe1c8c6a6740ef1.
# Conflicts:
# clang/lib/Sema/SemaDeclAttr.cpp
Roman Lebedev [Thu, 23 Jan 2020 20:07:58 +0000 (23:07 +0300)]
Revert "[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation"
Likely makes bots angry.
This reverts commit
c2a9061ac5166e48fe85ea2b6dbce9457c964958.
Matt Arsenault [Thu, 23 Jan 2020 19:10:04 +0000 (14:10 -0500)]
AMDGPU: Fix ubsan error
Since register classes go up to 1024, 32 elements, all masks bits are
needed and a 32-bit shift by 32 is illegal. We didn't have any
instructions theoretically using a 32 element VGPR before
d1dbb5e4718a8f845abf0783513a33a55429470b
Roman Lebedev [Thu, 23 Jan 2020 19:50:34 +0000 (22:50 +0300)]
[Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters
Summary:
I kind-of understand why it is restricted to integer-typed arguments,
for general enum's the value passed is not nessesairly the alignment implied,
although one might say that user would know best.
But we clearly should whitelist `std::align_val_t`,
which is just a thin wrapper over `std::size_t`,
and is the C++ standard way of specifying alignment.
Reviewers: erichkeane, rsmith, aaron.ballman, jdoerfert
Reviewed By: erichkeane
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73019
Roman Lebedev [Thu, 23 Jan 2020 19:50:24 +0000 (22:50 +0300)]
[Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value
Summary:
Much like with the previous patch (D73005) with `AssumeAlignedAttr`
handling, results in mildly more readable IR,
and will improve test coverage in upcoming patch.
Note that in `AllocAlignAttr`'s case, there is no requirement
for that alignment parameter to end up being an I-C-E.
Reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith
Reviewed By: erichkeane
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73006
Roman Lebedev [Thu, 23 Jan 2020 19:50:15 +0000 (22:50 +0300)]
[Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value
Summary:
This should be mostly NFC - we still lower the same alignment
knowledge to the IR. The main reasoning here is that
this somewhat improves readability of IR like this,
and will improve test coverage in upcoming patch.
Even though the alignment is guaranteed to always be an I-C-E,
we don't always materialize it as llvm's Alignment Attribute because:
1. There may be a non-zero offset
2. We may be sanitizing for alignment
Note that if there already was an IR alignment attribute
on return value, we union them, and thus the alignment
only ever rises.
Also, there is a second relevant clang attribute `AllocAlignAttr`,
so that is why `AbstractAssumeAlignedAttrEmitter` is templated.
Reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith
Reviewed By: erichkeane
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73005
Roman Lebedev [Thu, 23 Jan 2020 19:50:06 +0000 (22:50 +0300)]
[IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant
Summary:
I initially encountered those assertions when trying to create
this IR `alignment` attribute from clang's `__attribute__((assume_aligned(imm)))`,
because until D72994 there is no sanity checking for the value of `imm`.
But even then, we have `llvm::Value::MaximumAlignment` constant (which is `
536870912`),
which is enforced for clang attributes, and then there are some other magical constant
(`0x40000000` i.e. `
1073741824` i.e. `2 *
536870912`) in
`Attribute::getWithAlignment()`/`AttrBuilder::addAlignmentAttr()`.
I strongly suspect that `0x40000000` is incorrect,
and that also should be `llvm::Value::MaximumAlignment`.
Reviewers: erichkeane, hfinkel, jdoerfert, gchatelet, courbet
Reviewed By: erichkeane
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D72998
Roman Lebedev [Thu, 23 Jan 2020 19:49:50 +0000 (22:49 +0300)]
[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation
Summary:
`alloc_align` attribute takes parameter number, not the alignment itself,
so given **just** the attribute/function declaration we can't do any
sanity checking for said alignment.
However, at call site, given the actual `Expr` that is passed
into that parameter, we //might// be able to evaluate said `Expr`
as Integer Constant Expression, and perform the sanity checks.
But since there is no requirement for that argument to be an immediate,
we may fail, and that's okay.
However if we did evaluate, we should enforce the same constraints
as with `__builtin_assume_aligned()`/`__attribute__((assume_aligned(imm)))`:
said alignment is a power of two, and is not greater than our magic threshold
Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert
Reviewed By: erichkeane
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72996
Roman Lebedev [Thu, 23 Jan 2020 19:48:57 +0000 (22:48 +0300)]
[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`
Summary:
For `__builtin_assume_aligned()`, we do validate that the alignment
is not greater than `
536870912` (D68824), but we don't do that for
`__attribute__((assume_aligned(N)))` attribute.
I suspect we should.
Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert
Reviewed By: erichkeane
Subscribers: cfe-commits, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D72994
Petr Hosek [Fri, 17 Jan 2020 22:39:14 +0000 (14:39 -0800)]
Include phabricator.uri in .arcconfig
conduit_uri was renamed to phabricator.uri and git-phab fails to load
.arcconfig without this field.
Differential Revision: https://reviews.llvm.org/D72960
Teresa Johnson [Thu, 26 Dec 2019 16:32:42 +0000 (08:32 -0800)]
[WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables
Summary:
First patch to support Safe Whole Program Devirtualization Enablement,
see RFC here: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html
Always emit !vcall_visibility metadata under -fwhole-program-vtables,
and not just for -fvirtual-function-elimination. The vcall visibility
metadata will (in a subsequent patch) be used to communicate to WPD
which vtables are safe to devirtualize, and we will optionally convert
the metadata to hidden visibility at link time. Subsequent follow on
patches will help enable this by adding vcall_visibility metadata to the
ThinLTO summaries, and always emit type test intrinsics under
-fwhole-program-vtables (and not just for vtables with hidden
visibility).
In order to do this safely with VFE, since for VFE all vtable loads must
be type checked loads which will no longer be the case, this patch adds
a new "Virtual Function Elim" module flag to communicate to GlobalDCE
whether to perform VFE using the vcall_visibility metadata.
One additional advantage of using the vcall_visibility metadata to drive
more WPD at LTO link time is that we can use the same mechanism to
enable more aggressive VFE at LTO link time as well. The link time
option proposed in the RFC will convert vcall_visibility metadata to
hidden (aka linkage unit visibility), which combined with
-fvirtual-function-elimination will allow it to be done more
aggressively at LTO link time under the same conditions.
Reviewers: pcc, ostannard, evgeny777, steven_wu
Subscribers: mehdi_amini, Prazek, hiraditya, dexonsmith, davidxl, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71907
Alina Sbirlea [Wed, 22 Jan 2020 21:27:04 +0000 (13:27 -0800)]
[LoopIdiomRecognize] Teach LoopIdiomRecognize to preserve MemorySSA.
Marcello Maggioni [Wed, 22 Jan 2020 22:22:29 +0000 (14:22 -0800)]
[mlir] Add option to use custom base class for dialect in LLVMIRIntrinsicGen.
Summary:
LLVMIRIntrinsicGen is using LLVM_Op as the base class for intrinsics.
This works for LLVM intrinsics in the LLVM Dialect, but when we are
trying to convert custom intrinsics that originate from a custom
LLVM dialect (like NVVM or ROCDL) these usually have a different
"cppNamespace" that needs to be applied to these dialect.
These dialect specific characteristics (like "cppNamespace")
are typically organized by creating a custom op (like NVVM_Op or
ROCDL_Op) that passes the correct dialect to the LLVM_OpBase class.
It seems natural to allow LLVMIRIntrinsicGen to take that into
consideration when generating the conversion code from one of these
dialect to a set of target specific intrinsics.
Reviewers: rriddle, andydavis1, antiagainst, nicolasvasilache, ftynse
Subscribers: jdoerfert, mehdi_amini, jpienaar, burmako, shauheen, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73233
Jonas Devlieghere [Thu, 23 Jan 2020 19:16:44 +0000 (11:16 -0800)]
[lldb] s/lldb/%lldb in another test
As explained in Pavel's previous commit message: %lldb is the proper
substitution. Using "lldb" can cause us to execute the system lldb
instead of the one we are testing. This happens at least in standalone
builds.
Alina Sbirlea [Thu, 23 Jan 2020 18:25:50 +0000 (10:25 -0800)]
[IndVarSimplify] Fix for MemorySSA preserve.
Fangrui Song [Thu, 23 Jan 2020 18:47:50 +0000 (10:47 -0800)]
[AArch64][test] Fix MC/AArch64 tests after D72799
Fangrui Song [Thu, 23 Jan 2020 18:45:15 +0000 (10:45 -0800)]
[AArch64][test] Fix tests after D72799
Fangrui Song [Thu, 23 Jan 2020 03:42:54 +0000 (19:42 -0800)]
[ELF] Pass `Relocation` to relaxGot and relaxTls{GdToIe,GdToLe,LdToLe,IeToLe}
These functions call relocateOne(). This patch is a prerequisite for
making relocateOne() aware of `Symbol` (D73254).
Reviewed By: grimar, nickdesaulniers
Differential Revision: https://reviews.llvm.org/D73250
Justin Bogner [Thu, 23 Jan 2020 18:24:10 +0000 (10:24 -0800)]
[LoopUnroll] Avoid UB when converting from WeakVH to `Value *`
Calling `operator*` on a WeakVH with a null value yields a null
reference, which is UB. Avoid this by implicitly converting the WeakVH
to a `Value *` rather than dereferencing and then taking the address
for the type conversion.
Differential Revision: https://reviews.llvm.org/D73280
Michał Górny [Thu, 23 Jan 2020 05:56:01 +0000 (06:56 +0100)]
[openmp] Disable archer if LIBOMP_OMPT_SUPPORT is off
This fixed build failures due to missing ompt headers.
See https://bugs.gentoo.org/700762.
Differential Revision: https://reviews.llvm.org/D73249
Danilo Carvalho Grael [Wed, 15 Jan 2020 20:01:05 +0000 (15:01 -0500)]
[SVE] Add SVE2 patterns for unpredicated multiply instructions
Summary:
Add patterns for SVE2 unpredicated multiply instructions:
- mul, smulh, umulh, pmul, sqdmulh, sqrdmulh
Reviewers: sdesmalen, huntergr, efriedma, c-rhodes, kmclaughlin, rengolin
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits, amehsan
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72799
Ahmed Taei [Thu, 23 Jan 2020 01:52:16 +0000 (17:52 -0800)]
[mlir] Fix vectorize transform crashing on none-op operand
Simon Pilgrim [Thu, 23 Jan 2020 17:36:48 +0000 (17:36 +0000)]
[X86] LowerRotate - early out for vector rotates by zero
Simon Pilgrim [Thu, 23 Jan 2020 17:18:42 +0000 (17:18 +0000)]
[X86] Add test showing failure to remove vector rotate by zero
Simon Pilgrim [Thu, 23 Jan 2020 17:17:24 +0000 (17:17 +0000)]
[X86] Add AVX512 tests for vector rotations
Simon Pilgrim [Thu, 23 Jan 2020 17:08:24 +0000 (17:08 +0000)]
[SelectionDAG] ComputeNumSignBits - add ISD::ADD demanded elts support
Saar Raz [Wed, 22 Jan 2020 00:03:05 +0000 (02:03 +0200)]
[Concepts] Placeholder constraints and abbreviated templates
This patch implements P1141R2 "Yet another approach for constrained declarations".
General strategy for this patch was:
- Expand AutoType to include optional type-constraint, reflecting the wording and easing the integration of constraints.
- Replace autos in parameter type specifiers with invented parameters in GetTypeSpecTypeForDeclarator, using the same logic
previously used for generic lambdas, now unified with abbreviated templates, by:
- Tracking the template parameter lists in the Declarator object
- Tracking the template parameter depth before parsing function declarators (at which point we can match template
parameters against scope specifiers to know if we have an explicit template parameter list to append invented parameters
to or not).
- When encountering an AutoType in a parameter context we check a stack of InventedTemplateParameterInfo structures that
contain the info required to create and accumulate invented template parameters (fields that were already present in
LambdaScopeInfo, which now inherits from this class and is looked up when an auto is encountered in a lambda context).
Resubmit after fixing MSAN failures caused by incomplete initialization of AutoTypeLocs in TypeSpecLocFiller.
Differential Revision: https://reviews.llvm.org/D65042
Gabor Horvath [Wed, 22 Jan 2020 22:10:13 +0000 (14:10 -0800)]
[analyzer] Improve FuchsiaHandleChecker's diagnostic messages
Differential Revision: https://reviews.llvm.org/D73229
Sam Parker [Thu, 23 Jan 2020 16:44:25 +0000 (16:44 +0000)]
[RDA] Skip debug values
Skip debug instructions when iterating through a block to find uses.
Differential Revision: https://reviews.llvm.org/D73273
Matt Arsenault [Wed, 22 Jan 2020 03:46:43 +0000 (22:46 -0500)]
AMDGPU/GlobalISel: Select V_ADD3_U32/V_XOR3_B32
The other 3-op patterns should also be theoretically handled, but
currently there's a bug in the inferred pattern complexity.
I'm not sure what the error handling strategy should be for potential
constant bus violations. I think the correct strategy is to never
produce mixed SGPR and VGPR operands in a typical VOP instruction,
which will trivially avoid them. However, it's possible to still have
hand written MIR (or erroneously transformed code) with these
operands. When these fold, the restriction will be violated. We
currently don't have any verifiers for reg bank legality. For now,
just ignore the restriction.
It might be worth triggering a DAG fallback on verifier error.
Matt Arsenault [Thu, 23 Jan 2020 14:20:55 +0000 (09:20 -0500)]
GlobalISel: Use Register
Hans Wennborg [Thu, 23 Jan 2020 17:00:35 +0000 (18:00 +0100)]
clang-cl: Parse /QIntel-jcc-erratum
It appears to be a new flag, see
https://github.com/MicrosoftDocs/cpp-docs/commit/
c7ac1c2635a631c61d3bed9f12b31dee6d6716fe
Simon Pilgrim [Thu, 23 Jan 2020 16:41:57 +0000 (16:41 +0000)]
[SelectionDAG] ComputeNumSignBits - add ISD::ADD vector support
Add missing handling for (ADD (AND X, 1), -1) uniform vectors
Simon Pilgrim [Thu, 23 Jan 2020 16:29:33 +0000 (16:29 +0000)]
[X86][SSE] Add ComputeNumSignBits tests for (ADD (AND X, 1), -1) vectors
Guillaume Chatelet [Thu, 23 Jan 2020 15:18:34 +0000 (16:18 +0100)]
[Alignment][NFC] Use Align with CreateAlignedStore
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet, bollu
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, kerbowa, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73274
Matt Arsenault [Thu, 23 Jan 2020 16:17:16 +0000 (11:17 -0500)]
AMDGPU: Check for other uses when looking through casted select
Fixes mesa regression on ext_transform_feedback-max-varyings
Sam Parker [Thu, 23 Jan 2020 16:19:57 +0000 (16:19 +0000)]
[NFC][ARM] Add test
Simon Pilgrim [Thu, 23 Jan 2020 16:12:17 +0000 (16:12 +0000)]
[SelectionDAG] ComputeNumSignBits - add ISD::SUB demanded elts support
Simon Pilgrim [Thu, 23 Jan 2020 15:45:50 +0000 (15:45 +0000)]
[X86][AVX] Add AVX1/AVX2 ashr vector tests
Kelvin Li [Thu, 23 Jan 2020 14:16:06 +0000 (09:16 -0500)]
[OpenMP] change omp_atk_* and omp_atv_* enumerators to lowercase [NFC]
The OpenMP spec defines the OMP_ATK_* and OMP_ATV_* to be lowercase.
Differential Revision: https://reviews.llvm.org/D73248
Alexey Bataev [Thu, 23 Jan 2020 15:47:16 +0000 (10:47 -0500)]
[OPENMP]Fix use of local allocators in allocate clauses.
If local allocator was declared and used in the allocate clause, it was
not captured in inner region. It leads to a compiler crash, need to
capture the allocator declarator.
Michael Liao [Wed, 22 Jan 2020 21:04:57 +0000 (16:04 -0500)]
[hip] Remove `-Werror=format-nonliteral`
Summary:
- It won't distinguish host and device code and trigger compilation
failure on irrelevant code.
Reviewers: sameerds, yaxunl
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73224
Michael Liao [Thu, 23 Jan 2020 15:39:39 +0000 (10:39 -0500)]
Fix GCC warning/error '-fpermission'. NFC.
Krzysztof Parzyszek [Thu, 23 Jan 2020 15:37:17 +0000 (09:37 -0600)]
[Hexagon] Remove unused operand definitions: s10_0Imm and s10_6Imm
Sergej Jaskiewicz [Thu, 23 Jan 2020 14:52:43 +0000 (17:52 +0300)]
Revert "[tablegen] Emit string literals instead of char arrays"
This reverts commit
ce23515f5ab01161c98449d833b3ae013b553aa8.
That commit broke some builds on Windows:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/13870
Alexey Lapshin [Sun, 12 Jan 2020 20:15:57 +0000 (23:15 +0300)]
[Dsymutil][Debuginfo][NFC] #4 Refactor dsymutil to separate DWARF optimizing part.
Summary:
The primary goal of this refactoring is to separate DWARF optimizing part.
So that it could be reused by linker or by any other client.
There was a thread on llvm-dev discussing the necessity of such a refactoring:
http://lists.llvm.org/pipermail/llvm-dev/2019-September/135068.html.
This is a final part from series of patches for dsymutil.
Previous patches : D71068, D71839, D72476. This patch:
1. Creates lib/DWARFLinker interface :
void addObjectFile(DwarfLinkerObjFile &ObjFile);
bool link();
void setOptions;
1. Moves all linking logic from tools/dsymutil/DwarfLinkerForBinary
into lib/DWARFLinker.
2. Renames RelocationManager into AddressesManager.
3. Remarks creation logic moved from separate parallel execution
into object file loading routine.
Testing: it passes "check-all" lit testing. MD5 checksum for clang .dSYM bundle
matches for the dsymutil with/without that patch.
Reviewers: JDevlieghere, friss, dblaikie, aprantl, jdoerfert
Reviewed By: JDevlieghere
Subscribers: merge_guards_bot, hiraditya, jfb, llvm-commits, probinson, thegameg
Tags: #llvm, #debug-info
Differential Revision: https://reviews.llvm.org/D72915
Kazushi (Jam) Marukawa [Thu, 23 Jan 2020 15:00:25 +0000 (16:00 +0100)]
[VE] add, sub, left/right shift isel patterns
Summary: Add, sub, left/right shift isel patterns and tests for i32/i64 and fp32/fp64.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D73207
Kazu Hirata [Thu, 23 Jan 2020 14:26:33 +0000 (06:26 -0800)]
Revert "Resubmit: [JumpThreading] Thread jumps through two basic blocks"
This reverts commit
53b68e676faf208b4a8f817e9bd4ddd522cc6006.
Our internal tests are showing breakage with this patch.
Kadir Cetinkaya [Wed, 22 Jan 2020 13:10:01 +0000 (14:10 +0100)]
[clang][CodeComplete] Make completion work after initializer lists
Summary:
CodeCompletion was not being triggered after successfully parsed
initializer lists, e.g.
```cpp
void foo(int, bool);
void bar() {
foo({1}^, false);
}
```
CodeCompletion would suggest the function foo as an overload candidate up until
the point marked with `^` but after that point we do not trigger signature help
since parsing succeeds.
This patch handles that case by failing in parsing expression lists whenever we
see a codecompletion token, in addition to getting an invalid subexpression.
Reviewers: sammccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73177
Simon Moll [Thu, 23 Jan 2020 14:17:19 +0000 (15:17 +0100)]
[VE][NFC] re-write RR* isel class using null_frag
Summary: Re-write RR* using null_frag to avoid duplication in upcoming patches.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D73259
Simon Tatham [Thu, 23 Jan 2020 14:10:24 +0000 (14:10 +0000)]
[ARM,MVE] Make the MVE intrinsics work in C++!
Summary:
Apparently nobody has tried this in months of development. It turns
out that `FunctionDecl::getBuiltinID` will never consider a function
to be a builtin if it is in C++ and not extern "C". So none of the
function declarations in <arm_mve.h> are recognized as builtins when
clang is compiling in C++ mode: it just emits calls to them as
ordinary functions, which then turn out not to exist at link time.
The trivial fix is to wrap most of arm_mve.h in an extern "C".
Added a test in clang/test/CodeGen/arm-mve-intrinsics which checks
basic functioning of the MVE header file in C++ mode. I've filled it
with copies of existing test functions from other files in that
directory, including a few moderately tricky cases of overloading (in
particular one that relies on the strict-polymorphism attribute added
in D72518).
(I considered making //every// test in that directory compile in both
C and C++ mode and check the code generation was identical. But I
think that would increase testing time by more than the value it adds,
and also update_cc_test_checks gets confused when the output function
name varies between RUN lines.)
Reviewers: LukeGeeson, MarkMurrayARM, miyuki, dmgreen
Reviewed By: MarkMurrayARM
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73268
Luke Drummond [Wed, 15 Jan 2020 14:14:01 +0000 (14:14 +0000)]
[tablegen] Emit string literals instead of char arrays
This changes the generated (Instr|Asm|Reg|Regclass)Name tables from this
form:
extern const char HexagonInstrNameData[] = {
/* 0 */ 'G', '_', 'F', 'L', 'O', 'G', '1', '0', 0,
/* 9 */ 'E', 'N', 'D', 'L', 'O', 'O', 'P', '0', 0,
/* 18 */ 'V', '6', '_', 'v', 'd', 'd', '0', 0,
/* 26 */ 'P', 'S', '_', 'v', 'd', 'd', '0', 0,
[...]
};
...to this:
extern const char HexagonInstrNameData[] = {
/* 0 */ "G_FLOG10\0"
/* 9 */ "ENDLOOP0\0"
/* 18 */ "V6_vdd0\0"
/* 26 */ "PS_vdd0\0"
[...]
};
This should make debugging and exploration a lot easier for mortals,
while providing a significant compile-time reduction for common compilers.
To avoid issues with low implementation limits, this is disabled by
default for visual studio or when cross-compiling.
To force output one way or the other, pass
`--long-string-literals=<bool>` to `tablegen`
Reviewers: mstorsjo, rnk
Subscribers: llvm-commit
Differential Revision: https://reviews.llvm.org/D73044
Alex Zinenko [Thu, 23 Jan 2020 13:47:11 +0000 (14:47 +0100)]
Revert "[mlir] Add baseAttr to TypedArrayAttrBase."
This reverts commit
eec36909c18b8788773abc95d199e6acde6eb42c.
This modeling is incorrect. baseAttr is intended for attribute
decorators that are not backed by C++ attribute classes. It essentially
says DerivedAttr isa BaseAttr, which is wrong for ArrayAttr classes.
If one needs to store the element type, it should be stored as a
separate filed in the tablegen class.
Jay Foad [Thu, 23 Jan 2020 11:51:35 +0000 (11:51 +0000)]
[CodeGen] Make use of MachineInstrBuilder::getReg
Reviewers: arsenm
Subscribers: wdng, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73262
LLVM GN Syncbot [Thu, 23 Jan 2020 13:34:12 +0000 (13:34 +0000)]
[gn build] Port
2f6987ba61c
Sam Parker [Thu, 23 Jan 2020 13:22:13 +0000 (13:22 +0000)]
[NFC][RDA] Make the interface const
Make all the public query methods const.
Simon Pilgrim [Thu, 23 Jan 2020 12:35:29 +0000 (12:35 +0000)]
[SelectionDAG] Compute Known + Sign Bits - merge INSERT_VECTOR_ELT known/unknown index paths
Match the approach in SimplifyDemandedBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits/ComputeNumSignBits call.
Fedor Sergeev [Thu, 23 Jan 2020 12:55:32 +0000 (15:55 +0300)]
[LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found
In case of loops with multiple exit where all-but-one exit are deoptimizing
it might happen that the first rotation will end up with latch having a deoptimizing
exit. This makes the loop unsuitable for trip-count analysis (say, getLoopEstimatedTripCount)
as well as for loop transformations that know how to handle multple deoptimizing exits.
It pretty much means that canonical form in multple-deoptimizing-exits case should be
with non-deoptimizing exit at latch.
Teach loop-rotation to reach this canonical form by repeating rotation.
-loop-rotate-multi option introduced to control this behavior, currently disabled by default.
Reviewers: skatkov, asbirlea, reames, fhahn
Reviewed By: skatkov
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73058
Guillaume Chatelet [Thu, 23 Jan 2020 10:33:12 +0000 (11:33 +0100)]
[Alignement][NFC] Deprecate untyped CreateAlignedLoad
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73260
Krasimir Georgiev [Thu, 23 Jan 2020 12:19:08 +0000 (13:19 +0100)]
Treat C# `using` as a control statement
Contributed by jbcoe!
Summary: Unless SpaceBeforeParensOptions is set to SBPO_Never, a space will be put between `using` and `(` in C# code.
Reviewers: klimek, MyDeveloperDay, krasimir
Reviewed By: krasimir
Subscribers: MyDeveloperDay, cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D72144
Kerry McLaughlin [Thu, 23 Jan 2020 10:01:36 +0000 (10:01 +0000)]
[AArch64][SVE] Add first-faulting load intrinsic
Summary:
Implements the llvm.aarch64.sve.ldff1 intrinsic and DAG
combine rules for first-faulting loads with sign & zero extends
Reviewers: sdesmalen, efriedma, andwar, dancgr, rengolin
Reviewed By: sdesmalen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73025
Simon Tatham [Thu, 23 Jan 2020 11:53:42 +0000 (11:53 +0000)]
[ARM,MVE] Support immediate vbicq,vorrq,vmvnq intrinsics.
Summary:
Immediate vmvnq is code-generated as a simple vector constant in IR,
and left to the backend to recognize that it can be created with an
MVE VMVN instruction. The predicated version is represented as a
select between the input and the same constant, and I've added a
Tablegen isel rule to turn that into a predicated VMVN. (That should
be better than the previous VMVN + VPSEL: it's the same number of
instructions but now it can fold into an adjacent VPT block.)
The unpredicated forms of VBIC and VORR are done by enabling the same
isel lowering as for NEON, recognizing appropriate immediates and
rewriting them as ARMISD::VBICIMM / ARMISD::VORRIMM SDNodes, which I
then instruction-select into the right MVE instructions (now that I've
also reworked those instructions to use the same MC operand encoding).
In order to do that, I had to promote the Tablegen SDNode instance
`NEONvorrImm` to a general `ARMvorrImm` available in MVE as well, and
similarly for `NEONvbicImm`.
The predicated forms of VBIC and VORR are represented as a vector
select between the original input vector and the output of the
unpredicated operation. The main convenience of this is that it still
lets me use the existing isel lowering for VBICIMM/VORRIMM, and not
have to write another copy of the operand encoding translation code.
This intrinsic family is the first to use the `imm_simd` system I put
into the MveEmitter tablegen backend. So, naturally, it showed up a
bug or two (emitting bogus range checks and the like). Fixed those,
and added a full set of tests for the permissible immediates in the
existing Sema test.
Also adjusted the isel pattern for `vmovlb.u8`, which stopped matching
because lowering started turning its input into a VBICIMM. Now it
recognizes the VBICIMM instead.
Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard
Reviewed By: dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72934
Simon Tatham [Thu, 23 Jan 2020 11:53:27 +0000 (11:53 +0000)]
[ARM,MVE] Revise immediate VBIC/VORR to look more like NEON.
Summary:
In NEON, the immediate forms of VBIC and VORR are each represented as
a single MC instruction, which takes its immediate operand already
encoded in a NEON-friendly format: 8 data bits, plus some control bits
indicating how to expand them into a full vector.
In MVE, we represented immediate VBIC and VORR as four separate MC
instructions each, for an 8-bit immediate shifted left by 0, 8, 16 or
24 bits. For each one, the value of the immediate operand is in the
'natural' form, i.e. the numerical value that would actually be BICed
or ORRed into each vector lane (and also the same value shown in
assembly). For example, MVE_VBICIZ16v4i32 takes an operand such as
0xab0000, which NEON would represent as 0xab | (control bits << 8).
The MVE approach is superficially nice (it makes assembly input and
output easy, and it's also nice if you're manually constructing
immediate VBICs). But it turns out that it's better for isel if we
make the NEON and MVE instructions work the same, because the
ARMISD::VBICIMM and VORRIMM node types already encode their immediate
into the NEON format, so it's easier if we can just use it.
Also, this commit reduces the total amount of code rather than
increasing it, which is surely an indication that it really is simpler
to do it this way!
Reviewers: dmgreen, ostannard, miyuki, MarkMurrayARM
Reviewed By: dmgreen
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73205
Miloš Stojanović [Thu, 23 Jan 2020 11:28:50 +0000 (12:28 +0100)]
[llvm-exegesis] Don't use unsupported aliasing instructions
Since some instruction types aren't allowed as the main instruction also
don't allow them for aliasing instructions.
Differential Revision: https://reviews.llvm.org/D73220
Thomas Preud'homme [Thu, 16 Jan 2020 12:14:13 +0000 (12:14 +0000)]
[FileCheck] Strengthen error checks in unit tests
Summary:
This commit adds error checking beyond UndefVarError and fix a number of
Error/Expected related idioms:
- use (EXPECT|ASSERT)_THAT_(ERROR|EXPECTED) instead of errorToBool or
boolean operator
- ASSERT when a further check require the check to be successful to give
a correct result
Reviewers: jhenderson, jdenny, probinson, grimar, arichardson, rnk
Reviewed By: jhenderson
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72914
Simon Pilgrim [Thu, 23 Jan 2020 11:28:00 +0000 (11:28 +0000)]
[SelectionDAG] ComputeKnownBits - merge EXTRACT_VECTOR_ELT known/unknown index paths
Match the approach in SimplifyDemandedBits/ComputeNumSignBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits call.
Simon Pilgrim [Thu, 23 Jan 2020 11:14:44 +0000 (11:14 +0000)]
[SelectionDAG] Compute Known + Sign Bits - merge INSERT_SUBVECTOR known/unknown index paths
Match the approach in SimplifyDemandedBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits/ComputeNumSignBits call, additionally we only ever need original demanded elts of the base vector even if the index is unknown.
Martin Storsjö [Thu, 23 Jan 2020 11:23:12 +0000 (13:23 +0200)]
[LLD] [COFF] Silence a GCC warning about an unused variable. NFC.
Djordje Todorovic [Wed, 22 Jan 2020 12:08:56 +0000 (13:08 +0100)]
[NFC][DwarfDebug] Use proper analog GNU attribute for the pc address
The low_pc is analog to the DW_AT_call_return_pc, since it describes
the return address after the call. The DW_AT_call_pc is the address
of the call instruction, and we don't use it at the moment.
Differential Revision: https://reviews.llvm.org/D73173
Benjamin Kramer [Thu, 23 Jan 2020 10:46:10 +0000 (11:46 +0100)]
[mlir] Shrink-wrap anonymous namespaces around the classes it's supposed to enclose. NFC.
The coding standards prefer smaller anonymous namespaces with free
functions just being static and in the global namespace.
Clement Courbet [Wed, 22 Jan 2020 14:49:10 +0000 (15:49 +0100)]
[llvm-exegesis] Allow the randomizer to fail nicely...
Summary:
... instead of crashing.
On typical exmaple is when there are no available registers.
Reviewers: gchatelet
Subscribers: tschuett, mstojanovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73196
Sam McCall [Thu, 23 Jan 2020 09:38:59 +0000 (10:38 +0100)]
Revert "[Concepts] Placeholder constraints and abbreviated templates"
This reverts commit
e57a9abc4b01fa69fe81ace8df70517983b6cbac.
Parser/cxx2a-placeholder-type-constraint.cpp has MSan failures.
Present at
7b81c3f8793d30a4285095a9b67dcfca2117916c:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/17133/steps/check-clang%20msan/logs/stdio
not present at
eaa594f4ec54eba52b03fd9f1c789b214c66a753:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/17132/steps/check-clang%20msan/logs/stdio
Stack trace:
```
==57032==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0xccfe016 in clang::AutoTypeLoc::getLocalSourceRange() const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/TypeLoc.h:2036:19
#1 0xcc56758 in CheckDeducedPlaceholderConstraints(clang::Sema&, clang::AutoType const&, clang::AutoTypeLoc, clang::QualType) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4505:56
#2 0xcc550ce in clang::Sema::DeduceAutoType(clang::TypeLoc, clang::Expr*&, clang::QualType&, llvm::Optional<unsigned int>, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4707:11
#3 0xcc52407 in clang::Sema::DeduceAutoType(clang::TypeSourceInfo*, clang::Expr*&, clang::QualType&, llvm::Optional<unsigned int>, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4457:10
#4 0xba38332 in clang::Sema::deduceVarTypeFromInitializer(clang::VarDecl*, clang::DeclarationName, clang::QualType, clang::TypeSourceInfo*, clang::SourceRange, bool, clang::Expr*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaDecl.cpp:11351:7
#5 0xba3a8a9 in clang::Sema::DeduceVariableDeclarationType(clang::VarDecl*, bool, clang::Expr*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaDecl.cpp:11385:26
#6 0xba3c520 in clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaDecl.cpp:11725:9
#7 0xb39c498 in clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:2399:17
#8 0xb394d80 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:2128:21
#9 0xb383bbf in clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:1848:10
#10 0xb383129 in clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/PointerUnion.h
#11 0xb53a388 in clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:221:13
#12 0xb539309 in clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:106:20
#13 0xb55610e in clang::Parser::ParseCompoundStatementBody(bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:1079:11
#14 0xb559529 in clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:2204:21
#15 0xb33c13e in clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:1339:10
#16 0xb394703 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:2068:11
#17 0xb338e52 in clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:1099:10
#18 0xb337674 in clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:1115:12
#19 0xb334a96 in clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:935:12
#20 0xb32f12a in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:686:12
#21 0xb31e193 in clang::ParseAST(clang::Sema&, bool, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseAST.cpp:158:20
#22 0x80263f0 in clang::FrontendAction::Execute() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Frontend/FrontendAction.cpp:936:8
#23 0x7f2a257 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:965:33
#24 0x8288bef in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:25
#25 0xad44c2 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/driver/cc1_main.cpp:239:15
#26 0xacd76a in ExecuteCC1Tool(llvm::ArrayRef<char const*>) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/driver/driver.cpp:325:12
#27 0xacc9fd in main /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/driver/driver.cpp:398:12
#28 0x7f7d82cdb2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
#29 0xa4dde9 in _start (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-11+0xa4dde9)
```
Raphael Isemann [Thu, 23 Jan 2020 09:36:01 +0000 (10:36 +0100)]
[lldb][NFC] Delete empty file source/Host/linux/ProcessLauncherLinux.cpp
This was renamed in
816ae4b0dfac9a2bd964e8c4dae6dd7183ceb92a but it seems
the commit only emptied the file instead of deleting it.
Russell Gallop [Thu, 23 Jan 2020 09:27:16 +0000 (09:27 +0000)]
[test] Avoid loop-unroll.c test getting confused by fadd in git revision
Differential Revision: https://reviews.llvm.org/D73162
Georgii Rymar [Wed, 22 Jan 2020 10:14:04 +0000 (13:14 +0300)]
[llvm-readobj][test] - Add a check for --dyn-syms.
We have a `-dyn-symbols` option. It has a `--dyn-syms` alias
that is not tested in llvm-readobj tests currently.
There was a Object/readobj-elf-versioning.test where it is used,
but I've removed it in D73163. And also it is not the
right place to test it anyways.
Differential revision: https://reviews.llvm.org/D73164
Georgii Rymar [Wed, 22 Jan 2020 09:50:52 +0000 (12:50 +0300)]
[Object][test] - Remove readobj-elf-versioning.test and support files.
`readobj-elf-versioning.test` was added in rL152436 and
checks how llvm-readobj --dyn-syms prints versioned symbols.
We test the same in `llvm-readobj\ELF\dyn-symbols.test` currently.
This patch removes the test and 4 more support files from Inputs.
Differential revision: https://reviews.llvm.org/D73163
Raphael Isemann [Thu, 23 Jan 2020 09:04:13 +0000 (10:04 +0100)]
[lldb][NFC] Rename ClangASTContext to TypeSystemClang
Summary:
This commit renames ClangASTContext to TypeSystemClang to better reflect what this class is actually supposed to do
(implement the TypeSystem interface for Clang). It also gets rid of the very confusing situation that we have both a
`clang::ASTContext` and a `ClangASTContext` in clang (which sometimes causes Clang people to think I'm fiddling
with Clang's ASTContext when I'm actually just doing LLDB work).
I also have plans to potentially have multiple clang::ASTContext instances associated with one ClangASTContext so
the ASTContext naming will then become even more confusing to people.
Reviewers: #lldb, aprantl, shafik, clayborg, labath, JDevlieghere, davide, espindola, jdoerfert, xiaobai
Reviewed By: clayborg, labath, xiaobai
Subscribers: wuzish, emaste, nemanjai, mgorny, kbarton, MaskRay, arphaman, jfb, usaxena95, jingham, xiaobai, abidh, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72684
Clement Courbet [Thu, 23 Jan 2020 07:58:58 +0000 (08:58 +0100)]
[llvm-exegesis] Restrict to allowed back-to-back instructions in SerialSnippetGenerator.
Summary: Followup to D73161.
Reviewers: gchatelet, mstojanovic
Subscribers: tschuett, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73256
Markus Böck [Thu, 23 Jan 2020 08:43:56 +0000 (10:43 +0200)]
[LLD][COFF] Enable linking of __declspec(selectany) symbols from Clang and GCC
When annotating a symbol with __declspec(selectany), Clang assigns it
comdat 2 while GCC assigns it comdat 3. This patch enables two object
files that contain a __declspec(selectany) symbol, one created by gcc
and the other by clang, to be linked together instead of issuing a
duplicate symbol error.
Differential Revision: https://reviews.llvm.org/D73139
Daniil Suchkov [Tue, 21 Jan 2020 05:21:53 +0000 (12:21 +0700)]
[SSAUpdater] Don't call ValueIsRAUWd upon single use replacement
It is incorrect to call ValueHandleBase::ValueIsRAUWd when only one use
is replaced since it simply violates semantics of the callback and leads
to bugs like PR44320.
Previously this call was used specifically to keep LICM's cache of
AliasSetTrackers up to date across passes (as PR36801 showed, even for
that purpose it didn't work properly), but since LICM doesn't have that
cache anymore, we can safely remove this incorrect call with no
repercussions.
This patch fixes https://bugs.llvm.org/show_bug.cgi?id=44320
Reviewers: asbirlea, fhahn, efriedma, reames
Reviewed-By: asbirlea
Differential Revision: https://reviews.llvm.org/D73089
Igor Kudrin [Mon, 20 Jan 2020 09:44:00 +0000 (16:44 +0700)]
[DWARF] Eliminate the DWARFDebugNames::Header::Padding field.
The padding field is reserved for DWARF and does not contain any useful
information. No need to read, store and report it.
Differential Revision: https://reviews.llvm.org/D73042
Igor Kudrin [Mon, 20 Jan 2020 05:58:03 +0000 (12:58 +0700)]
[DWARF] Get rid of DWARFDebugNames::HeaderPOD. NFC.
This structure was used to get the size of the fixed-size part of a Name
Index header for 32-bit DWARF. It is unsuitable for 64-bit DWARF because
the size of the unit length field is different.
Differential Revision: https://reviews.llvm.org/D73040
Saar Raz [Thu, 23 Jan 2020 07:47:55 +0000 (09:47 +0200)]
[Concepts] Profile TypeConstraints in ProfileTemplateParameterList
Profile TypeConstraints in ProfileTemplateParameterList so we can distinguish
between partial specializations which differ in their TemplateParameterList
type constraints.
Recommit, now profiling the IDC so that we can deal with situations where the
TemplateArgsAsWritten are nullptr (happens when canonicalizing type constraints).
Saar Raz [Thu, 23 Jan 2020 07:57:20 +0000 (09:57 +0200)]
Revert "[Concepts] Profile TypeConstraints in ProfileTemplateParameterList"
This temporarily reverts commit
0e3ae353a47273825cd2f20f4777dcb5731cf8ec because
of a potential bug.
Igor Kudrin [Fri, 17 Jan 2020 11:59:32 +0000 (18:59 +0700)]
[DWARF] Support 64-bit DWARF in .debug_pubnames and similar tables.
Differential Revision: https://reviews.llvm.org/D73103
Saar Raz [Thu, 23 Jan 2020 07:47:55 +0000 (09:47 +0200)]
[Concepts] Profile TypeConstraints in ProfileTemplateParameterList
Profile TypeConstraints in ProfileTemplateParameterList so we can distinguish
between partial specializations which differ in their TemplateParameterList
type constraints
Martin Storsjö [Thu, 23 Jan 2020 07:42:43 +0000 (09:42 +0200)]
[lldb/Test] Don't add a check-* target as dependency in add_lit_testsuite
This causes the toplevel "test-depends" target, which should only build
all the dependencies necessary for running tests, to suddenaly also run
the check-lldb-repro-capture tests.
Instead add check-lldb-repro-capture as a dependency to check-lldb-repro
with a separate explicit add_dependencies call.
Daniil Suchkov [Fri, 10 Jan 2020 11:40:16 +0000 (18:40 +0700)]
NFC. Add PR44320 IR test case.
Daniil Suchkov [Mon, 20 Jan 2020 06:21:46 +0000 (13:21 +0700)]
NFC. Remove obsolete SimpleAnalysis infrastructure
Apparently cache of AliasSetTrackers held by LICM was the only user of
SimpleAnalysis infrastructure. Now, given that we no longer have that
cache, this infrastructure is obsolete and, taking into account its
nature, we don't want any new solutions to be based on it.
Reviewers: asbirlea, fhahn, efriedma, reames
Reviewed-By: asbirlea
Differential Revision: https://reviews.llvm.org/D73085
Igor Kudrin [Thu, 23 Jan 2020 06:06:03 +0000 (13:06 +0700)]
Fix build bot failures.
Unfortunately, not all compilers allow using llvm_unreachable
in a constexpr function.
LLVM GN Syncbot [Thu, 23 Jan 2020 05:43:56 +0000 (05:43 +0000)]
[gn build] Port
dcff3961c2d
Igor Kudrin [Thu, 26 Dec 2019 12:53:06 +0000 (19:53 +0700)]
[DWARF] Better detect errors in Address Range Tables.
The patch tries to cover most remaining cases of wrong data.
Differential Revision: https://reviews.llvm.org/D71932
Igor Kudrin [Mon, 23 Dec 2019 14:17:34 +0000 (21:17 +0700)]
[DWARF] Support DWARF64 in DWARFDebugArangeSet.
This allows parsing Address Range Tables in the 64-bit DWARF format.
Differential Revision: https://reviews.llvm.org/D71876
Igor Kudrin [Mon, 20 Jan 2020 04:52:07 +0000 (11:52 +0700)]
[DWARF] Make dwarf::getDwarfOffsetByteSize() a free function. NFC.
This will help simplify code in upcoming patches and make some
expressions constexpr.
Differential Revision: https://reviews.llvm.org/D73039
Igor Kudrin [Mon, 20 Jan 2020 04:37:37 +0000 (11:37 +0700)]
[DWARF] Make dwarf::getUnitLengthFieldByteSize() constexpr. NFC.
This will help make some expressions in upcoming patches constexpr.
Differential Revision: https://reviews.llvm.org/D73036
Igor Kudrin [Wed, 25 Dec 2019 07:05:56 +0000 (14:05 +0700)]
[DWARF] Return Error from DWARFDebugArangeSet::extract().
This helps to detect and report parsing errors better.
The patch follows the ideas of LLDB's patches D59370 and D59381.
It adds tests for valid and some invalid cases. More checks and
tests to come. Note that the patch fixes validation of the Length
field because the value does not include the field itself.
The existing users are updated to show the error messages.
Differential Revision: https://reviews.llvm.org/D71875