Commit Graph

424241 Commits

Author SHA1 Message Date
NAKAMURA Takumi
6ca7eb2c6d [SCEV] Part 1, Serialize function calls in function arguments.
Evaluation odering in function call arguments is implementation-dependent.
In fact, gcc evaluates bottom-top and clang does top-bottom.

Fixes #55283 partially.

Part of https://reviews.llvm.org/D125627
2022-05-18 23:20:08 +09:00
Chris Bieneman
47258ffc5c [NFC] correcting a code comment. 2022-05-18 08:53:23 -05:00
LLVM GN Syncbot
0990d5b549 [gn build] Port ca875539f7 2022-05-18 13:39:15 +00:00
Thomas Preud'homme
8c975eac34 Assert on polymorphic pointer intrinsic param
Opaque pointers cannot be polymorphic on the pointed type given their
lack thereof. However they are currently accepted by tablegen but the
intrinsic signature verifier trips when verifying any further
polymorphic type because the opaque pointer codepath for pointers will
not push the pointed type in ArgTys.

This commit adds an assert to easily catch such cases instead of having
the generic signature match failure.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D125764
2022-05-18 14:35:49 +01:00
Nikita Popov
8e4c5d9902 [CGP] Regenerate test checks (NFC) 2022-05-18 15:35:21 +02:00
Sam McCall
1236b66a98 [lit] pass LLVM_SYMBOLIZER_PATH through to tests.
Currently several buildbots give unsymbolized traces on crash.
I suspect these are configuring the symbolizer in this way and regressed in
D122251 or thereabouts.

Trying this coupled with a reland of patch that failed on a couple of bots with
no useful stacktrace...
2022-05-18 15:30:37 +02:00
Sam McCall
ca875539f7 Reland(2) "[clangd] Indexing of standard library"
This reverts commit 6aabf60f2f.
2022-05-18 15:30:37 +02:00
Sanjay Patel
990cc49ca0 [InstCombine] avoid crash on fold of icmp with cast operand
We could do better by inserting a bitcast from scalar int
to vector int or using an insertelement (the alternate test
does not crash because there's an independent fold like that).

But this doesn't seem like a likely pattern, so just bail out
for now.

Fixes issue #55516.
2022-05-18 09:16:30 -04:00
Sanjay Patel
be6d7cc93c [InstCombine] reduce code duplication for checking types; NFC 2022-05-18 09:16:30 -04:00
David Spickett
00a1258593 [lldb][AArch64] Fix corefile memory reads when there are non-address bits
Previously if you read a code/data mask before there was a valid thread
you would get the top byte mask. This meant the value was "valid" as in,
don't read it again.

When using a corefile we ask for the data mask very early on and this
meant that later once you did have a thread it wouldn't read the
register to get the rest of the mask.

This fixes that and adds a corefile test generated from the same program
as in my previous change on this theme.

Depends on D118794

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D122411
2022-05-18 14:13:42 +01:00
Nikita Popov
128da94d38 [InstCombine] Remove disable-verify tests (NFC)
InstCombine is not required to do anything sensible if it receives
invalid IR.

These tests seem to be testing self-referential instructions that
may occur in unreachable code -- but InstCombine actually goes out
of the way to remove such instructions ahead of time so it doesn't
need to deal with them.
2022-05-18 14:48:48 +02:00
Dmitry Preobrazhensky
32ca9bd7b5 [AMDGPU][MC][GFX940] Correct tied operand decoding for smfmac opcodes
Differential Revision: https://reviews.llvm.org/D125790
2022-05-18 15:39:30 +03:00
Jonathan Wakely
46d9a6ebd6 [libcxx] [test] Include header for strverscmp
Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122570
2022-05-18 14:36:23 +02:00
Jonathan Wakely
89cacb9ee7 [libcxx] [test] Add missing header for std::numeric_limits
Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122571
2022-05-18 14:36:02 +02:00
Simon Pilgrim
4e198377f6 [X86] addcarry.ll - add nounwind to prevent cfi noise on tests 2022-05-18 13:30:43 +01:00
Simon Pilgrim
939affc67d [AArch64] neon-vmull-high-p64.ll - fix name/check mismatch identified in D125604
Typos meant that we weren't actually checking the function name, which wasn't accounting for mangling
2022-05-18 13:24:28 +01:00
Pietro Albini
fdd0195306 [Security Group] Update representative for Rust.
Steve Klabnik recently left the Rust project. Josh Stone (the other member of
the Rust Security Response WG) replaces him as one of the vendor contacts for
Rust.

Differential Revision: https://reviews.llvm.org/D119137
2022-05-18 14:21:19 +02:00
Dmitry Preobrazhensky
169416c64a [AMDGPU][MC][GFX7] Disable cache policy modifiers with SMRD
Differential Revision: https://reviews.llvm.org/D125799
2022-05-18 15:17:49 +03:00
Archibald Elliott
2321c36fbf [ARM] Don't Enable AES Pass for Generic Cores
This brings clang/llvm into line with GCC. The Pass is still enabled for
the affected cores, but is now opt-in when using `-march=`.

I also took the opportunity to add release notes for this change.

Reviewed By: john.brawn

Differential Revision: https://reviews.llvm.org/D125775
2022-05-18 13:10:31 +01:00
Benjamin Kramer
e497871356 [mlir][complex] Add pow/sqrt/tanh ops and lowering to libm
Lowering through libm gives us a baseline version, even though it's not
going to be particularly fast. This is similar to what we do for some
math dialect ops.

Differential Revision: https://reviews.llvm.org/D125550
2022-05-18 14:03:14 +02:00
Sven van Haastregt
21c29a8ae0 [OpenCL] Add cl_khr_subgroup_rotate builtins
Differential Revision: https://reviews.llvm.org/D124256
2022-05-18 13:02:17 +01:00
Dmitry Preobrazhensky
95a8af2750 [AMDGPU][MC][NFC] MUBUF code cleanup
Removed code that is no longer used after https://reviews.llvm.org/D124485.

Differential Revision: https://reviews.llvm.org/D125811
2022-05-18 15:00:38 +03:00
David Spickett
d9398a91e2 [lldb] Remove non-address bits from read/write addresses in lldb
Non-address bits are not part of the virtual address in a pointer.
So they must be removed before passing to interfaces like ptrace.

Some of them we get way with not removing, like AArch64's top byte.
However this is only because of a hardware feature that ignores them.

This change updates all the Process/Target Read/Write memory methods
to remove non-address bits before using addresses.

Doing it in this way keeps lldb-server simple and also fixes the
memory caching when differently tagged pointers for the same location
are read.

Removing the bits is done at the ReadMemory level not DoReadMemory
because particualrly for process, many subclasses override DoReadMemory.

Tests have been added for read/write at the command and API level,
for process and target. This includes variants like
Read<sometype>FromMemory. Commands are tested to make sure we remove
at the command and API level.

"memory find" is not included because:
* There is no API for it.
* It already has its own address handling tests.

Software breakpoints do use these methods but they are not tested
here because there are bigger issues to fix with those. This will
happen in another change.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D118794
2022-05-18 12:59:34 +01:00
David Spickett
3e928c4b9d Revert "[lldb] Add --all option to "memory region""
This reverts commit 8e648f195c
due to test failures on Windows:
https://lab.llvm.org/buildbot/#/builders/83/builds/19094
2022-05-18 11:57:20 +00:00
Simon Pilgrim
1584b2c74e [AArch64] fp16-v8-instructions.ll - remove some old defunct CHECKS identified in D125604
Typos meant that the update script never removed them
2022-05-18 12:49:05 +01:00
Simon Pilgrim
f718664866 [DebugInfo][X86] debug-info-template-parameter.ll - fix broken DW_AT_default_value checks identified in D125604 2022-05-18 12:39:02 +01:00
Simon Pilgrim
bf84ab7684 [X86] statepoint-vreg-details.ll - fix CHECK-VREG-LABEL typo identified in D125604 2022-05-18 12:33:53 +01:00
Simon Pilgrim
ec3bb17870 [X86] lvi-hardening-indirectbr.ll - fix X64-NOT typo identified in D125604 2022-05-18 12:33:27 +01:00
Simon Pilgrim
27942499ec [X86] copy-propagation.ll - fix CHECK-NEXT typo identified in D125604 2022-05-18 12:32:31 +01:00
Simon Pilgrim
5a0b7e875f [X86] coalesce-dead-lanes.mir - fix CHECK-LABEL typo identified in D125604 2022-05-18 12:31:42 +01:00
Simon Pilgrim
3f7fc0964e [X86] Regenerate select-ext.ll test for D125604
GlobalISel tests are barely supported on X86, so just regenerate for now to avoid a blocker
2022-05-18 12:25:45 +01:00
Tim Northover
04e5b7fd17 AArch64: fall back to DWARF instead of crashing on weird .cfi directives
CodeGen will only produce fixed formwat prologues, but hand-written assembly
can have .cfi directives in any combination they want. This should cause a
fallback to DWARF rather than an assertion failure (or an incorrect compact
unwind if assertions are disabled).
2022-05-18 11:42:42 +01:00
David Spickett
8e648f195c [lldb] Add --all option to "memory region"
This adds an option to the memory region command
to print all regions at once. Like you can do by
starting at address 0 and repeating the command
manually.

memory region [-a] [<address-expression>]

(lldb) memory region --all
[0x0000000000000000-0x0000000000400000) ---
[0x0000000000400000-0x0000000000401000) r-x <...>/a.out PT_LOAD[0]
<...>
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]
[0x0001000000000000-0xffffffffffffffff) ---

The output matches exactly what you'd get from
repeating the command. Including that it shows
unmapped areas between the mapped regions.

(this is why Process GetMemoryRegions is not
used, that skips unmapped areas)

Help text has been updated to show that you can have
an address or --all but not both.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D111791
2022-05-18 10:33:39 +00:00
Ivan Kosarev
140ad30b24 [AMDGPU][MC][GFX10] Add missing s_scratch_load tests.
Completes
https://reviews.llvm.org/D125117

Reviewed By: dp, arsenm

Differential Revision: https://reviews.llvm.org/D125753
2022-05-18 11:11:10 +01:00
Nikita Popov
c9e7049754 [JumpThreading] Look through freeze in getPredicateAt() fold
This code is valid for any icmp, so we can safely look through a
freeze when trying to find one.

A caveat here is that replaceFoldableUses() may not end up replacing
any uses in this case. It might make sense to use the freeze as the
context instruction (rather than the terminator) if there is a
freeze, to ensure that it always gets folded. This would require
some changes to how replaceFoldedUses() works though, as it
currently assumes that the value is valid at the end of the block.
2022-05-18 12:09:59 +02:00
Jay Foad
e2926501d8 [AMDGPU] Aggressively fold immediates in SIShrinkInstructions
Fold immediates regardless of how many uses they have. This is expected
to increase overall code size, but decrease register usage.

Differential Revision: https://reviews.llvm.org/D114644
2022-05-18 11:04:33 +01:00
Nikita Popov
bdf25477f6 [JumpThreading] Add additional freeze tests (NFC)
These are for the getPredicateAt() codepath.
2022-05-18 12:03:15 +02:00
Nikita Popov
e1d47d86d8 [IR] Report whether replaceUsesOfWith() changed something (NFC)
With change reporting in transformation passes in mind.
2022-05-18 11:46:28 +02:00
Sun Ziping
242961f23b [llvm][fix-irreducible] ensure that loop subtree under child is correctly reconnected to new loop
The modified function was incorrectly (not unnecessarily) ignoring grandchild
loops, and this change fixes the bug. In particular, this fixes the handling of
the loop { inner, body }. The TODO in the same function is talking about the b1
self loop, which may be "unnecessarily" lost, but that is a different issue.
2022-05-18 10:45:52 +01:00
Frederik Gossen
6d36cfed3b [MLIR] Make parseDimensionListRanked configurable wrt parsing a trailing x
Differential Revision: https://reviews.llvm.org/D125797
2022-05-18 05:42:35 -04:00
Nikita Popov
18c70a7bd9 [JumpThreading] Simplify getPredicateAt() based folding
It's sufficient to just fold the icmp to true/false here, and then
let constant terminator folding take care of the rest.

It should be noted that while replaceFoldableUses() may not replace
all uses of the icmp, at least the use in the terminator we're
working on is always replaceable, so terminator constant folding
should be reliably enabled as a subsequent step.
2022-05-18 11:24:52 +02:00
Jay Foad
3eb2281bc0 [AMDGPU] Aggressively fold immediates in SIFoldOperands
Previously SIFoldOperands::foldInstOperand would only fold a
non-inlinable immediate into a single user, so as not to increase code
size by adding the same 32-bit literal operand to many instructions.

This patch removes that restriction, so that a non-inlinable immediate
will be folded into any number of users. The rationale is:
- It reduces the number of registers used for holding constant values,
  which might increase occupancy. (On the other hand, many of these
  registers are SGPRs which no longer affect occupancy on GFX10+.)
- It reduces ALU stalls between the instruction that loads a constant
  into a register, and the instruction that uses it.
- The above benefits are expected to outweigh any increase in code size.

Differential Revision: https://reviews.llvm.org/D114643
2022-05-18 10:19:35 +01:00
River Riddle
aa568e082b [mlir:GreedyDriver] Return WalkResult::skip after deleting a known constant
This avoids use-after-free when trying to access the regions after visiting
the operation.
2022-05-18 02:14:02 -07:00
Jay Foad
dd12c3433e [AMDGPU] Shrink F16 MAD/FMA to MADAK/MADMK/FMAAK/FMAMK on GFX10
Differential Revision: https://reviews.llvm.org/D125803
2022-05-18 10:00:06 +01:00
David Spickett
7d8ec4dc44 [lldb] const a couple of getters on MemoryRegionInfo
GetDirtyPageList was being assigned to const & in most places anyway.
If you wanted to change the list you'd make a new one and call
SetDirtyPageList.

GetPageSize is just an int so no issues being const.

Differential Revision: https://reviews.llvm.org/D125786
2022-05-18 09:00:00 +00:00
Nikita Popov
d4cdf013c7 [JumpThreading] Use common code to skip freeze (NFC)
There are multiple places that want to look through freeze, so
store condition without freeze in a separate variable.
2022-05-18 10:49:41 +02:00
Gabor Marton
56b9b97c1e [clang][analyzer][ctu] Make CTU a two phase analysis
This new CTU implementation is the natural extension of the normal single TU
analysis. The approach consists of two analysis phases. During the first phase,
we do a normal single TU analysis. During this phase, if we find a foreign
function (that could be inlined from another TU) then we don’t inline that
immediately, we rather mark that to be analysed later.
When the first phase is finished then we start the second phase, the CTU phase.
In this phase, we continue the analysis from that point (exploded node)
which had been enqueued during the first phase. We gradually extend the
exploded graph of the single TU analysis with the new node that was
created by the inlining of the foreign function.

We count the number of analysis steps of the first phase and we limit the
second (ctu) phase with this number.

This new implementation makes it convenient for the users to run the
single-TU and the CTU analysis in one go, they don't need to run the two
analysis separately. Thus, we name this new implementation as "onego" CTU.

Discussion:
https://discourse.llvm.org/t/rfc-much-faster-cross-translation-unit-ctu-analysis-implementation/61728

Differential Revision: https://reviews.llvm.org/D123773
2022-05-18 10:35:52 +02:00
Gabor Marton
25ac078a96 [clang][ASTImporter] Add isNewDecl
Summary:
Add a new function with which we can query if a Decl had been newly
created during the import process. This feature is a must if we want to
have a different static analysis strategy for such newly created
declarations.

This is a dependent patch that is needed for the new CTU implementation
discribed at
https://discourse.llvm.org/t/rfc-much-faster-cross-translation-unit-ctu-analysis-implementation/61728

Differential Revision:
https://reviews.llvm.org/D123685
2022-05-18 10:35:52 +02:00
Florian Hahn
fcfb86483b
[LV] set Header earlier, use variable instead of repeated access (NFC). 2022-05-18 09:29:59 +01:00
Thomas Preud'homme
7e65ffaa8b [test, x86] Fix spurious x86-target-features.c failure
x86-target-features.c can spuriously fail when checking for absence of
the string "lvi" in the compiler output due to the temporary path used
for the output file. For example:
"-o" "/tmp/lit-tmp-981j7lvi/x86-target-features-670b86.o"
will make the test fail. This commit checks specifically for lvi as a
target feature, in a similar way to the positive CHECK directive just
above.

Test Plan: fails when using -mlvi-hardening and pass otherwise

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D125084
2022-05-18 09:27:32 +01:00