Andy Wingo [Wed, 21 Apr 2021 13:41:48 +0000 (15:41 +0200)]
[WebAssembly][CodeGen] IR support for WebAssembly local variables
This patch adds TargetStackID::WasmLocal. This stack holds locations of
values that are only addressable by name -- not via a pointer to memory.
For the WebAssembly target, these objects are lowered to WebAssembly
local variables, which are managed by the WebAssembly run-time and are
not addressable by linear memory.
For the WebAssembly target IR indicates that an AllocaInst should be put
on TargetStackID::WasmLocal by putting it in the non-integral address
space WASM_ADDRESS_SPACE_WASM_VAR, with value 1. SROA will mostly lift
these allocations to SSA locals, but any alloca that reaches instruction
selection (usually in non-optimized builds) will be assigned the new
TargetStackID there. Loads and stores to those values are transformed
to new WebAssemblyISD::LOCAL_GET / WebAssemblyISD::LOCAL_SET nodes,
which then lower to the type-specific LOCAL_GET_I32 etc instructions via
tablegen patterns.
Differential Revision: https://reviews.llvm.org/D101140
Tres Popp [Sun, 30 May 2021 17:50:54 +0000 (19:50 +0200)]
[mlir][NFC] Remove illegal TanhOp in LLVMConversionTarget
No tests fail and this seems to be technical debt from when the math
dialect was created. This should not be there as it prevents users from
configuring their converion target freely and results in unexpected
behavior on seemingly unrelated ops.
Differential Revision: https://reviews.llvm.org/D103388
Matthias Springer [Mon, 31 May 2021 08:22:35 +0000 (17:22 +0900)]
[mlir] Support permutation maps in vector transfer op folder
Fold away in_bounds attribute even if the transfer op has a non-identity permutation map.
Differential Revision: https://reviews.llvm.org/D103133
cynecx [Mon, 31 May 2021 08:00:35 +0000 (09:00 +0100)]
[LangRef] update according to unwinding support in inline asm
https://reviews.llvm.org/D95745 introduced a new `unwind` keyword for inline assembler expressions. Inline asms marked with the `unwind` keyword allows stack unwinding from inline assembly because the compiler emits unwinding information ("around" the inline asm) as it would for calls/invokes. Unwinding the stack from within non-unwind inline asm may cause UB.
Reviewed By: Amanieu
Differential Revision: https://reviews.llvm.org/D102642
Martin Storsjö [Fri, 28 May 2021 09:53:27 +0000 (09:53 +0000)]
[libcxx] [test] Add UNSUPPORTED: msvc in a couple verify.cpp tests
Due to issues with the detection of the clang-verify feature, these
tests have been skipped in the Windows CI configuration so far.
Differential Revision: https://reviews.llvm.org/D103308
Tres Popp [Sun, 30 May 2021 17:43:27 +0000 (19:43 +0200)]
[mlir][NFC] Rename MathToLLVM->MathToLibm
Kadir Cetinkaya [Mon, 31 May 2021 05:42:15 +0000 (07:42 +0200)]
[clangd] Move gtest include to TestTU.cpp from TestTU.h
Hyeongyu Kim [Mon, 31 May 2021 05:05:29 +0000 (14:05 +0900)]
[InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210)
As noted in PR45210: https://bugs.llvm.org/show_bug.cgi?id=45210
...the bug is triggered as Eli say when sext(idx) * ElementSize overflows.
```
// assume that GV is an array of 4-byte elements
GEP = gep GV, 0, Idx // this is accessing Idx * 4
L = load GEP
ICI = icmp eq L, value
=>
ICI = icmp eq Idx, NewIdx
```
The foldCmpLoadFromIndexedGlobal function simplifies GEP+load operation to icmp.
And there is a problem because Idx * ElementSize can overflow.
Let's assume that the wanted value is at offset 0.
Then, there are actually four possible values for Idx to match offset 0: 0x00..00, 0x40..00, 0x80..00, 0xC0..00.
We should return true for all these values, but currently, the new icmp only returns true for 0x00..00.
This problem can be solved by masking off (trailing zeros of ElementSize) bits from Idx.
```
...
=>
Idx' = and Idx, 0x3F..FF
ICI = icmp eq Idx', NewIdx
```
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D99481
Ben Shi [Mon, 31 May 2021 02:30:46 +0000 (10:30 +0800)]
[AVR][NFC] Refactor 8-bit & 16-bit shifts
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D98335
Bruce Mitchener [Sun, 30 May 2021 14:14:17 +0000 (21:14 +0700)]
[lldb] Fix typos. NFC.
Differential Revision: https://reviews.llvm.org/D103381
Chris Lattner [Sun, 30 May 2021 19:22:08 +0000 (12:22 -0700)]
[CSE] Make domInfo a stored property, cut use of DominanceInfo::hasDominanceInfo. NFC.
CSE is the only client of this API, refactor it a bit to pull the query
internally to make changes to DominanceInfo a bit easier. This commit
also improves comments a bit.
Lang Hames [Sat, 29 May 2021 18:42:09 +0000 (11:42 -0700)]
[ORC-RT] Add common.h -- Logging, casting and remote dispatch utilities.
Lang Hames [Sat, 29 May 2021 00:08:23 +0000 (17:08 -0700)]
[ORC-RT] Add OrcRTCWrapperFunctionResult.
OrcRTCWrapperFunctionResult is a C struct that can be used to return serialized
results from "wrapper functions" -- functions that deserialize an argument
buffer, call through to an actual implementation function, then serialize and
return the result of that function. Wrapper functions allow calls between ORC
and the ORC Runtime to be written using a single signature,
WrapperFunctionResult(const char *ArgData, size_t ArgSize), and without coupling
either side to a particular transport mechanism (in-memory, TCP, IPC, ... the
actual mechanism will be determined by the TargetProcessControl implementation).
OrcRTCWrapperFunctionResult is designed to allow small serialized buffers to
be returned by value, with larger serialized results stored on the heap. They
also provide an error state to report failures in serialization/deserialization.
David Green [Sun, 30 May 2021 17:02:14 +0000 (18:02 +0100)]
[ARM] Guard against loop variant gather ptr operands
This ensures that the operands of any gather/scatter instructions that
we attempt to push out of the loop are invariant, preventing invalid IR
from being generated.
Ben Shi [Sun, 30 May 2021 15:44:43 +0000 (23:44 +0800)]
[AVR] Improve inline assembly
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D96394
Florian Hahn [Sun, 30 May 2021 15:34:30 +0000 (16:34 +0100)]
[LoopDeletion] Add more tests with infinite sub-loops & mustprogress.
A couple of additional tests inspired by PR50511.
Butygin [Wed, 19 May 2021 19:04:29 +0000 (22:04 +0300)]
[mlir] StandardToLLVM: option to disable AllocOp lowering
Differential Revision: https://reviews.llvm.org/D103237
Ben Shi [Sun, 30 May 2021 14:39:07 +0000 (22:39 +0800)]
[clang][AVR] Add avr-libc/include to clang system include paths
Reviewed By: dylanmckay
Differential Revision: https://reviews.llvm.org/D97669
Roman Lebedev [Sun, 30 May 2021 13:40:01 +0000 (16:40 +0300)]
Revert "[clang-tidy] Simplify static assert check"
This patch starts to produce a very obvious false-positives,
despite the fact the preexisting tests already cover the pattern.
they clearly don't actually cover it.
https://godbolt.org/z/3zdqvbfxj
This reverts commit
1709bb8c7395418236ec94fe3b9d91fed746452b.
Florian Hahn [Sun, 30 May 2021 11:11:18 +0000 (12:11 +0100)]
[VectorCombine] Add tests with noundef index for load scalarization.
Sanjay Patel [Sun, 30 May 2021 10:43:33 +0000 (06:43 -0400)]
[InstCombine] fix miscompile from vector select substitution
This is similar to the fix in
c590a9880d7a ( PR49832 ), but
we missed handling the pattern for select of bools (no compare
inst).
We can't substitute a vector value because the equality condition
replacement that we are attempting requires that the condition
is true/false for the entire value. Vector select can be partly
true/false.
I added an assert for vector types, so we shouldn't hit this again.
Fixed formatting while auditing the callers.
https://llvm.org/PR50500
Florian Hahn [Sat, 29 May 2021 17:50:14 +0000 (18:50 +0100)]
[DAGCombine] Poison-prove scalarizeExtractedVectorLoad.
extractelement is poison if the index is out-of-bounds, so just
scalarizing the load may introduce an out-of-bounds load, which is UB.
To avoid introducing new UB, we can mask the index so it only contains
valid indices.
Fixes PR50382.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D103077
Mindong Chen [Sun, 30 May 2021 09:13:48 +0000 (17:13 +0800)]
[NFCI] Move DEBUG_TYPE definition below #includes
When you try to define a new DEBUG_TYPE in a header file, DEBUG_TYPE
definition defined around the #includes in files include it could
result in redefinition warnings even compile errors.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D102594
Pengxuan Zheng [Mon, 17 May 2021 19:16:07 +0000 (12:16 -0700)]
[SafeStack] Use proper API to get stack guard
Using the proper API automatically sets `__stack_chk_guard` to `dso_local` if
`Reloc::Static`. This wasn't strictly necessary until recently when dso_local was
no longer implied by `TargetMachine::shouldAssumeDSOLocal` for
`__stack_chk_guard`. By using the proper API, we can avoid generating unnecessary
GOT relocations.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D102646
Arthur Eubanks [Sun, 30 May 2021 06:08:15 +0000 (23:08 -0700)]
Revert "[TargetLowering] Only inspect attributes in the arguments for ArgListEntry"
This reverts commit
1c7f32334d4becc725b9025fd32291a0e5729acd.
Some code still needs to properly set parameter ABI attributes, see
D101806.
Arthur Eubanks [Sun, 30 May 2021 05:40:07 +0000 (22:40 -0700)]
Revert "[NFC] Use ArgListEntry indirect types more in ISel lowering"
This reverts commit
bc7d15c61da78864b35e3c114294d6e4db645611.
Dependent change is to be reverted.
Xuanda Yang [Sun, 30 May 2021 01:51:41 +0000 (09:51 +0800)]
[analyzer] MallocSizeof: sizeof pointer type is compatible with void*
source: https://bugs.llvm.org/show_bug.cgi?id=50214
Make sizeof pointer type compatible with void* in MallocSizeofChecker.
Reviewed By: NoQ
Differential Revision: https://reviews.llvm.org/D103358
Arthur O'Dwyer [Wed, 19 May 2021 15:57:04 +0000 (11:57 -0400)]
[libc++] Alphabetize and include-what-you-use. NFCI.
Differential Revision: https://reviews.llvm.org/D102781
Arthur O'Dwyer [Sat, 29 May 2021 17:12:16 +0000 (13:12 -0400)]
[libc++] [modules] Add __threading_support to the modulemap.
It looks to me as if *every* helper header needs to be added to the modulemap,
actually; which is unfortunate since we keep proliferating them at such a
rapid pace.
Fangrui Song [Sat, 29 May 2021 21:30:44 +0000 (14:30 -0700)]
[InstrProfiling][test] Improve tests
Arthur O'Dwyer [Sat, 29 May 2021 14:13:14 +0000 (10:13 -0400)]
[libc++] [test] Update "test_compare.h" users to avoid removed-in-C++20 members. NFCI.
Drive-by minor improvements to a couple of uses of min_pointer.
Differential Revision: https://reviews.llvm.org/D103366
David Green [Sat, 29 May 2021 20:04:26 +0000 (21:04 +0100)]
[ARM] Guard against WhileLoopStart kill flags
If the operand of the WhileLoopStart is flagged as killed, that
currently gets propogated to both the t2CMPri as the instruction is
reverted, and the newly created t2DoLoopStart. Only the second should
remain as killing the operand, the first dropping the flags.
Chris Lattner [Sat, 29 May 2021 17:50:15 +0000 (10:50 -0700)]
[Dominance] Speed up recalculate noticable, NFC.
This avoids trying to find the RegionKindInterface for every
operation in the program, we only need it if they have regions.
Differential Revision: https://reviews.llvm.org/D103367
Chris Lattner [Sat, 29 May 2021 17:33:20 +0000 (10:33 -0700)]
[Verifier] Inline a method to simplify the code in preparation for bigger changes, NFC.
Differential Revision: https://reviews.llvm.org/D103365
mydeveloperday [Sat, 29 May 2021 15:43:55 +0000 (16:43 +0100)]
[clang-format] successive C# attributes cause line breaking issues
{D74265} reduced the aggressiveness of line breaking following C# attributes, however this change removed any support for attributes on properties, causing significant ugliness to be introduced.
This revision goes some way to addressing that by re-introducing the more aggressive check to `mustBreakBefore()`, but constraining it to the most common cases where we use properties which should not impact the "caller info attributes" or the "[In , Out]" decorations that are normally put on pinvoke
It does not address my additional concerns of the original change regarding multiple C# attributes, as these are somewhat incorrectly handled by virtue of the fact its not recognising the second attribute as an attribute at all. But instead thinking its an array.
The purpose of this revision is to get back to where we were for the most common of cases as a stepping stone to resolving this. However {D74265} has broken a lot of C# code and this revision will go someway alone to addressing the majority.
Reviewed By: jbcoe, HazardyKnusperkeks, curdeius
Differential Revision: https://reviews.llvm.org/D103307
Jessica Clarke [Sat, 29 May 2021 14:11:37 +0000 (15:11 +0100)]
Revert "[RISCV] Remove -riscv-no-aliases in favour of new -M no-aliases"
The replacement doesn't work for llc, but it is needed by
patchable-function-entry.ll.
This reverts commit
aa9a30b83a06e3e5e68e32ea645ec2d9edc27efc.
Jessica Clarke [Sat, 29 May 2021 13:59:46 +0000 (14:59 +0100)]
[Support] Fix getMainExecutable on FreeBSD when called via an absolute path
On FreeBSD, absolute paths are passed unmodified in AT_EXECPATH, but
relative paths are resolved to absolute paths, and any symlinks will be
followed in the process. This means that the resource dir calculation
will be wrong if Clang is invoked as an absolute path to a symlink, and
this currently causes clang/test/Driver/rocm-detect.hip to fail on
FreeBSD. Thus, make sure to call realpath on the result, just like is
done on macOS.
Whilst here, clean up the old fallback auxargs loop to use the actual
type for auxargs rather than using lots of hacky casts that rely on
addresses and pointers being the same (which is not the case on CHERI,
and thus Arm's prototype Morello, although for little-endian systems it
happens to work still as the word-sized integer will be padded to a full
pointer, and it's someone academic given dereferencing past the end of
environ will give a bounds fault, but CheriBSD is new enough that the
elf_aux_info path will be used). This also makes the code easier to
follow, and removes the confusing double-increment of p.
Reviewed By: dim, arichardson
Differential Revision: https://reviews.llvm.org/D103346
Jessica Clarke [Sat, 29 May 2021 13:57:19 +0000 (14:57 +0100)]
[RISCV] Remove -riscv-no-aliases in favour of new -M no-aliases
Whilst here, also remove a couple of unnecessary -o - instances.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D103201
Sanjay Patel [Sat, 29 May 2021 12:52:26 +0000 (08:52 -0400)]
[InstCombine] fold zext of masked bit set/clear
This does not solve PR17101, but it is one of the
underlying diffs noted here:
https://bugs.llvm.org/show_bug.cgi?id=17101#c8
We could ease the one-use checks for the 'clear'
(no 'not' op) half of the transform, but I do not
know if that asymmetry would make things better
or worse.
Proofs:
https://rise4fun.com/Alive/uVB
Name: masked bit set
%sh1 = shl i32 1, %y
%and = and i32 %sh1, %x
%cmp = icmp ne i32 %and, 0
%r = zext i1 %cmp to i32
=>
%s = lshr i32 %x, %y
%r = and i32 %s, 1
Name: masked bit clear
%sh1 = shl i32 1, %y
%and = and i32 %sh1, %x
%cmp = icmp eq i32 %and, 0
%r = zext i1 %cmp to i32
=>
%xn = xor i32 %x, -1
%s = lshr i32 %xn, %y
%r = and i32 %s, 1
Note: this is a re-post of a patch that I committed at:
rGa041c4ec6f7a
The commit was reverted because it exposed another bug:
rGb212eb7159b40
But that has since been corrected with:
rG8a156d1c2795189 ( D101191 )
Differential Revision: https://reviews.llvm.org/D72396
Sanjay Patel [Fri, 28 May 2021 20:03:09 +0000 (16:03 -0400)]
[InstCombine] reduce code duplication; NFC
Denys Petrov [Fri, 28 May 2021 13:52:44 +0000 (16:52 +0300)]
[analyzer] Use Optional as a return type of StoreManager::castRegion
Summary: Make StoreManager::castRegion function usage safier. Replace `const MemRegion *` with `Optional<const MemRegion *>`. Simplified one of related test cases due to suggestions in D101635.
Differential Revision: https://reviews.llvm.org/D103319
Ulrich Weigand [Sat, 29 May 2021 10:15:18 +0000 (12:15 +0200)]
[SystemZ] Set getExtendForAtomicOps to ISD::ANY_EXTEND
The implementation of subword atomics does not actually
guarantee the result is zero-extended, which now caused
build bot failures after https://reviews.llvm.org/D101342
was landed.
LLVM GN Syncbot [Sat, 29 May 2021 07:51:43 +0000 (07:51 +0000)]
[gn build] Port
b13edf6e907b
Mark de Wever [Sat, 29 May 2021 07:50:26 +0000 (09:50 +0200)]
Revert "[libc++] NFC: Move unwrap_iter to its own header"
This reverts commit
9968896cd62a62b11ac61085534dd598c4bd3c60.
This commit seems to cause the build failures of main.
Nikita Popov [Sat, 29 May 2021 07:31:28 +0000 (09:31 +0200)]
[LoopUnroll] Make DomTree explicitly required (NFC)
Some of the code was already assuming that DT is non-null, so
make that requirement more explicit and remove unnecessary null
checks.
LemonBoy [Sat, 29 May 2021 06:50:34 +0000 (08:50 +0200)]
[AtomicExpandPass][AArch64] Promote xchg with floating-point types to integer ones
Follow the same strategy used for atomic loads/stores by converting the operands to equally-sized integer types.
This change prevents the atomic expansion pass from generating illegal LL/SC pairs when targeting AArch64: `expand-atomicrmw-xchg-fp.ll` would previously instantiate intrinsics such as `llvm.aarch64.ldaxr.p0f32` that cannot be lowered.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D103232
Fangrui Song [Sat, 29 May 2021 04:33:32 +0000 (21:33 -0700)]
[InstrProfiling][test] Fix stale linkage.ll
Fangrui Song [Sat, 29 May 2021 04:14:03 +0000 (21:14 -0700)]
[InstrProfiling][test] Fix stale tests
* Change linkage/visibility of __profn_ variables to match the reality
* alwaysinline.ll: Add "EnableValueProfiling", otherwise it doesn't test available_externally alwaysinline.
* Delete PR23499.ll - covered by other comdat tests.
Luke [Wed, 28 Apr 2021 15:25:31 +0000 (23:25 +0800)]
[RISCV] Enable interleaved vectorization for RVV
Enable interleaved vectorization for RVV.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D101469
Nico Weber [Sat, 29 May 2021 00:37:39 +0000 (20:37 -0400)]
[lld/mac] Don't crash on -order_file with assembly inputs on arm64
.s files with `-g` generate __debug_aranges on darwin/arm64 for some
reason, and those lead to `nullptr` symbols. Don't crash on that.
Fixes PR50517.
Differential Revision: https://reviews.llvm.org/D103350
Fangrui Song [Fri, 28 May 2021 23:58:38 +0000 (16:58 -0700)]
[Internalize] Simplify comdat renaming with noduplicates after D103043
I realized that we can use `comdat noduplicates` which is available on ELF.
Add a special case for wasm which doesn't support the feature.
Amara Emerson [Fri, 28 May 2021 22:33:02 +0000 (15:33 -0700)]
[AArch64][GlobalISel] Fix a crash during selection of a G_ZEXT(s8 = G_LOAD)
We have special handling for a zext of a load <32b because the load does a zext
for free. In that case, we just select the G_ZEXT as if it were a copy but this
triggered the copy checking code to balk at the mismatched size.
This was being hidden because normally these get combined into G_ZEXTLOAD but
for atomics this doesn't happen. The test case here just uses a normal load
because the particular atomic isn't supported yet anyway.
Zhihao Yuan [Wed, 26 May 2021 20:22:44 +0000 (13:22 -0700)]
[clang-format] New BreakInheritanceList style AfterComma
This inheritance list style has been widely adopted by Symantec,
a division of Broadcom Inc. It breaks after the commas that
separate the base-specifiers:
class Derived : public Base1,
private Base2
{
};
Differential Revision: https://reviews.llvm.org/D103204
Chris Lattner [Fri, 28 May 2021 22:12:44 +0000 (15:12 -0700)]
[Verifier] Significantly speed up IsolatedFromAbove checking. NFC.
The implementation had a couple of problems, including checking
"isProperAncestor" in an inefficient way. It also recursed into
other "isolated from above" ops. In the case of CIRCT, we get
three levels of isolated ops:
mlir::ModuleOp
firrtl::CircuitOp
firrtl::FModuleOp
The verification for module would recurse into the circuits and
fmodules checking them. The verifier hook for circuit would
recurse into all the modules reverifying them, fmoduleop would
then reverify them. The same happens for mlir::ModuleOp and Func.
While here, fix an old design problem: IsolatedFromAbove checking
was implemented by a method on the Region class, which isn't
actually general and isn't used by anything else. Move it over
to be a trait impl verifier method like the others and specialize
it for its task.
Differential Revision: https://reviews.llvm.org/D103345
Eli Friedman [Fri, 28 May 2021 22:32:36 +0000 (15:32 -0700)]
[CGAtomic] Delete outdated code comparing success/failure ordering for cmpxchg.
This doesn't actually have any effect: we only call this code with
SequentiallyConsistent orderings. But delete it anyway for consistency
with other recent changes.
Fangrui Song [Fri, 28 May 2021 22:15:59 +0000 (15:15 -0700)]
[lld-macho][test] Simplify --allow-empty with count 0
Nikita Popov [Fri, 28 May 2021 20:38:36 +0000 (22:38 +0200)]
[LoopUnroll] Use changeToUnreachable() (NFC)
When fulling unrolling with a non-latch exit, the latch block is
folded to unreachable. Replace this folding with the existing
changeToUnreachable() helper, rather than performing it manually.
This also moves the fold to happen after the manual DT update
for exit blocks. I believe this is correct in that the conversion
of an unconditional backedge into unreachable should not affect
the DT at all.
Differential Revision: https://reviews.llvm.org/D103340
Craig Topper [Fri, 28 May 2021 21:04:04 +0000 (14:04 -0700)]
[RISCV] Add separate MxList tablegen classes for widening/narrowing and sext.zext.vf2/4/8. NFC
This is cleaner than slicing the MxList to remove elements from
the beginning or end since that requires hardcoding the size.
I don't expect the size of the list to change, but we shouldn't
repeat it in multiple places.
Nikita Popov [Fri, 28 May 2021 20:48:23 +0000 (22:48 +0200)]
[LoopUnroll] Add store to unreachable latch test (NFC)
This is to show that we currently only convert the terminator to
unreachable, but don't clean up instructions before it (unless
trivial DCE removes them).
Also clean up excessive whitespace in this test.
Nikita Popov [Fri, 28 May 2021 18:14:32 +0000 (20:14 +0200)]
[LoopUnroll] Clean up exit folding (NFC)
This does some non-functional cleanup of exit folding during
unrolling. The two main changes are:
* First rewrite latch->header edges, which is unrelated to exit
folding.
* Combine folding for latch and non-latch exits. After the
previous change, the only difference in their logic is that
for non-latch exits we currently only fold "known non-exit"
cases, but not "known exit" cases.
I think this helps a lot to clarify this code and prepare it for
future changes.
Differential Revision: https://reviews.llvm.org/D103333
Craig Topper [Fri, 28 May 2021 19:59:34 +0000 (12:59 -0700)]
[RISCV] Pre-commit test cases for D103211. NFC
Bardia Mahjour [Fri, 28 May 2021 20:10:04 +0000 (16:10 -0400)]
[NFC] Remove confusing info about MainLoop VF/UF from debug message
Nico Weber [Thu, 27 May 2021 19:35:41 +0000 (15:35 -0400)]
[dsymutil tests] Try to make eh_frames.test run on other platforms
We now have llvm-otool :)
Marek Kurdej [Fri, 28 May 2021 19:48:13 +0000 (21:48 +0200)]
[clang-format] [docs] Regenerate style options documentation.
Forgotten in commits
fce8c10b,
9363aa90,
8d93d7ff.
Eli Friedman [Thu, 27 May 2021 20:35:59 +0000 (13:35 -0700)]
[AArch64][RISCV] Make sure isel correctly honors failure orderings.
If a cmpxchg specifies acquire or seq_cst on failure, make sure we
generate code consistent with that ordering even if the success ordering
is not acquire/seq_cst.
At one point, it was ambiguous whether this sort of construct was valid,
but the C++ standad and LLVM now accept arbitrary combinations of
success/failure orderings.
This doesn't address the corresponding issue in AtomicExpand. (This was
reported as https://bugs.llvm.org/show_bug.cgi?id=33332 .)
Fixes https://bugs.llvm.org/show_bug.cgi?id=50512.
Differential Revision: https://reviews.llvm.org/D103284
Nico Weber [Fri, 28 May 2021 19:39:12 +0000 (15:39 -0400)]
[gn build] manually port
982e3c05108b6 (check-lld needs dsymutil)
Arthur O'Dwyer [Fri, 28 May 2021 13:46:01 +0000 (09:46 -0400)]
[libc++] [test] Constexpr-ify a couple of insert-iterator tests.
This should have been done in D96385; thanks ldionne for the catch!
Also, make the back/front inserter behavior tests a little more thorough,
which incidentally caught a cut-and-paste-bug in `nasty_list`, so fix that.
Differential Revision: https://reviews.llvm.org/D103318
LLVM GN Syncbot [Fri, 28 May 2021 18:57:30 +0000 (18:57 +0000)]
[gn build] Port
9968896cd62a
Craig Topper [Fri, 28 May 2021 18:51:20 +0000 (11:51 -0700)]
[RISCV] Add octuple to LMULInfo tablegen class, remove octuple_from_str. NFCI
octuple_from_str was always used with the MX field from an
LMULInfo. Might as well just precompute it and put it in the class.
Nico Weber [Fri, 28 May 2021 18:49:18 +0000 (14:49 -0400)]
Revert "[clang][Parse] Add parsing support for C++ attributes on using-declarations"
This reverts commit
dc672999a9b12a156991891dc400308b52d569ba.
Breaks check-clang everywhere, see https://reviews.llvm.org/D91630
Craig Topper [Fri, 28 May 2021 18:28:45 +0000 (11:28 -0700)]
[VP] Make getMaskParamPos/getVectorLengthParamPos return unsigned. Lowercase function names.
Parameter positions seem like they should be unsigned.
While there, make function names lowercase per coding standards.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D103224
Craig Topper [Fri, 28 May 2021 17:24:54 +0000 (10:24 -0700)]
[SelectionDAG] Fix typo in assert. NFC
Florian Hahn [Fri, 28 May 2021 17:20:01 +0000 (18:20 +0100)]
[VectorCombine] Check indices for all extracts we scalarize.
We need to make sure that the indices of all extracts we scalarize are
valid.
Florian Hahn [Fri, 28 May 2021 14:41:24 +0000 (15:41 +0100)]
[VectorCombine] Add variants of multi-extract tests with assumes.
Stefan Pintilie [Fri, 28 May 2021 16:35:25 +0000 (11:35 -0500)]
Revert "Return "[LoopDeletion] Break backedge if we can prove that the loop is exited on 1st iteration" (try 2)"
This reverts commit
be1a23203b1de655b8c7dac7549818d975a0cbbf.
Stefan Pintilie [Fri, 28 May 2021 16:35:12 +0000 (11:35 -0500)]
Revert "[NFCI][LoopDeletion] Only query SCEV about loop successor if another successor is also in loop"
This reverts commit
b0b2bf3b5da950679db1431aae431a6dedea2245.
Stefan Pintilie [Fri, 28 May 2021 16:34:02 +0000 (11:34 -0500)]
Revert "[NFC] Formatting fix"
This reverts commit
59d938e649e62db0cef4903d495e838fbc6a6eb8.
Stefan Pintilie [Fri, 28 May 2021 16:33:45 +0000 (11:33 -0500)]
Revert "[NFC] Reuse existing variables instead of re-requesting successors"
This reverts commit
c467585682dcdda75e645ef3ab47c8b48440db12.
Stefan Pintilie [Fri, 28 May 2021 16:17:46 +0000 (11:17 -0500)]
Revert "[NFCI][LoopDeletion] Do not call complex analysis for known non-zero BTC"
This reverts commit
7d418dadf6b1e6fd9bcccf7c5b5e1db74992ee70.
Sanjay Patel [Fri, 28 May 2021 16:33:54 +0000 (12:33 -0400)]
[PassManager] unify late simplifycfg options between regular and LTO pipelines
This is split off from D102002, and I think it is clear that
the difference in behavior was not intended. Options were
added to SimplifyCFG over time, but different chunks of
the pass pipelines were not kept in sync.
Sanjay Patel [Fri, 28 May 2021 16:20:44 +0000 (12:20 -0400)]
[PhaseOrdering] add test for late simplifycfg with LTO; NFC
Part of D102002
Florian Hahn [Fri, 28 May 2021 15:58:59 +0000 (16:58 +0100)]
[LoopDeletion] Add test with potentially infinite sub-loop.
Tests for PR50511.
Louis Dionne [Fri, 28 May 2021 16:41:58 +0000 (12:41 -0400)]
[libc++] NFC: Move unwrap_iter to its own header
Jacques Pienaar [Fri, 28 May 2021 16:12:55 +0000 (09:12 -0700)]
[mlir] Add missing namespace to createCanonicalizerPass.
Erik Pilkington [Fri, 21 May 2021 16:53:02 +0000 (12:53 -0400)]
[clang][Parse] Add parsing support for C++ attributes on using-declarations
Differential Revision: https://reviews.llvm.org/D91630
Nemanja Ivanovic [Fri, 28 May 2021 15:53:49 +0000 (10:53 -0500)]
Revert "Fix "enumerator 'llvm::TargetStackID::WasmLocal' in switch of enum 'llvm::TargetStackID::Value' is not handled" MSVC warnings. NFCI."
Since
ca5f07f8c4bc96d16ed1992b810aa3897df157f2 already reverted
the cause for this warning, this commit now causes warnings about
a default label in a switch that covers the enum.
This reverts commit
cf2eeb114c59cfc3a80133e96c585188fa16cc98.
eopXD [Fri, 28 May 2021 06:58:10 +0000 (06:58 +0000)]
[LoopNest][LoopFlatten] Change LoopFlattenPass to LoopNest pass
This patch changes LoopFlattenPass from FunctionPass to LoopNestPass.
Utilize LoopNest and let function 'Flatten' generate information from it.
Reviewed By: Whitney
Differential Revision: https://reviews.llvm.org/D102904
David Stenberg [Fri, 28 May 2021 14:37:47 +0000 (16:37 +0200)]
[IR] Make TypeFinder aware of DIArgList values
TypeFinder did not find types under DIArgList. This resulted in a case
of invalid IR after GlobalOpt removed a global that was the only
non-DIArgList use of a struct type.
error: use of undefined type named 'struct.S'
call void @llvm.dbg.value(
metadata !DIArgList([1 x %struct.S]* undef, i64 %idxprom),
metadata !24, metadata !DIExpression([...]))
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D103306
Reid Kleckner [Fri, 28 May 2021 03:00:20 +0000 (20:00 -0700)]
[gn] Make ubsan errors fatal, as in cmake
Apparently ubsan errors are non-fatal by default. If you introduce UB
into LLVM and run the tests, if errors are not fatal, the test will
still produce the expected output and the tests will pass. In order to
make ubsan errors show up as test failures, they have to be made fatal.
Pass the -fno-sanitize-recover=all flag to make it so.
Differential Revision: https://reviews.llvm.org/D103298
LLVM GN Syncbot [Fri, 28 May 2021 14:09:31 +0000 (14:09 +0000)]
[gn build] Port
58b29a4efc22
Louis Dionne [Wed, 28 Apr 2021 19:02:08 +0000 (15:02 -0400)]
[libc++] Add all indirect callable concepts and projected
Differential Revision: https://reviews.llvm.org/D101277
Alexandre Ganea [Fri, 28 May 2021 13:45:31 +0000 (09:45 -0400)]
[LLD][COFF] Reduce the maximum size of the GHASH table
Before this patch, the maximum size of the GHASH table was 2^31 buckets. However we were storing the bucket index into a TypeIndex which has an input limit of (2^31)-4095 indices, see this link. Any value above that limit will improperly set the TypeIndex's high bit, which is interpreted as DecoratedItemIdMask. This used to cause bad indices on extraction when calling TypeIndex::toArrayIndex().
Differential Revision: https://reviews.llvm.org/D103297
Florian Hahn [Fri, 28 May 2021 12:33:40 +0000 (13:33 +0100)]
[AArch64] Add additional vector load scalarization tests for D103077.
Jan Svoboda [Fri, 28 May 2021 12:05:22 +0000 (14:05 +0200)]
[clang] NFC: Replace std::pair by a struct in InitHeaderSearch
This patch replaces a `std::pair` by a proper struct in `InitHeaderSearch`. This will be useful in a follow-up: D102923.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D102924
Nico Weber [Fri, 28 May 2021 12:04:39 +0000 (08:04 -0400)]
[gn build] (semi-manually) port
bd04d78d649b
Florian Hahn [Fri, 28 May 2021 11:12:50 +0000 (12:12 +0100)]
[Matrix] Move C++ matrix cast checks to TryStaticCast.
At the moment, the matrix support in CheckCXXCStyleCast (added in
D101696) breaks function-style constructor calls that take a
single matrix value, because it is treated as matrix cast.
Instead, unify the C++ matrix cast handling by moving the logic to
TryStaticCast and only handle the case where both types are matrix
types. Otherwise, fall back to the generic mis-match detection.
Suggested by @rjmccall
Reviewed By: SaurabhJha
Differential Revision: https://reviews.llvm.org/D103163
Sanjay Patel [Fri, 28 May 2021 10:30:28 +0000 (06:30 -0400)]
[x86] add test for extend of legal vector compare; NFC
Additional test coverage for D103280.
Simon Pilgrim [Fri, 28 May 2021 11:47:05 +0000 (12:47 +0100)]
Fix "enumerator 'llvm::TargetStackID::WasmLocal' in switch of enum 'llvm::TargetStackID::Value' is not handled" MSVC warnings. NFCI.
Fraser Cormack [Fri, 28 May 2021 11:14:49 +0000 (12:14 +0100)]
[RISCV][NFC] Merge identical RV32 and RV64 test checks
Fraser Cormack [Fri, 28 May 2021 11:03:04 +0000 (12:03 +0100)]
[RISCV] Add tests for fixed vector conversions between fp to/from i1
These fixed-length versions don't crash unlike the corresponding
scalable ones, but the code generation is scalarized. An imminent patch
will support scalable-vector conversions and improve the codegen for
these fixed-length conversions.