Stanislav Mekhanoshin [Wed, 23 Mar 2022 18:59:08 +0000 (11:59 -0700)]
[AMDGPU] gfx940 VALU hazard recognizer
Differntial Revision: https://reviews.llvm.org/D122339
Mehdi Amini [Tue, 29 Mar 2022 17:39:05 +0000 (17:39 +0000)]
Revert "[Support/BLAKE3] Re-enable building with the simd-optimized implementations"
This reverts commit
23519d3000b4703f17e639534a38b4f221fa4f63.
This breaks the build with clang-5:
/usr/bin/clang-5.0 -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Support/BLAKE3 -Illvm/lib/Support/BLAKE3 -Iinclude -Illvm/include -fPIC -O3 -DNDEBUG -MD -MT lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o -MF lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o.d -o lib/Support/BLAKE3/CMakeFiles/LLVMSupportBlake3.dir/blake3_avx512_x86-64_unix.S.o -c llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
...
llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S:54:9: error: instruction requires: AVX-512 ISA
kmovw k1, r9d
^
Chris Bieneman [Mon, 28 Mar 2022 21:33:16 +0000 (16:33 -0500)]
[ADT] add initializer list specialization for is_contained
Adding an initializer list specialization for is_contained allows for
compile-time evaluation when called with a constant or runtime
evaluation for non-constant values.
This patch doesn't add any uses of this template, but that is coming in
a subsequent patch.
Reviewed By: pete
Differential Revision: https://reviews.llvm.org/D122079
wangyihan [Tue, 29 Mar 2022 17:30:34 +0000 (10:30 -0700)]
[Clang][doc][NFC]Remove duplicate items in ReleaseNotes
Remove duplicate items in ReleaseNotes for __builtin_dump_struct, the
code changes int patch https://reviews.llvm.org/D122248
Differential Revision: https://reviews.llvm.org/D122668
Zixu Wang [Fri, 25 Mar 2022 18:43:44 +0000 (11:43 -0700)]
[clang][extract-api] Use correct language info from inputs
The current way of getting the `clang::Language` from `LangOptions` does
not handle Objective-C correctly because `clang::Language::ObjC` does
not correspond to any `LangStandard`. This patch passes the correct
`Language` from the frontend input information.
Differential Revision: https://reviews.llvm.org/D122495
Arjun P [Tue, 29 Mar 2022 16:57:14 +0000 (17:57 +0100)]
[MLIR][Presburger] Simplify std::{all,any}_of -> llvm::{all,any}_of (NFC)
Also simplify [](const F &f){ return f.foo(); } -> std::mem_fn(&F::foo)
Zequan Wu [Mon, 28 Mar 2022 23:42:53 +0000 (16:42 -0700)]
[llvm-pdbutil] Fix a crash due to Expected not checked before destruction
Reviewed By: aganea
Differential Revision: https://reviews.llvm.org/D122622
Mogball [Tue, 29 Mar 2022 16:54:41 +0000 (16:54 +0000)]
[mlir][ods] Allow null to be passed as default-valued attributes
Allow default-valued attributes to be passed as null to builders, which will not add the attribute if not present, so the default value will be returned by getters.
Fangrui Song [Tue, 29 Mar 2022 16:51:41 +0000 (09:51 -0700)]
[ELF] --emit-relocs: adjust offsets of .rel[a].eh_frame relocations
Two code paths may reach the EHFrame case in SectionBase::getOffset:
* .eh_frame reference
* relocation copy for --emit-relocs
The first may be used by clang_rt.crtbegin.o and GCC crtbeginT.o to get the
start address of the output .eh_frame. The relocation has an offset of 0 or
(x86-64 PC-relative leaq for clang_rt.crtbegin.o) -4. The current code just
returns `offset`, which handles this case well.
The second is related to InputSection::copyRelocations on .eh_frame (used by
--emit-relocs). .eh_frame pieces may be dropped due to GC/ICF, so we should
convert the input offset to the output offset. Use the same way as
MergeInputSection with a special case handling outSecOff==-1 for an invalid
piece (see eh-frame-marker.s).
This exposes an issue in mips64-eh-abs-reloc.s that we don't reliably
handle anyway. Just add --no-check-dynamic-relocations to paper over it.
Differential Revision: https://reviews.llvm.org/D122459
Aaron Ballman [Tue, 29 Mar 2022 16:26:38 +0000 (12:26 -0400)]
Fix a test failure.
This amends
3c84e4a0dbd08fc03bbcdd8354a984e0efcf7672 which had an
unsaved change when committed.
Simon Pilgrim [Tue, 29 Mar 2022 16:15:25 +0000 (17:15 +0100)]
[X86] combineCarryThroughADD - remove unused peek through of SEXT/AEXT nodes.
Aaron Ballman [Tue, 29 Mar 2022 16:13:54 +0000 (12:13 -0400)]
[C11] Improve the diagnostic when accessing a member of an atomic struct
Member access for an atomic structure or union is unconditional
undefined behavior (C11 6.5.2.3p5). However, we would issue a confusing
error message about the base expression not being a structure or union
type.
GCC issues a warning for this case. Clang now warns as well, but the
warning is defaulted to an error because the actual access is still
unsafe.
This fixes Issue 54563.
Ron Lieberman [Tue, 29 Mar 2022 14:53:27 +0000 (14:53 +0000)]
[libomptarget] x86 offloading fails map_back_race.cpp intermittently
Differential Revision: https://reviews.llvm.org/D122658
Pavel Labath [Mon, 21 Mar 2022 13:52:22 +0000 (14:52 +0100)]
[lldb] Remove usages of case-insensitive c-string functions
They are not portable (which meant we had a hand-rolled implementation
for windows), and llvm::StringRef provides equivalent functionality.
Danny Mösch [Tue, 29 Mar 2022 15:58:05 +0000 (17:58 +0200)]
[clang-tidy] Fix test failing on 32-bit architectures due to missing `__int128_t`
This was caused by
ff60af91ac0bbab12dd5ff5dc9b78bc1636f2d86. The reason for the failure is that
the type `__int128_t` is not available on 32-bit architectures. So just exclude the test case if
128-bit integers are not available.
Fangrui Song [Tue, 29 Mar 2022 15:56:21 +0000 (08:56 -0700)]
[ELF] --emit-relocs: fix missing STT_SECTION when the first input section is synthetic
addSectionSymbols suppresses the STT_SECTION symbol if the first input section
is non-SHF_MERGE synthetic. This is incorrect when the first input section is synthetic
while a non-synthetic input section exists:
* `.bss : { *(COMMON) *(.bss) }`
(
abc388ed3cf0ef7e617ebe243d3b0b32d29e69a5 regressed the case because
COMMON symbols precede .bss in the absence of a linker script)
* Place a synthetic section in another section: `.data : { *(.got) *(.data) }`
For `%t/a1` in the new test emit-relocs-synthetic.s, ld.lld produces incorrect
relocations with symbol index 0.
```
0000000000000000 <_start>:
0: 8b 05 33 00 00 00 movl 51(%rip), %eax # 0x39 <bss>
0000000000000002: R_X86_64_PC32 *ABS*+0xd
6: 8b 05 1c 00 00 00 movl 28(%rip), %eax # 0x28 <common>
0000000000000008: R_X86_64_PC32 common-0x4
c: 8b 05 06 00 00 00 movl 6(%rip), %eax # 0x18
000000000000000e: R_X86_64_GOTPCRELX *ABS*+0x4
```
Fix the issue by checking every input section.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D122463
Louis Dionne [Thu, 24 Mar 2022 13:27:03 +0000 (09:27 -0400)]
[libc++] Use __builtin_expect and __builtin_assume in _LIBCPP_ASSERT
Since we expect the condition to be true most of the time, we might
as well tell the compiler. And when assertions are disabled, we
might as well tell the compiler that it's allowed to assume that
the condition holds.
Differential Revision: https://reviews.llvm.org/D122397
Louis Dionne [Tue, 29 Mar 2022 15:45:49 +0000 (11:45 -0400)]
[libc++][NFC] Fix typo in comment
Hirochika Matsumoto [Tue, 29 Mar 2022 14:51:59 +0000 (10:51 -0400)]
[InstCombine] Fold (ctpop(X) == 1) | (X == 0) into ctpop(X) < 2
https://alive2.llvm.org/ce/z/94yRMN
Fixes #54177
Differential Revision: https://reviews.llvm.org/D122077
Johannes Doerfert [Mon, 21 Mar 2022 21:02:42 +0000 (16:02 -0500)]
[OpenMP] Regenerate the check lines for 2 tests
Somehow those check lines were mostly untested prefixes and the ones we
were looking for have been removed. Simple cleanup.
Ivan Butygin [Mon, 28 Mar 2022 08:09:00 +0000 (11:09 +0300)]
[mlir][spirv] Mark SPV_UndefOp NoSideEffect
Differential Revision: https://reviews.llvm.org/D122561
Nikita Popov [Tue, 29 Mar 2022 14:51:55 +0000 (16:51 +0200)]
[InstCombine] Remove call to getPointerElementType()
This was erroneously re-introduced as part of
bb0b23174e4ab963df427393fbf21bddede499bf.
Chris Bieneman [Tue, 29 Mar 2022 14:42:57 +0000 (09:42 -0500)]
[ADT] Flesh out HLSL raytracing environments
Fleshing this out now allows me to rely on enum math to translate
values rather than having to translate the off cases.
I should have added this in the first pass, but wasn't thinking about
it.
Nathan Sidwell [Tue, 29 Mar 2022 11:43:16 +0000 (04:43 -0700)]
[demangler] Update node match calls
Each demangler node's match function needs to call the provided
functor with constructor arguments. That was omitted from D120905.
This adds the new Precedence argument where necessary (and a missing
boolean for a module node).
The two visitors need updating with a printer for that type, and this
adds a stub to cxa_demangle's version. blaikie added one to llvm's.
I'll fill out those printers in a followup, rather than wait, so that
downstream consumers are unbroken.
Louis Dionne [Mon, 28 Mar 2022 17:10:14 +0000 (13:10 -0400)]
[libc++][libc++abi] Serialize the enable_assertions Lit parameter in the generated config
This means that re-running with llvm-lit in that configuration will
work as expected. This also enables assertions in libc++abi in the
Generic-assertions CI job, which was disabled previously.
Differential Revision: https://reviews.llvm.org/D122597
Simon Pilgrim [Tue, 29 Mar 2022 11:24:46 +0000 (12:24 +0100)]
[X86] Regenerate x86-interleaved-access.ll with AVX1OR2 common check-prefix to reduce duplication
Thomas Preud'homme [Tue, 29 Mar 2022 09:12:35 +0000 (10:12 +0100)]
Clarify invariants of software pipelining hooks
PowerPC backend relies on each pair of prologue/epilogue of a software
pipelined loop to correspond to a single iteration a the loop through
its use of the BDZ instruction to skip inner prologues/epilogues and
loop kernel. However the interface does not make it clear that it is a
valid way to check that the trip count is big enough to execute inner
prologues/epilogues and kernel loop.
The API also does not specify in which order of prologues the
createTripCountGreaterCondition() hook is being called. Knowing that it
starts with the last/innermost prologues can help recording some
information when createTripCountGreaterCondition() is first executed and
reuse it in setPreheader() or adjustTripCount().
This commit documents both aspects.
Reviewed By: jmolloy
Differential Revision: https://reviews.llvm.org/D122642
Javier Setoain [Thu, 24 Mar 2022 16:07:19 +0000 (16:07 +0000)]
[mlir][vector][nfc] Rename index optimizations option
We are using "enable-index-optimizations" and "indexOptimizations" as
names for an optimization that consists of using i32 for indices within
a vector. For instance, when building a vector comparison for mask
generation. The name is confusing and suggests a scope beyond these
vector indices. This change makes the function of the option explicit
in its name.
Differential Revision: https://reviews.llvm.org/D122415
serge-sans-paille [Mon, 28 Mar 2022 13:59:47 +0000 (15:59 +0200)]
[doc] Rely on tblgen to dump supported options value when generating doc
It was already the case for CLI help, also support it for rst output. As a side
effect remove redundant (and sometime inconsistent!) value help from HelpText in
clang/Driver/Options.td.
Differential Revision: https://reviews.llvm.org/D122378
Jay Foad [Tue, 29 Mar 2022 10:05:07 +0000 (11:05 +0100)]
[AMDGPU] Generate checks in atomic_optimizations_*.ll
This had already been done for some of these files but not all.
Sven van Haastregt [Tue, 29 Mar 2022 09:16:27 +0000 (10:16 +0100)]
[OpenCL] opencl-c.h: remove a/b/c/i/p/n/v arg names
This simplifies completeness comparisons against OpenCLBuiltins.td and
also makes the header no longer "claim" any single-letter identifiers.
Continues the direction set out in D119560.
David Green [Tue, 29 Mar 2022 09:12:44 +0000 (10:12 +0100)]
[AArch64] Ensure fixed point fptoi_sat has correct saturation width
D113200 introduced an error where it was converting FP_TO_SI_SAT with
multiply to a fixed point floating point convert. The saturation
bitwidth needs to be equal to the floating point width, or else the
routine would truncate the result as opposed to saturating it.
Fixes #54601
Florian Hahn [Tue, 29 Mar 2022 08:59:03 +0000 (09:59 +0100)]
[ConstraintElimination] Move ConstraintInfo after ConstraintTy. (NFC)
Code movement to it slightly easier to use ConstraintTy & co in
ConstraintInfo directly, for follow-up patches.
Guillaume Chatelet [Fri, 25 Mar 2022 13:21:20 +0000 (13:21 +0000)]
[NFC][libc] Disable benchmarks when the LLVM benchmark target is not available
Fixes https://github.com/llvm/llvm-project/issues/53686
Differential Revision: https://reviews.llvm.org/D122481
Chenbing Zheng [Tue, 29 Mar 2022 08:34:52 +0000 (16:34 +0800)]
[DAGCombine] add tests for bswap-shift optimization
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D121504
Uday Bondhugula [Tue, 29 Mar 2022 07:18:54 +0000 (12:48 +0530)]
[MLIR][NFC] Remove dead FlatAffineConstraints constructor
NFC. Remove dead FlatAffineConstraints constructor.
Differential Revision: https://reviews.llvm.org/D122638
Zi Xuan Wu [Tue, 29 Mar 2022 07:42:06 +0000 (15:42 +0800)]
[CSKY] Add CSKYTargetObjectFile to support exception handling
Initialize TargetLoweringObjectFileELF and EH header.
Zi Xuan Wu [Tue, 29 Mar 2022 07:05:49 +0000 (15:05 +0800)]
[CSKY] Add missing codegen pattern for 16-bit instruction
In generic cpu model, there are only low 16 registers and little 32-bit instruction. CK801 is the cpu
family with least basic features like generic model.
Add test run and check for generic cpu model in original test case to cover basic LLVM IR functionality.
Liqin Weng [Tue, 29 Mar 2022 07:44:44 +0000 (15:44 +0800)]
[RISCV][NFC] Improve encoding/decoding tests for Zbb/Zbp/Zbt instructions
Reviewed By: benshi001
Differential Revision: https://reviews.llvm.org/D122282
Jean Perier [Mon, 28 Mar 2022 17:05:36 +0000 (19:05 +0200)]
[flang] prevent undefined behavior in character MAXLOC folding
When folding MAXLOC/MINLOC, the current element being compared was moved twice
in row in case it became the new extremum. With numeric and logical types, it
made no difference (std::move is a no-op for them), but for characters
where the string storage is actually moved, it caused the new extremum to
be set to the empty string, leading to wrong results.
Note: I could have left the first std::move relating to logical Findloc, but it
brings nothing and makes the code less auditable, so I also removed it.
Differential Revision: https://reviews.llvm.org/D122590
Lian Wang [Tue, 22 Mar 2022 06:07:17 +0000 (06:07 +0000)]
[RISCV][NFC] Remove redundant check and rename functions in some IR tests
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D122204
Markus Böck [Tue, 29 Mar 2022 07:28:17 +0000 (09:28 +0200)]
[clang][DR] Test and mark DR1479 as complete
DR: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1479
Clang has implemented this DR as far back as I could go on compiler explorer (3.0). This patch simply adds a test case and needed comments for the update script to mark it as complete.
Differential Revision: https://reviews.llvm.org/D122620
Argyrios Kyrtzidis [Tue, 29 Mar 2022 04:00:58 +0000 (21:00 -0700)]
[Support/BLAKE3] Re-enable building with the simd-optimized implementations
Serguei Katkov [Fri, 25 Mar 2022 03:19:01 +0000 (10:19 +0700)]
[LSR] Fixup canonicalization formula and its checker.
According to definition of canonical form, it is a canonical
if scale reg does not contain addrec for loop L then none of bases
should contain addrec for this loop.
The critical word here is "contains".
Current checker of canonical form checks not "containing" property
but "is". So it does not check whether it contains but whether it is.
Fix the checker and canonicalizing utility to follow definition.
Without this fix in the test attached the base formula looking as
reg((-1 * {0,+,8}<nuw><nsw><%bb2>)<nsw>) + 1*reg((8 * (%arg /u 8))<nuw>)
is considered as conanocial while base contains an addrec.
And modified formula we want to insert
reg({0,+,8}<nuw><nsw><%bb2>) + 1*reg((-8 * (%arg /u 8)))
is considered as not canonical.
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D122457
serge-sans-paille [Mon, 28 Mar 2022 12:10:26 +0000 (14:10 +0200)]
Cleanup includes: final pass
Cleanup a few extra files, this closes the work on libLLVM dependencies on my
side.
Impact on libLLVM preprocessed output: -35876 lines
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D122576
luxufan [Tue, 29 Mar 2022 03:03:33 +0000 (11:03 +0800)]
[RISCV][test] Make PATH empty when testing --gcc-toolchain is multilib_riscv_elf_sdk
Due to D79842, clang dirver would search possible tool name in both possible
locations, then moving to the next name. The gcc toolchain `llvm-project/clang/test/Driver/
Inputs/multilib_riscv_elf_sdk` don't have a `riscv64-unknown-elf-ld` executable in
`llvm-project/clang/test/Driver/Inputs/multilib_riscv_elf_sdk/bin/`. So when searching
`riscv64-unknown-elf-ld`, if there is a `riscv64-unknown-elf-ld` in `PATH`, the
test would fail.
This patch makes the `PATH` empty when testing it.
Differential Revision: https://reviews.llvm.org/D122588
Liqin Weng [Tue, 29 Mar 2022 06:46:17 +0000 (14:46 +0800)]
[RISCV] Optimize LI+SLT to SLTI+XORI for immediates in specific range
This transform will reduce one GPR.
Reviewed By: craig.topper, benshi001
Differential Revision: https://reviews.llvm.org/D122051
LLVM GN Syncbot [Tue, 29 Mar 2022 06:21:57 +0000 (06:21 +0000)]
[gn build] Port
90cb325abda9
Paul Kirth [Tue, 29 Mar 2022 06:20:30 +0000 (06:20 +0000)]
Revert "[misexpect] Re-implement MisExpect Diagnostics"
This reverts commit
2add3fbd976d7b80a3a7fc14ef0deb9b1ca6beee.
Paul Kirth [Tue, 29 Mar 2022 06:19:53 +0000 (06:19 +0000)]
Revert "[docs][misexpect][NFC] Fix malformed table in docs"
This reverts commit
a427e18896dee3cd00d5f565cfb9d7d2f26ebcec.
Shraiysh Vaishay [Tue, 29 Mar 2022 05:12:45 +0000 (10:42 +0530)]
[flang][OpenMP] Added parallel sections translation
This patch adds translation for parallel sections from PFT to MLIR.
Reviewed By: kiranchandramohan, NimishMishra
Differential Revision: https://reviews.llvm.org/D122464
Nathan Ridge [Mon, 28 Mar 2022 06:13:20 +0000 (02:13 -0400)]
[clangd] Handle tabs in getIncrementalChangesAfterNewline()
Tabs are not handled by columnWidthUTF8() (they are considered
non-printable) so require additional logic to handle.
Fixes https://github.com/clangd/clangd/issues/1074
Differential Revision: https://reviews.llvm.org/D122554
Johannes Doerfert [Tue, 29 Mar 2022 05:02:28 +0000 (00:02 -0500)]
[OpenMP] The test does not have check lines
Dominic Chen [Fri, 25 Mar 2022 23:44:31 +0000 (16:44 -0700)]
[scudo] Use template specialization on Quarantine to avoid zero-length array
Use a separate templated QuarantineBlocks class to avoid a zero-length array
Differential Revision: https://reviews.llvm.org/D122518
Johannes Doerfert [Tue, 29 Mar 2022 04:14:00 +0000 (23:14 -0500)]
[OpenMP][FIX] Use clang++ for the C++ test case
Ben Shi [Tue, 29 Mar 2022 04:05:05 +0000 (12:05 +0800)]
[Driver][AVR] Emit proper warnings for different options
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D122524
Craig Topper [Tue, 29 Mar 2022 02:31:20 +0000 (19:31 -0700)]
[RISCV] Pull APInt/computeKnonwbits specifics out of computeGREVOrGORC. NFC
This function now takes a uint64_t instead of an APInt. The caller
is responsible for masking the shift amount, extracting and inserting
into the KnownBits APInts, and inverting to compute zeros.
This is less code and cleaner division of responsibilities.
Johannes Doerfert [Wed, 2 Mar 2022 19:46:01 +0000 (13:46 -0600)]
[OpenMP][FIX] Avoid races in the handling of to be deleted mapping entries
If we decided to delete a mapping entry we did not act on it right away
but first issued and waited for memory copies. In the meantime some
other thread might reuse the entry. While there was some logic to avoid
colliding on the actual "deletion" part, there were two races happening:
1) The data transfer back of the thread deleting the entry and
the data transfer back of the thread taking over the entry raced.
2) The update to the shadow map happened regardless if the entry was
actually reused by another thread which left the shadow map in a
inconsistent state.
To fix both issues we will now update the shadow map and delete the
entry only if we are sure the thread is responsible for deletion, hence
no other thread took over the entry and reused it. We also wait for a
potential former data transfer from the device to finish before we issue
another one that would race with it.
Fixes https://github.com/llvm/llvm-project/issues/54216
Differential Revision: https://reviews.llvm.org/D121058
Johannes Doerfert [Fri, 25 Mar 2022 21:07:57 +0000 (16:07 -0500)]
[OpenMP][NFC] Add missing virtual destructor to silence warning
Phoebe Wang [Tue, 29 Mar 2022 01:41:31 +0000 (09:41 +0800)]
[X86][regcall] Support passing / returning structures
Currently, the regcall calling conversion in Clang doesn't match with
ICC when passing / returning structures. https://godbolt.org/z/axxKMKrW7
This patch tries to fix the problem to match with ICC.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D122104
Fangrui Song [Tue, 29 Mar 2022 03:26:21 +0000 (20:26 -0700)]
Revert D122459 "[ELF] --emit-relocs: adjust offsets of .rel[a].eh_frame relocations"
This reverts commit
6faba31e0d88ce71e87567ddb51d2444524b8a81.
It may cause "offset is outside the section".
Philip Reames [Tue, 29 Mar 2022 03:06:22 +0000 (20:06 -0700)]
[memcpyopt] Common code into performCallSlotOptzn [NFC]
We have the same code repeated in both callers, sink it into callee.
The motivation here isn't just code style, we can also defer the relatively expensive aliasing checks until the cheap structural preconditions have been validated. (e.g. Don't bother aliasing if src is not an alloca.) This helps compile time significantly.
Philip Reames [Tue, 29 Mar 2022 02:28:13 +0000 (19:28 -0700)]
[slp] Delete dead scalar instructions feeding vectorized instructions
If we vectorize a e.g. store, we leave around a bunch of getelementptrs for the individual scalar stores which we removed. We can go ahead and delete them as well.
This is purely for test output quality and readability. It should have no effect in any sane pipeline.
Differential Revision: https://reviews.llvm.org/D122493
Jacques Pienaar [Tue, 29 Mar 2022 03:04:31 +0000 (20:04 -0700)]
[mlir] Fix leak in case of failed parse
A Block is optionally allocated & leaks in case of failed parse. Inline the
function and ensure Block gets freed unless parse is successful.
Differential Revision: https://reviews.llvm.org/D122112
zhongyunde [Tue, 29 Mar 2022 00:39:23 +0000 (08:39 +0800)]
[AArch64][GlobalISel] Add new MOVI pattern for fp constants
GlobalISel is used in option -O0, so add MOVI pattern for it,
which is done similar in gcc.(https://godbolt.org/z/8j6fzG3h6)
Fix https://github.com/llvm/llvm-project/issues/53651
Reviewed By: dmgreen, paquette
Differential Revision: https://reviews.llvm.org/D122559
long.chen [Tue, 29 Mar 2022 02:55:37 +0000 (19:55 -0700)]
Eliminate gcc7 compiler warnings
we will get warning:```parameter ‘op’ set but not used``` when template function with empty template parameter list.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D122527
Brad Smith [Tue, 29 Mar 2022 02:27:28 +0000 (22:27 -0400)]
[libcxx] random_device, specify optimal entropy properties for all OS's using arc4random()
Reviewed By: ldionne
Differential Revision: https://reviews.llvm.org/D122522
Dominic Chen [Tue, 29 Mar 2022 02:08:55 +0000 (19:08 -0700)]
Revert "[scudo] Use template specialization on Quarantine to avoid zero-length array"
This reverts commit
7dda44c189d74ec0a1bbe7dfff7c4d5f6b0e96d4.
Chenbing Zheng [Tue, 29 Mar 2022 01:55:06 +0000 (09:55 +0800)]
[RISCV] [NFC] add some tests for overloaded intrinsics of FP16
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D122564
Johannes Doerfert [Sat, 11 Sep 2021 23:34:47 +0000 (18:34 -0500)]
[Attributor][OpenMP] Add assumption for non-call assembly instructions
Inline assembly is scary but we need to support it for the OpenMP GPU
device runtime. The new assumption expresses the fact that it may not
have call semantics, that is, it will not call another function but
simply perform an operation or side-effect. This is important for
reachability in the presence of inline assembly.
Differential Revision: https://reviews.llvm.org/D109986
Johannes Doerfert [Mon, 14 Feb 2022 23:12:34 +0000 (17:12 -0600)]
[InstCombineCalls] Optimize call of bitcast even w/ parameter attributes
Before we gave up if a call through bitcast had parameter attributes.
Interestingly, we allowed attributes for the return value already. We
now handle both the same way, namely, we drop the ones that are
incompatible with the new type and keep the rest. This cannot cause
"more UB" than initially present.
Differential Revision: https://reviews.llvm.org/D119967
Shao-Ce SUN [Mon, 28 Mar 2022 18:31:39 +0000 (02:31 +0800)]
[NFC][CodeGen] Add a setTargetDAGCombine use ArrayRef
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D122557
Fangrui Song [Tue, 29 Mar 2022 00:52:27 +0000 (17:52 -0700)]
[AArch64] Allow .variant_pcs before the symbol is registered
glibc sysdeps/aarch64/tst-vpcs-mod.S has something like:
```
.variant_pcs vpcs_call
.global vpcs_call
```
This is supported by GNU as but leads to an error in MC. Use getOrCreateSymbol
to support a not-yet-registered symbol: call `registerSymbol` to ensure the
symbol exists even if there is no binding directive/label, to match GNU as.
While here, improve tests to check (1) a local symbol can get
STO_AARCH64_VARIANT_PCS (2) undefined .variant_pcs (3) an alias does not
inherit STO_AARCH64_VARIANT_PCS.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D122507
Paul Kirth [Mon, 28 Mar 2022 23:50:51 +0000 (23:50 +0000)]
[docs][misexpect][NFC] Fix malformed table in docs
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D122623
Craig Topper [Mon, 28 Mar 2022 23:44:57 +0000 (16:44 -0700)]
[RISCV] Add computeKnownBits support for RISCVISD::GORC.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D121575
Roland McGrath [Mon, 28 Mar 2022 21:05:23 +0000 (14:05 -0700)]
[Driver] Make -moutline-atomics default for aarch64-fuchsia targets
This makes Fuchsia consistent with Linux on AArch64.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D122613
Siva Chandra Reddy [Mon, 28 Mar 2022 21:11:08 +0000 (21:11 +0000)]
[libc] Set rtlib to compiler-rt in integration tests.
The clang driver to picks up compiler runtime files using full paths.
Without this, at least for aarch64, the driver tries to pick up the
compiler runtime files from the working directory.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D122617
LLVM GN Syncbot [Mon, 28 Mar 2022 23:38:54 +0000 (23:38 +0000)]
[gn build] Port
2add3fbd976d
Dominic Chen [Wed, 16 Mar 2022 20:40:58 +0000 (13:40 -0700)]
[scudo] Use cast on calls to __builtin_umul_overflow/__builtin_umull_overflow
Platforms may define uintptr_t differently, so perform an explicit cast
Differential Revision: https://reviews.llvm.org/D121852
Dominic Chen [Fri, 25 Mar 2022 23:44:31 +0000 (16:44 -0700)]
[scudo] Use template specialization on Quarantine to avoid zero-length array
Use a separate templated QuarantineBlocks class to avoid a zero-length array
Differential Revision: https://reviews.llvm.org/D122518
Paul Kirth [Sat, 19 Mar 2022 00:54:23 +0000 (00:54 +0000)]
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its
original checking methodology only using MD_prof branch_weights
metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be
populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be
lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch
weights are populated depending on the profiling method used, and emit
the correct diagnostics. If these invariants are ever invalidated, the
MisExpect related checks would need to be updated, potentially by
re-introducing MD_misexpect metadata, and ensuring it always will be
transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by
introducing a new CodeGen option, and checking if the -Wmisexpect flag
has been passed on the command line.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D115907
Benjamin Kramer [Mon, 28 Mar 2022 23:21:52 +0000 (01:21 +0200)]
Silence compiler warning after the addition of HLSL to Clang
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp:472:16: warning: enumeration value 'HLSL' not handled in switch [-Wswitch]
switch (IK.getLanguage()) {
^
Fangrui Song [Mon, 28 Mar 2022 23:23:13 +0000 (16:23 -0700)]
[ELF] --emit-relocs: adjust offsets of .rel[a].eh_frame relocations
.eh_frame pieces may be dropped due to GC/ICF. When --emit-relocs adds
relocations against .eh_frame, the offsets need to be adjusted. Use the same
way as MergeInputSection with a special case handling outSecOff==-1 for an
invalid piece (see eh-frame-marker.s).
This exposes an issue in mips64-eh-abs-reloc.s that we don't reliably
handle anyway. Just add --no-check-dynamic-relocations to paper over it.
Original patch by Ayrton Muñoz
Differential Revision: https://reviews.llvm.org/D122459
Alina Sbirlea [Mon, 28 Mar 2022 23:16:07 +0000 (16:16 -0700)]
Revert
29fada4a3d3db309f11f7fa7a0c61cd4021e9947
Seeing a test failure with asan in Halide generated code, reverting
while I investigate.
Differential Revision: https://reviews.llvm.org/D121987
Fangrui Song [Mon, 28 Mar 2022 22:55:46 +0000 (15:55 -0700)]
[ELF][test] Refactor some .eh_frame tests
* Improve eh-frame-merge.s
* Delete invalid .eh_frame+5 test in ehframe-relocation.s
Jacques Pienaar [Mon, 28 Mar 2022 22:44:40 +0000 (15:44 -0700)]
[mlir] Update Vector dialect to prefixed accessors.
Been >2 weeks since flipped to Both, following update procedure and
flipping to prefixed.
James Y Knight [Mon, 28 Mar 2022 22:27:18 +0000 (18:27 -0400)]
[Clang] Implement __builtin_source_location.
This builtin returns the address of a global instance of the
`std::source_location::__impl` type, which must be defined (with an
appropriate shape) before calling the builtin.
It will be used to implement std::source_location in libc++ in a
future change. The builtin is compatible with GCC's implementation,
and libstdc++'s usage. An intentional divergence is that GCC declares
the builtin's return type to be `const void*` (for
ease-of-implementation reasons), while Clang uses the actual type,
`const std::source_location::__impl*`.
In order to support this new functionality, I've also added a new
'UnnamedGlobalConstantDecl'. This artificial Decl is modeled after
MSGuidDecl, and is used to represent a generic concept of an lvalue
constant with global scope, deduplicated by its value. It's possible
that MSGuidDecl itself, or some of the other similar sorts of things
in Clang might be able to be refactored onto this more-generic
concept, but there's enough special-case weirdness in MSGuidDecl that
I gave up attempting to share code there, at least for now.
Finally, for compatibility with libstdc++'s <source_location> header,
I've added a second exception to the "cannot cast from void* to T* in
constant evaluation" rule. This seems a bit distasteful, but feels
like the best available option.
Reviewers: aaron.ballman, erichkeane
Differential Revision: https://reviews.llvm.org/D120159
Jacques Pienaar [Mon, 28 Mar 2022 22:20:48 +0000 (15:20 -0700)]
[mlir] Update the Builtin dialect to use prefixed accessors
Been >2 weeks since flipped to Both, following update procedure and
flipping to prefixed.
Geoffrey Martin-Noble [Mon, 28 Mar 2022 21:48:18 +0000 (14:48 -0700)]
[Bazel] Update zlib to 1.2.12
There's a vulnerability in 1.2.11:
https://twitter.com/taviso/status/
1508438583484452866
Differential Revision: https://reviews.llvm.org/D122619
Pierre d'Herbemont [Mon, 28 Mar 2022 20:24:02 +0000 (13:24 -0700)]
[attributes] Generalize attribute 'enforce_tcb' to Objective-C methods.
Calling an ObjC method from a C function marked with the 'enforce_tcb'
attribute did not produce a warning. Now it does, and on top of that
Objective-C methods can participate in TCBs themselves.
Differential Revision: https://reviews.llvm.org/D122343
Aaron Puchert [Mon, 28 Mar 2022 21:53:50 +0000 (23:53 +0200)]
Let clang-repl link privately against Clang components
First of all, this is the convention: all other tools have their
dependencies private. While it does not have an effect on linking
(there is no linking against executables), it does have an effect
on exporting: having the targets private allows installing the tools
without the libraries in a statically linked build, or a build against
libclang-cpp.so.
Reviewed By: v.g.vassilev
Differential Revision: https://reviews.llvm.org/D122546
David Blaikie [Mon, 28 Mar 2022 21:21:37 +0000 (21:21 +0000)]
ItaniumDemangler: Update BinaryExpr::match to match the ctor
Not sure if this could use more testing, but hopefully this is adequate.
Danny Mösch [Sun, 27 Mar 2022 14:41:32 +0000 (16:41 +0200)]
[clang-tidy] Utilize comparison operation implemented in APInt
This is a fix for #53963.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D122544
owenca [Sun, 27 Mar 2022 20:19:02 +0000 (13:19 -0700)]
[clang-format] Don't format qualifiers in PPDirective
Fixes #54513
Differential Revision: https://reviews.llvm.org/D122548
Chris Bieneman [Mon, 28 Mar 2022 20:01:41 +0000 (15:01 -0500)]
Add HLSL Language Option and Preprocessor
Bringing in HLSL as a language as well as language options for each of
the HLSL language standards.
While the HLSL language is unimplemented, this patch adds the
HLSL-specific preprocessor defines which enables testing of the command
line options through the driver.
Reviewed By: pete, rnk
Differential Revision: https://reviews.llvm.org/D122087
Emil Kieri [Mon, 28 Mar 2022 18:28:51 +0000 (20:28 +0200)]
[flang][driver] Make --version and -version consistent with clang
This patch makes -version valid, and --version invalid, for
flang-new -fc1. The invocation
flang-new --version
remains valid. This behaviour is consistent with clang
(and with clang -cc1 and clang -cc1as).
Previously, flang-new -fc1 accepted --version (as per Options.td), but
the frontend driver acutally checks for -version. As a result,
flang-new -fc1 --version
triggered no action, emitted no message, and stalled waiting for
standard input.
Fixes #51438
Reviewed By: PeteSteinfeld, awarzynski
Differential Revision: https://reviews.llvm.org/D122542
Fangrui Song [Mon, 28 Mar 2022 20:40:48 +0000 (13:40 -0700)]
[MC] Fix llvm_unreachable when a STB_GNU_UNIQUE symbol needs a relocation
STB_GNU_UNIQUE should be treated in a way similar to STB_GLOBAL.
This fixes an "Invalid Binding" failure in an LLVM_ENABLE_ASSERTIONS=on build
for source files like glibc elf/tst-unique1mod1.c .
This bug has been benign so far because (a) Clang does not produce
%gnu_unique_object by itself (b) a non-assertion build likely picks the
STB_GLOBAL code path anyway.
LLVM GN Syncbot [Mon, 28 Mar 2022 20:09:41 +0000 (20:09 +0000)]
[gn build] Port
c5e54e275241
chenglin.bi [Mon, 28 Mar 2022 20:05:22 +0000 (16:05 -0400)]
[InstCombine] Fold two select patterns into and-or
select (~a | c), a, b -> and a, (or c, b) https://alive2.llvm.org/ce/z/bnDobs
select (~c & b), a, b -> and b, (or a, c) https://alive2.llvm.org/ce/z/k2jJHJ
Differential Revision: https://reviews.llvm.org/D122152
Nico Weber [Sun, 27 Mar 2022 20:10:02 +0000 (16:10 -0400)]
[clang] Make Driver tests pass when running with temp dir containing "crt"
In a recent run, temp files got created in /tmp/lit-tmp-2wcrtcx1/foo-xxx.o.
Since the tmp path contained "crt", this made a few tests fail:
http://45.33.8.238/linux/72221/step_7.txt
Not allowing '/' as path of the file name prevents this.
Differential Revision: https://reviews.llvm.org/D122547