Commit Graph

419522 Commits

Author SHA1 Message Date
Mogball
610396e481 [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.
2022-03-29 16:55:00 +00:00
Fangrui Song
4645311933 [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
2022-03-29 09:51:41 -07:00
Aaron Ballman
43b34c981a Fix a test failure.
This amends 3c84e4a0db which had an
unsaved change when committed.
2022-03-29 12:27:23 -04:00
Simon Pilgrim
1ec109ec58 [X86] combineCarryThroughADD - remove unused peek through of SEXT/AEXT nodes. 2022-03-29 17:22:50 +01:00
Aaron Ballman
3c84e4a0db [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.
2022-03-29 12:14:36 -04:00
Ron Lieberman
95eac47260 [libomptarget] x86 offloading fails map_back_race.cpp intermittently
Differential Revision: https://reviews.llvm.org/D122658
2022-03-29 16:01:17 +00:00
Pavel Labath
13a3b0bb4b [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.
2022-03-29 17:59:17 +02:00
Danny Mösch
f10cee91ae [clang-tidy] Fix test failing on 32-bit architectures due to missing __int128_t
This was caused by ff60af91ac. 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.
2022-03-29 17:58:12 +02:00
Fangrui Song
7370a489b1 [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) }`
  (abc388ed3c 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
2022-03-29 08:56:21 -07:00
Louis Dionne
f0799465b2 [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
2022-03-29 11:46:47 -04:00
Louis Dionne
95a2527261 [libc++][NFC] Fix typo in comment 2022-03-29 11:45:56 -04:00
Hirochika Matsumoto
a3cffc1150 [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
2022-03-29 11:30:06 -04:00
Johannes Doerfert
95ea3e86bb [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.
2022-03-29 10:00:03 -05:00
Ivan Butygin
6f79240430 [mlir][spirv] Mark SPV_UndefOp NoSideEffect
Differential Revision: https://reviews.llvm.org/D122561
2022-03-29 17:54:32 +03:00
Nikita Popov
682ef39b1a [InstCombine] Remove call to getPointerElementType()
This was erroneously re-introduced as part of
bb0b23174e.
2022-03-29 16:52:29 +02:00
Chris Bieneman
5b6207f3cd [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.
2022-03-29 09:43:03 -05:00
Nathan Sidwell
c204cee642 [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.
2022-03-29 05:32:36 -07:00
Louis Dionne
65b1b3b961 [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
2022-03-29 08:17:25 -04:00
Simon Pilgrim
d32d65b903 [X86] Regenerate x86-interleaved-access.ll with AVX1OR2 common check-prefix to reduce duplication 2022-03-29 12:24:46 +01:00
Thomas Preud'homme
f1d8e46258 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
2022-03-29 11:44:10 +01:00
Javier Setoain
7bc8ad5109 [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
2022-03-29 11:33:22 +01:00
serge-sans-paille
f5c666742f [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
2022-03-29 12:25:33 +02:00
Jay Foad
2b754384ad [AMDGPU] Generate checks in atomic_optimizations_*.ll
This had already been done for some of these files but not all.
2022-03-29 11:05:23 +01:00
Sven van Haastregt
de30408b3b [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.
2022-03-29 10:16:27 +01:00
David Green
60f57b3658 [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
2022-03-29 10:12:44 +01:00
Florian Hahn
3dbb5eb2cd
[ConstraintElimination] Move ConstraintInfo after ConstraintTy. (NFC)
Code movement to it slightly easier to use ConstraintTy & co in
ConstraintInfo directly, for follow-up patches.
2022-03-29 09:59:03 +01:00
Guillaume Chatelet
df838dbcfa [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
2022-03-29 08:45:53 +00:00
Chenbing Zheng
6a01b676cf [DAGCombine] add tests for bswap-shift optimization
Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D121504
2022-03-29 16:34:52 +08:00
Uday Bondhugula
6e56d049db [MLIR][NFC] Remove dead FlatAffineConstraints constructor
NFC. Remove dead FlatAffineConstraints constructor.

Differential Revision: https://reviews.llvm.org/D122638
2022-03-29 13:44:56 +05:30
Zi Xuan Wu
0365c54ca3 [CSKY] Add CSKYTargetObjectFile to support exception handling
Initialize TargetLoweringObjectFileELF and EH header.
2022-03-29 16:05:30 +08:00
Zi Xuan Wu
27c18558e6 [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.
2022-03-29 16:05:30 +08:00
Liqin Weng
8568d681ae [RISCV][NFC] Improve encoding/decoding tests for Zbb/Zbp/Zbt instructions
Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D122282
2022-03-29 15:45:48 +08:00
Jean Perier
ec13942e71 [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
2022-03-29 09:34:09 +02:00
Lian Wang
2c503dcb4f [RISCV][NFC] Remove redundant check and rename functions in some IR tests
Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D122204
2022-03-29 07:29:58 +00:00
Markus Böck
984554f846 [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
2022-03-29 09:28:32 +02:00
Argyrios Kyrtzidis
23519d3000 [Support/BLAKE3] Re-enable building with the simd-optimized implementations 2022-03-29 00:18:24 -07:00
Serguei Katkov
6444a65514 [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
2022-03-29 14:05:04 +07:00
serge-sans-paille
01be9be2f2 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
2022-03-29 09:00:21 +02:00
luxufan
a5900401b1 [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
2022-03-29 14:51:23 +08:00
Liqin Weng
d660c0d793 [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
2022-03-29 14:46:49 +08:00
LLVM GN Syncbot
5314582407 [gn build] Port 90cb325abd 2022-03-29 06:21:57 +00:00
Paul Kirth
90cb325abd Revert "[misexpect] Re-implement MisExpect Diagnostics"
This reverts commit 2add3fbd97.
2022-03-29 06:20:30 +00:00
Paul Kirth
6c77972bac Revert "[docs][misexpect][NFC] Fix malformed table in docs"
This reverts commit a427e18896.
2022-03-29 06:19:53 +00:00
Shraiysh Vaishay
1fe4b968c5 [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
2022-03-29 11:16:38 +05:30
Nathan Ridge
9325e97a35 [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
2022-03-29 01:43:09 -04:00
Johannes Doerfert
b803f06901 [OpenMP] The test does not have check lines 2022-03-29 00:02:55 -05:00
Dominic Chen
0e1d2007aa [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
2022-03-28 21:35:49 -07:00
Johannes Doerfert
b309bdb970 [OpenMP][FIX] Use clang++ for the C++ test case 2022-03-28 23:14:24 -05:00
Ben Shi
50de68bc2f [Driver][AVR] Emit proper warnings for different options
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D122524
2022-03-29 12:05:21 +08:00
Craig Topper
45e85feba6 [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.
2022-03-28 20:53:54 -07:00