Commit Graph

424226 Commits

Author SHA1 Message Date
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
Diana Picus 1c0b03f6e7 [flang][driver] Support parsing response files
Add support for reading response files in the flang driver. Response
files contain command line arguments and are used whenever a command
becomes longer than the shell/environment limit. Response files are
recognized via the special "@path/to/response/file.rsp" syntax, which
distinguishes them from other file inputs.

This patch hardcodes GNU tokenization, since we don't have a CL mode for
the driver. In the future we might want to add a --rsp-quoting command
line option, like clang has, to accommodate Windows platforms.

Differential Revision: https://reviews.llvm.org/D124846
2022-05-18 08:25:45 +00:00
Yeting Kuo 00999fb6e1 [SelectionDAGBuilder] Pass fast math flags to most of VP SDNodes.
The patch does not pass math flags to float VPCmpIntrinsics because LLParser
could not identify float VPCmpIntrinsics as FPMathOperators.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D125600
2022-05-18 16:15:47 +08:00
Diana Picus 6bcafce103 [flang][Runtime] Use proper prototypes in Fortran_main. NFCI
This is compiled as C code, so it's a good idea to be explicit about the
prototype. Clang complains about this when -Wstrict-prototypes is used.

Differential Revision: https://reviews.llvm.org/D125672
2022-05-18 08:04:09 +00:00
Qiu Chaofan d9d15af787 [PowerPC] Treat llvm.fmuladd intrinsic as using CTR
This fixes bug 55463, similar to D78668. This is a temporary fix since
we will switch to post-isel CTR loop determination in the future.

Reviewed By: dim, shchenz

Differential Revision: https://reviews.llvm.org/D125746
2022-05-18 15:57:55 +08:00
rkayaith 7814b559bd [GreedyPatternRewriter] Avoid reversing constant order
The previous fix from af371f9f98 only applied when using a bottom-up
traversal. The change here applies the constant preprocessing logic to the
top-down case as well. This resolves the issue with the canonicalizer pass still
reordering constants, since it uses a top-down traversal by default.

Fixes #51892

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D125623
2022-05-18 00:55:59 -07:00
Nikita Popov e9a1c82d69 [SCEVExpander] Expand umin_seq using freeze
%x umin_seq %y is currently expanded to %x == 0 ? 0 : umin(%x, %y).
This patch changes the expansion to umin(%x, freeze %y) instead
(https://alive2.llvm.org/ce/z/wujUhp).

The motivation for this change are the test cases affected by
D124910, where the freeze expansion ultimately produces better
optimization results. This is largely because
`(%x umin_seq %y) == %x` is a common expansion pattern, which
reliably optimizes in freeze representation, but only sometimes
with the zero comparison (in particular, if %x == 0 can fold to
something else, we generally won't be able to cover reasonable
code from this.)

Differential Revision: https://reviews.llvm.org/D125372
2022-05-18 09:53:07 +02:00
Nikita Popov 323514de58 [LoopUnroll] Avoid branch on poison for runtime unroll with multiple exits
When performing runtime unrolling with multiple exits, one of the
earlier (non-latch) exits may exit the loop on the first iteration,
such that we never branch on the latch exit condition. As such, we
need to freeze the condition of the new branch that is introduced
before the loop, as it now executes unconditionally.

Differential Revision: https://reviews.llvm.org/D125754
2022-05-18 09:51:22 +02:00
Nikita Popov c4c01e4e4e [llvm-nm] Always use opaque pointers (PR55506)
Always enable opaque pointers in llvm-nm, because the tool doesn't
actually care, and this allows us to read both typed pointer and
opaque pointer bitcode files in one archive. Previously this
depended on the order inside the archive (it would work with an
opaque pointer bitcode file first, but fail with a typed pointer
bitcode file first).

Fixes https://github.com/llvm/llvm-project/issues/55506.

Differential Revision: https://reviews.llvm.org/D125751
2022-05-18 09:46:14 +02:00
rkayaith ebad5fb309 [mlir][Canonicalize] Fix command-line options
The canonicalize command-line options currently have no effect, as the pass is
reading the pass options in its constructor, before they're actually
initialized. This results in the default values of the options always being used.

The change here moves the initialization of the `GreedyRewriteConfig` out of the
constructor, so that it runs after the pass options have been parsed.

Fixes #55466

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D125621
2022-05-18 00:28:18 -07:00
River Riddle 17e2e7b788 [mlir:PDLL] Don't append / for directory code completion
This allows for properly using / as a trigger character, i.e.
more easily allows chaining include directory completions.
2022-05-18 00:23:47 -07:00
River Riddle 6d4471efb0 [mlir:PDLL] Improve the location ranges of several expressions during parsing
This allows for the range to encompass more of the source associated
with the full expression, making diagnostics easier to see/tooling easier/etc.
2022-05-18 00:23:47 -07:00
River Riddle e213e5a999 [mlir:PDLL] Drop space as a completion commit character
This causes annoyances when attempting to use space as
a trigger character (to start a different completion).
2022-05-18 00:23:47 -07:00
Martin Storsjö 92f1028ceb [llvm-readobj] Fix printing of Windows ARM unwind opcodes, add tests
The existing code was essentially untested; in some cases, it used
too narrow variable types to fit all the bits, in some cases the
bit manipulation operations were incorrect.

For the "ldr lr, [sp], #x" opcode, there's nothing in the documentation
that says it cannot be used in a prologue. (In practice, it would
probably seldom be used there, but technically there's nothing
stopping it from being used.) The documentation only specifies the
operation to replay for unwinding it, but the corresponding mirror
instruction to be printed for a prologue is "str lr, [sp, #-x]!".

Also improve printing of register masks, by aggregating registers
into ranges where possible, and make the printing of the terminating
branches clearer, as "bx <reg>" and "b.w <target>".

Differential Revision: https://reviews.llvm.org/D125643
2022-05-18 10:14:33 +03:00
Pavel Samolysov d81064949f [ArgPromotion] Add unused-argument.ll test (NFC)
If a pointer argument is unused within the callee, this argument should
be removed from the function's signature while all used pointer
arguments should be promoted as it is expected. The ArgumentPromotion
pass doesn't touch unused non-pointer arguments at all.
2022-05-18 10:05:13 +03:00
Marek Kurdej 573a5b5800 Revert "[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline."
This reverts commit 50cd52d935.

It provoked regressions in C++ and ObjectiveC as described in https://reviews.llvm.org/D123676#3515949.

Reproducers:
```
MACRO_BEGIN
#if A
int f();
#else
int f();
#endif
```

```
NS_SWIFT_NAME(A)
@interface B : C
@property(readonly) D value;
@end
```
2022-05-18 07:27:45 +02:00