Commit Graph

372273 Commits

Author SHA1 Message Date
Lex Augusteijn fbceee2d63 Add an optional argument for pattern rewriter max iteration count (NFC)
Some rewriters take more iterations to converge, add a parameter to overwrite
the built-in maximum iteration count.

Fix PR48073.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D91553
2020-11-16 22:57:14 +00:00
Artem Dergachev 499bce3aba Revert "Revert "[analyzer] NFC: Separate PathDiagnosticConsumer options from AnalyzerOptions.""
This reverts commit 10f1ca99b4.

(cherry picked from commit c599fc738a70e482976c6cc0ea31bef561641279)
2020-11-16 14:37:50 -08:00
Sjoerd Meijer fa5cb4b936 [LoopFlatten] Disable IV widening
Disable widening of the IV in LoopFlatten while I investigate an assertion
failures. Please note that the pass is also not yet enabled by default.
2020-11-16 22:30:52 +00:00
Jessica Paquette 5bc0bd05e6 [AArch64][GlobalISel] Fold G_XOR x, -1 into G_SELECT and select CSINV
When we see

```
xor = G_XOR xor_lhs, -1
select = G_SELECT cc, tval, xor
```

Fold this into

```
select = CSINV tval, xor_lhs, cc
```

Update select-select.mir to reflect the changes.

For now, only handle the case where the G_XOR is the false-value for the
G_SELECT. It may make more sense to handle the true-value case in post-legalizer
lowering.

Differential Revision: https://reviews.llvm.org/D90774
2020-11-16 14:14:14 -08:00
Felix Berger ace9653c11 [clang-tidy] performance-unnecessary-copy-initialization: Check for const reference arguments that are replaced template parameter type.
This fixes false positive cases where a non-const reference is passed to a
std::function but interpreted as a const reference.

Fix the definition of the fake std::function added in the test to match
std::function and make the bug reproducible.

Reviewed-by: aaron.ballman

Differential Revision: https://reviews.llvm.org/D90042
2020-11-16 17:08:18 -05:00
Michael Liao f375885ab8 [InferAddrSpace] Teach to handle assumed address space.
- In certain cases, a generic pointer could be assumed as a pointer to
  the global memory space or other spaces. With a dedicated target hook
  to query that address space from a given value, infer-address-space
  pass could infer and propagate that to all its users.

Differential Revision: https://reviews.llvm.org/D91121
2020-11-16 17:06:33 -05:00
Kazushi (Jam) Marukawa 38621c45a8 [VE] Add lvm/svm intrinsic instructions
Add lvm/svm intrinsic instructions and a regression test.  Change
RegisterInfo to specify that VM0/VMP0 are constant and reserved
registers.  This modifies a vst regression test, so update it.
Also add pseudo instructions for VM512 register classes
and mechanism to expand them after register allocation.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D91541
2020-11-17 07:05:36 +09:00
Jonas Devlieghere c7cbf32f57 [crashlog] Implement parser for JSON encoded crashlogs
Add a parser for JSON crashlogs. The CrashLogParser now defers to either
the JSONCrashLogParser or the TextCrashLogParser. It first tries to
interpret the input as JSON, and if that fails falling back to the
textual parser.

Differential revision: https://reviews.llvm.org/D91130
2020-11-16 13:50:37 -08:00
Florian Hahn 5a4ca8b550 [ConstraintElimination] Add support for Or.
When processing conditional branches, if the condition is an OR of 2 compares
and the false successor only has the current block as predecessor, queue both
negated conditions for the false successor
2020-11-16 21:48:38 +00:00
Philip Reames 2240d3d054 [LoopVec] Introduce an api for detecting uniform memory ops
Split off D91398 at request of reviewer.
2020-11-16 13:30:48 -08:00
Louis Dionne 7ad8e19958 [libc++] Move the GDB pretty printer tests to the DSL
Also, enable them whenever we detect that gdb is available. Previously,
these tests would basically never run because they relied on a CMake
configuration option that defaulted to OFF.

Differential Revision: https://reviews.llvm.org/D91434
2020-11-16 16:16:39 -05:00
Kostya Kortchinsky f0703cb1b2 [scudo][standalone] Correct min/max region indices
The original code to keep track of the minimum and maximum indices
of allocated 32-bit primary regions was sketchy at best.

`MinRegionIndex` & `MaxRegionIndex` were shared between all size
classes, and could (theoretically) have been updated concurrently. This
didn't materialize anywhere I could see, but still it's not proper.

This changes those min/max indices by making them class specific rather
than global: classes are locked when growing, so there is no
concurrency there. This also allows to simplify some of the 32-bit
release code, that now doesn't have to go through all the regions to
get the proper min/max. Iterate and unmap will no longer have access to
the global min/max, but they aren't used as much so this is fine.

Differential Revision: https://reviews.llvm.org/D91106
2020-11-16 12:43:10 -08:00
Sean Silva 7c62c6313b [mlir] Add DecomposeCallGraphTypes pass.
This replaces the old type decomposition logic that was previously mixed
into bufferization, and makes it easily accessible.

This also deletes TestFinalizingBufferize, because after we remove the type
decomposition, it doesn't do anything that is not already provided by
func-bufferize.

Differential Revision: https://reviews.llvm.org/D90899
2020-11-16 12:25:35 -08:00
Nico Weber f2710d4b57 lld/mach-o: Infer darwinnew from filename ld64.lld.darwinnew too
`-flavor` is difficult to use through the clang driver since it
must be the first argument.

clang's `-fuse-ld=foo` looks for `ld64.foo` when targeting darwin,
so it's easiest if darwinnew accepts some `ld64.foo`. Let's go with
`ld64.lld.darwinnew`, so that `clang -fuse-ld=lld.darwinnew` does
the right thing (assuming a symlink with the name `ld64.ld.darwinnew
exists in the right place).

This is temporary until darwinnew replaces ld64.lld, and it only
exists to make testing the new lld port easier.
2020-11-16 15:23:03 -05:00
Philip Reames 257d33c815 [SCEV] Factor out part of wrap flag detection logic [NFC](try 2)
This is a cut down version of 1ec6e1 which was reverted due to a compile time issue.  The key changes made from that patch: 1) only infer the flags needed along each path, 2) be careful to preserve order of checks, and 3) avoid computing NW flags at all since we need to prove the stronger property (does not cross 0) in the caller anyways.

Assuming this doesn't trip regressions, I'm going to try weakening (1).  My end objective is to move flag inference into addrec construction.  If I can't weaken (1) without compile time impact, I'll have a problem.
2020-11-16 12:07:21 -08:00
Arnold Schwaighofer d861cc0e43 [coro] Async coroutines: Make sure we can handle control flow in suspend point dispatch function
Create a valid basic block with a terminator before we call
InlineFunction.

Differential Revision: https://reviews.llvm.org/D91547
2020-11-16 11:59:02 -08:00
Florian Hahn 15beb4e236 [ConstraintElimination] Add complex test cases. 2020-11-16 19:51:49 +00:00
Sanjay Patel 4e68bc0999 Revert "[InstCombine] add multi-use demanded bits fold for add with low-bit mask"
This reverts commit e56103d250.
There is a stage2 msan failure blamed on this commit:
http://lab.llvm.org:8011/#/builders/74/builds/888/steps/9/logs/stdio
2020-11-16 14:48:09 -05:00
Aaron Ballman fa72ce346c Another speculative fix for lldb related to ConstexprSpecKind 2020-11-16 14:39:34 -05:00
Aaron Ballman 1941d9651c Speculatively fix the lldb build
Pick up the changes from 41b65f166b.
2020-11-16 14:23:04 -05:00
Thorsten 41b65f166b Convert ConstexprKind from Specifiers.h to a scoped enum; NFC 2020-11-16 14:10:19 -05:00
Jonas Devlieghere ee91e2311c [dsymutil] Generalize handling of aliases external symbols
In f9fb9da36c we fixed spurious warnings
caused by aliases to private extern symbols. This patch generalizes that
to regular external symbols as well.
2020-11-16 11:04:31 -08:00
Amara Emerson 0b6090699a [AArch64][GlobalISel] Look through a G_ZEXT when trying to match shift-extended register offsets.
The G_ZEXT in these cases seems to actually come from a combine that we do but
SelectionDAG doesn't. Looking through it allows us to match "uxtw #2" addressing
modes.

Differential Revision: https://reviews.llvm.org/D91475
2020-11-16 10:50:46 -08:00
Scott Linder b877c35d4b [YAMLIO] Correctly diagnose empty alias/anchor
The `Range` of an alias/anchor token includes the leading `&` or `*`,
but it is skipped while parsing the name. The check for an empty name
fails to account for the skipped leading character and so the error is
never hit.

Fix the off-by-one and add a couple regression tests.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D91462
2020-11-16 18:45:05 +00:00
Craig Topper c37cc6bf7e [RISCV] Add MC tests for the User Vector CSRs
Make sure we can parse and print the user CSR names

Differential Revision: https://reviews.llvm.org/D91469
2020-11-16 10:40:18 -08:00
Louis Dionne f1cf6b47e4 [libc++] Remove transitional #error message
It's been more than 4 years now, so anyone that was defining
_LIBCPP_TRIVIAL_PAIR_COPY_CTOR has had ample time to see that
error and fix their code.
2020-11-16 13:36:16 -05:00
Jameson Nash bf6ed355c8 Reland "[AsmPrinter] fix -disable-debug-info option"
This reverts commit 105ed27ed8, and
removes the offending line from the tests.
2020-11-16 13:34:47 -05:00
Praveen G 2e26459fab [Flang][OpenMP] Add semantic checks for OpenMP Depend clause.
Add the semantic checks for the OpenMP 4.5 - 2.13.9 Depend clause.

1. List items in depend clause should not be zero length array sections.
2. A variable that is part of another variable like structure component
   should not be specified on a depend clause.

Test cases : omp-depend01.f90, omp-depend02.f90, omp-depend03.f90

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D89934
2020-11-16 13:11:28 -05:00
Craig Topper 124c93c528 [RISCV] When matching SROIW, check all 64 bits of the OR mask
We need to make sure the upper 32 bits are all ones to ensure the result is properly sign extended. Previously we only checked the lower 32 bits of the mask. I've also added a check that the shift amount is less than 32. Without that the original code asserts inside maskLeadingOnes if the SROI check is removed or the SROIW pattern is checked first. I've refactored the code to use early outs to reduce nesting.

I've also updated SLOIW matching with the same changes, but I couldn't find a broken test case with the existing code.

Differential Revision: https://reviews.llvm.org/D90961
2020-11-16 10:08:15 -08:00
Arthur Eubanks aeb0fdff35 [SimplifyCFG] Respect optforfuzzing in NPM pass
Regression caused by refactoring in
cdd006eec9.

See discussion in https://reviews.llvm.org/D89917.

Reviewed By: arsenm, morehouse

Differential Revision: https://reviews.llvm.org/D91473
2020-11-16 09:56:37 -08:00
Raphael Isemann 618f11ba0b [lldb] Skip TestCppKeywordsAsCIdentifiers on Windows
Somehow static_assert is a keyword with C on Windows (maybe the Windows
default is C11?). Skipping the test for now.
2020-11-16 18:41:04 +01:00
peter klausler df62afd559 [flang] Unsplit COMPLEX operations
COMPLEX negation, addition, subtraction, conversions of kind, and
equality/inequality were represented as component-wise REAL
operations.  It turns out to be easier for lowering if we
do not split and recombine these COMPLEX operations, and it
avoids a potential problem with COMPLEX valued function calls
in these contexts.  So add this suite of operations to the
typed expression representation in place of the component-wise
transformations, and support them in folding.

Differential revision: https://reviews.llvm.org/D91443
2020-11-16 09:39:03 -08:00
Jonathan Metzman 91703085f5 [fuzzer] Disable uncaught-exception on non-Win+undo bad fix
Test is failing on non-Windows platforms. Also undo speculative
fix since it causes failures on Windows.
2020-11-16 09:35:35 -08:00
Xun Li 985c524001 [Coroutine] Allocas used by StoreInst does not always escape
In the existing logic, for a given alloca, as long as its pointer value is stored into another location, it's considered as escaped.
This is a bit too conservative. Specifically, in non-optimized build mode, it's often to have patterns of code that first store an alloca somewhere and then load it right away.
These used should be handled without conservatively marking them escaped.

This patch tracks how the memory location where an alloca pointer is stored into is being used. As long as we only try to load from that location and nothing else, we can still
consider the original alloca not escaping and keep it on the stack instead of putting it on the frame.

Differential Revision: https://reviews.llvm.org/D91305
2020-11-16 09:14:44 -08:00
Jonathan Metzman a3be128709 [fuzzer] Add allocator_may_return_null to uncaught-exception.test.
Speculative fix for failing unittest.
2020-11-16 09:13:25 -08:00
Matt Arsenault d2e52eec51 AMDGPU: Select global saddr mode from SGPR pointer
Use the 64-bit SGPR base with a 0 offset, since it's 1 fewer
instruction to materialize the 0 vs. the 64-bit copy.
2020-11-16 11:51:06 -05:00
Mirko Brkusanin 4cf6dd518e [AMDGPU][GlobalISel] Fix lowerShlSat
RegBankSelect would crash on G_SELECT when type is not s1.

Differential Revision: https://reviews.llvm.org/D91437
2020-11-16 17:43:31 +01:00
Matt Arsenault a6e353b1d0 AMDGPU: Split large offsets when selecting global saddr mode
When the offset doesn't fit in the immediate field, move some to
voffset.
2020-11-16 11:36:01 -05:00
Victor Huang 6bb2ceac90 Fix the compilation assertion due to unreachable BB pruning not deleting the associated BB from the jump tables
This patch is added to remove the unreachable MBBs reference in the jump table.

Differential Revisien: https://reviews.llvm.org/D90498
Reviewed by: amyk, bsaleil
2020-11-16 10:35:31 -06:00
Jay Foad a6ecb2eb3d [AMDGPU] Add comments. NFC. 2020-11-16 16:34:13 +00:00
Christian Sigg 04481f26fa [mlir] Require std.alloc() ops to have canonical layout during LLVM lowering.
The current code allows strided layouts, but the number of elements allocated is ambiguous. It could be either the number of elements in the shape (the current implementation), or the amount of elements required to not index out-of-bounds with the given maps (which would require evaluating the layout map).

If we require the canonical layouts, the two will be the same.

Reviewed By: nicolasvasilache, ftynse

Differential Revision: https://reviews.llvm.org/D91523
2020-11-16 17:29:36 +01:00
Andrzej Warzynski 6c02835d6c [flang][f18] Remove "-fdebug-resolve-names"
This option doesn't enable any unique feature/code-patch. Also, it is
neither tested nor documented.

Differential Revision: https://reviews.llvm.org/D91537
2020-11-16 15:49:55 +00:00
Kazushi (Jam) Marukawa 44a4f93925 [VE] Optimize leaf functions
Optimize leaf functions by not generating save/restore for callee saved
registers.  Update regression tests also.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D91539
2020-11-17 00:38:01 +09:00
David Truby 843525075b [MLIR][OpenMP] Add omp.wsloop operation
This adds a simple definition of a "workshare loop" operation for
the OpenMP MLIR dialect, excluding the "reduction" and "allocate"
clauses and without a custom parser and pretty printer.

The schedule clause also does not yet accept the modifiers that are
permitted in OpenMP 5.0.

Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>

Reviewed By: ftynse, clementval

Differential Revision: https://reviews.llvm.org/D86071
2020-11-16 15:24:57 +00:00
Simon Moll a598c08ac8 [VE] fastcc and vreg-to-vreg copy
This defines a 'fastcc' for the VE target and implements vreg-to-vreg
copy for parameter passing.  The 'fastcc' extends the standard CC for
SX-Aurora with register passing of vector-typed parameters and return
values.

Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D90842
2020-11-16 16:24:22 +01:00
Yonghong Song 4369223ea7 BPF: make __builtin_btf_type_id() return 64bit int
Linux kernel recently added support for kernel modules
  https://lore.kernel.org/bpf/20201110011932.3201430-5-andrii@kernel.org/

In such cases, a type id in the kernel needs to be presented
as (btf id for modules, btf type id for this module).
Change __builtin_btf_type_id() to return 64bit value
so libbpf can do the above encoding.

Differential Revision: https://reviews.llvm.org/D91489
2020-11-16 07:08:41 -08:00
Xiangling Liao 9e407afd9b [AIX][driver] Include crti[_64].o and -bcdtors also for C language link invocations by default
In order to support attribute((constructor)) and attribute((destructor)),
which is used by various LLVM non-C++ runtime components, AIX will include
crti[_64].o and -bcdtors for C language link invocations by default.

Differential Revision: https://reviews.llvm.org/D91361
2020-11-16 10:07:57 -05:00
Raphael Isemann a8350ce79d [lldb] Add support for using variables with C++ keywords names in non-C++ expressions
LLDB is currently always activating C++ when parsing expressions as LLDB itself
is using C++ features when creating the final AST that will be codegen'd
(specifically, references to variables, namespaces and using declarations are
used).

This is causing problems for users that have variables in non-C++ programs (e.g.
plain C or Objective-C) that have names which are keywords in C++. Expressions
referencing those variables fail to parse as LLDB's Clang parser thinks those
identifiers are C++ keywords and not identifiers that may belong to a
declaration.

We can't just disable C++ in the expression parser for those situations as
replacing the functionality of the injected C++ code isn't trivial. So this
patch is just disabling most keywords that are exclusive to C++ in LLDB's Clang
parser when we are in a non-C++ expression. There are a few keywords we can't
disable for now:

* `using` as that's currently used in some situations to inject variables into the expression function.
* `__null` as that's used by LLDB to define `NULL`/`Nil`/`nil`.

Getting rid of these last two keywords is possible but is a large enough change
that this will be handled in follow up patches.

Note that this only changes the keyword status of those tokens but this patch
does not remove any C++ functionality from the expression parser. The type
system still follows C++ rules and so does the rest of the expression parser.

There is another small change that gives the hardcoded macro definitions in LLDB
a higher precedence than the macros imported from the Objective-C modules. The
reason for this is that the Objective-C modules in LLDB are actually parsed in
Objective-C++ mode and they end up providing the C++ definitions of certain
system macros (like `NULL` being defined as `nullptr`). So we have to move the
LLDB definition forward and surround the definition from the module with an
`#ifdef` to make sure that we use the correct LLDB definition that doesn't
reference C++ keywords. Or to give an example, this is how the expression source
code changes:

Before:
```
 #define NULL (nullptr) // injected module definition
 #ifndef NULL
 #define NULL (__null) // hardcoded LLDB definition
 #endif
```

After:
```
 #ifndef NULL
 #define NULL (__null) // hardcoded LLDB definition
 #endif
 #ifndef NULL
 #define NULL (nullptr) // injected module definition
 #endif
```

Fixes rdar://10356912

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D82770
2020-11-16 16:04:44 +01:00
LLVM GN Syncbot 07927ac675 [gn build] Port 8dbe44cb29 2020-11-16 14:58:16 +00:00
Florian Hahn 8dbe44cb29 Add pass to add !annotate metadata from @llvm.global.annotations.
This patch adds a new pass to add !annotation metadata for entries in
@llvm.global.anotations, which is generated  using
__attribute__((annotate("_name"))) on functions in Clang.

This has been discussed on llvm-dev as part of
    RFC: Combining Annotation Metadata and Remarks
    http://lists.llvm.org/pipermail/llvm-dev/2020-November/146393.html

Reviewed By: thegameg

Differential Revision: https://reviews.llvm.org/D91195
2020-11-16 14:57:11 +00:00