513031 Commits

Author SHA1 Message Date
Florian Hahn
4be1c19a9f
[VPlan] Adjust AnyOf after creating ComputeReductionResult (NFC).
Prepares for a follow-up change to use VPInstruction::ResumePhi to
create the resume phi for reductions.
2024-09-25 14:13:50 +01:00
Chris Apple
fd88121a58
[rtsan] Link in proper CXX ABI library (#109715)
To match other sanitizers
2024-09-25 06:09:30 -07:00
Alexey Bataev
8e9011b3b8 [LV][NFC]Fix formatting 2024-09-25 06:05:35 -07:00
sstipano
ab0e8d0678
[AMDGPU] Fix failing test after #109958 (#109964) 2024-09-25 15:02:23 +02:00
Alexey Bataev
60ed2361c0
[LV][EVL]Explicitly model AVL as sub, original TC, EVL_PHI.
Patch explicitly models AVL as sub original TC, EVL_PHI instead of
having it in EXPLICIT-VECTOR-LENGTH VPInstruction. Required for correct
safe dependence distance suport.

Reviewers: fhahn, ayalz

Reviewed By: ayalz

Pull Request: https://github.com/llvm/llvm-project/pull/108869
2024-09-25 08:58:29 -04:00
Nikita Popov
5ef02a3fd4 [InstCombine] Fall through to computeKnownBits() for sdiv by -1
When dividing by -1 we were breaking out of the code entirely,
while we should fall through to computeKnownBits().

This fixes an instcombine-verify-known-bits discrepancy.

Fixes https://github.com/llvm/llvm-project/issues/109957.
2024-09-25 14:23:06 +02:00
Abhina Sree
1e67e4bbba
[SystemZ][z/OS] z/OS does not support nanosleep, use usleep instead (#109823)
Use usleep instead of nanosleep to resolve a build error on z/OS because
there is no support for nanosleep.
2024-09-25 08:21:29 -04:00
Yingwei Zheng
59693ea6d1
[ConstantFPRange] Remove ConstantFPRange::toKnownFPClass (#109960)
Addresses comment
https://github.com/llvm/llvm-project/pull/86483#pullrequestreview-2327710679.
2024-09-25 20:20:03 +08:00
Haojian Wu
fe06a6daae
Reland: [clang] Diagnose dangling issues for the "Container<GSLPointer>" case. #107213 (#108344)
This relands #107213, with with fixes to address false positives
(`make_optional(nullptr)`).
2024-09-25 14:12:49 +02:00
Rahul Joshi
1c984b86b3
[LLVM][TableGen] Adopt !listflatten for Intrinsic type signature (#109884)
Intrinisc type signature is a `list<list<int>>` that hold IIT encoding
for each param/ret type (outer list) where the IIT encoding for each
type itself can be 0 or more integers (the inner list). Intrinsic
emitter flatten this list into generate the type signature in
`ComputeTypeSignature`.

Use the new !listflatten() operator to instead flatten the list in the
TableGen definition and eliminate flattening in the emitter code.

Verified that `-gen-intrinsic-impl` output for Intrinsics.td is
identical with and without the change.
2024-09-25 04:50:09 -07:00
Adrian Vogelsgesang
786dc5a2da
[lldb-dap] Simplify readMemory (#109485)
The `readMemory` request used the `MemoryRegionInfo` so it could also
support short reads. Since #106532, this is no longer necessary, as
mentioned by @labath in a comment on #104317.

With this commit, we no longer set the `unreadableBytes` in the result.
But this is optional, anyway, according to the spec, and afaik the
VS Code UI does not make good use of `unreadableBytes`, anyway.

We prefer `SBTarget::ReadMemory` over `SBProcess::ReadMemory`, because
the `memory read` command also reads memory through the target instead
of the process, and because users would expect the UI view and the
results from memory read to be in-sync.
2024-09-25 13:49:42 +02:00
Victor Campos
2a29d24ba9
[ADT] Use perfect forwarding in SmallSet::insert() (#108590)
Previously this method took arguments by const-ref. This patch changes
the implementation to take perfectly forwarded arguments in the form of
a universal reference. Now, the insertion method will take advantage of
arguments passed as rvalue, potentially leading to performance
improvements.
2024-09-25 12:43:41 +01:00
Luke Lau
9583215d55 [RISCV] Add splat tests for zvfbfmin and without zfhmin/zfbfmin. NFC
This exercises the lowering path when the scalar type isn't legal.
2024-09-25 19:41:17 +08:00
Juan Manuel Martinez Caamaño
b40ff5ac2d
[AMDGPU][StructurizeCFG] Maintain branch MD_prof metadata (#109813)
Currently `StructurizeCFG` drops branch_weight metadata .
This metadata can be generated from user annotations in the source code
like:

```cpp
if (...) [[likely]] {
}
```
2024-09-25 13:15:23 +02:00
Youngsuk Kim
f5838cc17f [clang-tools-extra] Don't flush llvm::raw_string_ostream (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op.
As specified in the docs, raw_string_ostream is always unbuffered.
( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
2024-09-25 06:12:45 -05:00
Andrei Safronov
dc2d0d5e1a
[Xtensa] Add basic support for inline asm constraints. (#108986) 2024-09-25 14:02:58 +03:00
sstipano
4f951503b9
Reland "[AMDGPU][GlobalIsel] Use isRegisterClassType for G_FREEZE and G_IMPLICIT_DEF (#101331)" (#109958)
S192 type was missing from AllScalarTypes.
2024-09-25 13:02:29 +02:00
Luke Lau
f43ad88ae1
[RISCV] Handle zvfhmin and zvfbfmin promotion to f32 in half arith costs (#108361)
Arithmetic half or bfloat ops on zvfhmin and zvfbfmin respectively will
be promoted and carried out in f32, so this updates
getArithmeticInstrCost to check for this.
2024-09-25 18:50:16 +08:00
Luke Lau
63b534be17
[RISCV] Fold vmv.x.s into load from stack (#109774)
If a vector is reloaded from the stack to be used in vmv.x.s, we can
tell foldMemoryOperandImpl to fold it into a scalar load.

If XLEN < SEW then this currently just bails. I couldn't think of a way
to express a vmv.x.s that truncates in LLVM IR.
2024-09-25 18:49:52 +08:00
Mehdi Amini
8ea0dbab2e [mlir] Remove spurious CMake dependencies for convert-vector-to-llvm (NFC)
These don't seem used by this pass.
2024-09-25 03:48:46 -07:00
Pierre van Houtryve
de70b959b1
[AMDGPU] Fix typo in promoteUniformOpToI32 (#109942) 2024-09-25 12:42:57 +02:00
Chengjun
e4688b98cd
[SimplifyCFG] Avoid increasing too many phi entries when removing empty blocks (#104887)
Now in the simplifycfg and jumpthreading passes, we will remove the
empty blocks (blocks only have phis and an unconditional branch).
However, in some cases, this will increase size of the IR and slow down
the compile of other passes dramatically. For example, we have the
following CFG:

1. BB1 has 100 predecessors, and unconditionally branches to BB2 (does
not have any other instructions).
2. BB2 has 100 phis.

Then in this case, if we remove BB1, for every phi in BB2, we need to
increase 99 entries (replace the incoming edge from BB1 with 100 edges
from its predecessors). Then in total, we will increase 9900 phi
entries, which can slow down the compile time for many other passes.

Therefore, in this change, we add a check to see whether removing the
empty blocks will increase lots of phi entries. Now, the threshold is
1000 (can be controlled by the command line option
`max-phi-entries-increase-after-removing-empty-block`), which means that
we will not remove an empty block if it will increase the total number
of phi entries by 1000. This threshold is conservative and for most of
the cases, we will not have such a large phi. So, this will only be
triggered in some unusual IRs.
2024-09-25 12:41:13 +02:00
Victor Campos
ce6c236c96
[ADT][NFC] Simplify SmallSet (#109412)
- Remove dependence on `STLExtras.h`.
- Remove unused header inclusions.
- Make `count` use `contains` for deduplication.
- Replace hand-written linear scans on Vector by `std::find`.
2024-09-25 11:23:58 +01:00
Paul Walker
0c31ea5a09
[Clang][SME2] Use tuple result of SME builtins directly. (#109423)
I missed a codepath during PR108008 so SME2/SVE2p1 builtins are
converting their struct return type into a large vector, which is
causing unnecessary casting via memory.
2024-09-25 11:19:05 +01:00
Jonas Paulsson
0ef24aa549
Fix for logic in combineExtract() (#108208)
A (csmith) test case appeared where combineExtract() crashed when the
input vector was a bitcast into a vector of i1:s. Fix this by adding a check
with canTreatAsByteVector() before the call.
2024-09-25 12:12:27 +02:00
Matt Arsenault
c71b212285 ProfDataUtils: Avoid dyn_extract + assert (NFC) 2024-09-25 13:55:16 +04:00
David Spickett
5a038230b0
[llvm][cmake] Error when a runtime is in LLVM_ENABLE_PROJECTS and LLVM_ENABLE_RUNTIMES (#109791)
The documentation tells you not to do this:
https://llvm.org/docs/CMake.html#llvm-related-variables

But until now we did not enforce it.

```
$ cmake ../llvm-project/llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="pstl" -DLLVM_ENABLE_RUNTIMES="libcxx;pstl"
```
```
CMake Error at CMakeLists.txt:166 (message):
  Runtime project "pstl" found in LLVM_ENABLE_PROJECTS and
  LLVM_ENABLE_RUNTIMES.  It must only appear in one of them and that one
  should almost always be LLVM_ENABLE_RUNTIMES.
```
2024-09-25 10:34:21 +01:00
David Spickett
5ee2deac0c
[lldb][AArch64][Linux] Add Floating Point Mode Register (#106695)
Otherwise known as FEAT_FPMR. This register controls the behaviour of
floating point operations.

https://developer.arm.com/documentation/ddi0601/2024-06/AArch64-Registers/FPMR--Floating-point-Mode-Register

As the current floating point register contexts are fixed size, this has
been placed in a new set. Linux kernel patches have landed already, so
you can cross check with those.

To simplify testing we're not going to do any floating point operations,
just read and write from the program and debugger to make sure each sees
the other's values correctly.
2024-09-25 10:27:57 +01:00
Caroline Concatto
02f46d7fb8 Revert "[Clang][LLVM][AArch64] Add intrinsic for LUTI4 SME2 instruction (#97755)"
Going to revert to Fix test in clang as it is failing

This reverts commit 445d8b2d10b2bb9a5f50e3fe0671045acd309a04.
2024-09-25 09:25:28 +00:00
David Spickett
b7ea2643ce [llvm][docs] Fix RISCVUsage docs build error
After changes in #109651.

Warning, treated as error:
/home/davspi01/work/open_source/llvm-project/llvm/docs/RISCVUsage.rst::Anonymous hyperlink mismatch: 1 references but 0 targets.

In typical RST fashion, all that was missing was a space between
the last word and the opening `<` of the link.
2024-09-25 10:21:45 +01:00
David Spickett
4d459136f5
[llvm][docs] Update the project and runtimes lists (#109788)
And add a note to explain which variable to prefer if the project can go
in both.

---------

Co-authored-by: Nikita Popov <github@npopov.com>
2024-09-25 10:16:58 +01:00
dlav-sc
c93e29439b
[lldb] fix vFile:open, vFile:unlink error codes (#106950)
This patch makes gdb-server sends only GDB RSP supported error codes
during vFile:open and vFile:unlink handling.
2024-09-25 10:13:40 +01:00
David Spickett
706821ba8f [lldb][test] Skip TestConcurrentVFork on all Linux
And given that it is only for Linux - effectively skip it,
but in a way where we don't forget that it's Linux only.

See https://github.com/llvm/llvm-project/issues/85084.

This test times out on occasion on Arm, AArch64 and X86 Linux,
which I saw just today in a buildkite build. Causing a failure that
is 1. confusing because the PR wasn't for LLDB and 2. annoying
to find in the giant log file (which isn't the test's fault,
but it adds to the overhead).

It's probably important to have this test running somewhere but
right now it's causing too much noise to do so.
2024-09-25 10:08:10 +01:00
Vyacheslav Levytskyy
bbb3679ad8
[SPIRV] Fix compilation error 'use of parameter from containing function' when building PR #106429 with gcc (#109924)
It appears that PR https://github.com/llvm/llvm-project/pull/106429
introduced an issue for builds with SPIRV Backend target when building
with gcc, e.g.:
```
/llvm-project/llvm/lib/Target/SPIRV/SPIRVUtils.cpp:263:36: error: use of parameter from containing function
  263 |     llvm::SyncScope::ID SubGroup = Ctx.getOrInsertSyncScopeID("subgroup");
      |                                    ^~~
/llvm-project/llvm/lib/Target/SPIRV/SPIRVUtils.cpp:256:46: note: ‘llvm::LLVMContext& Ctx’ declared here
  256 | SPIRV::Scope::Scope getMemScope(LLVMContext &Ctx, SyncScope::ID Id) {
```
This PR fixes this by removing struct and using static const variables
instead.
2024-09-25 11:06:17 +02:00
David Green
f1bbabd628
[ARM] Lower arm_neon_vbsl to ARMISD::VBSP and fold (vbsl x, y, y) to y (#109761)
This helps clean up the patterns a little and will help share combines
on both the intrinsic and VBSP. A combine is then added to fold away the
VBSP if both the selected operands are the same.
2024-09-25 10:03:39 +01:00
Alex Bradbury
5a191e3cd9 [RISCV][test] Correct +experimental-ztso attr to +ztso in test
This doesn't chane the test output, but means it's now testing what it's
supposed to.
2024-09-25 09:55:58 +01:00
CarolineConcatto
445d8b2d10
[Clang][LLVM][AArch64] Add intrinsic for LUTI4 SME2 instruction (#97755)
This patch adds these intrinsics:

// Variants are also available for: _s8
svuint8x4_t svluti4_zt_u8_x4(uint64_t zt0, svuint8x2_t zn)
__arm_streaming __arm_in("zt0");

according to PR#324[1]
[1]ARM-software/acle#324
2024-09-25 09:53:23 +01:00
Benjamin Maxwell
53907ed508
[clang][codegen] Don't mark "int" TBAA on FP libcalls with indirect args (#108853)
On some targets, an FP libcall with argument types such as long double
will be lowered to pass arguments indirectly via pointers. When this is
the case we should not mark the libcall with "int" TBAA as it may lead
to incorrect optimizations.

Currently, this can be seen for long doubles on x86_64-w64-mingw32. The
`load x86_fp80` after the call is (incorrectly) marked with "int" TBAA
(overwriting the previous metadata for "long double").

Nothing seems to break due to this currently as the metadata is being
incorrectly placed on the load and not the call. But if the metadata
is moved to the call (which this patch ensures), LLVM will optimize out
the setup for the arguments.
2024-09-25 09:50:55 +01:00
Dominik Montada
d853adee00
[MIR] Fix return value when computed properties conflict with given prop (#109923)
This fixes a test failure when expensive checks are enabled. Use the
correct return value when computing machine function properties resulted
in an error (e.g. when conflicting with explicitly set values).

Without this, the machine verifier would crash even in the presence of
parsing errors which should have gently terminated execution.
2024-09-25 10:47:14 +02:00
Dmitry Chernenkov
850ee790cf [Bazel] Port fa824dc0dd960214865b03d8f56b18bb93e4a88b 2024-09-25 08:32:55 +00:00
Kazu Hirata
a36aca5e18
[sancov] Avoid repeated map lookups (NFC) (#109906) 2024-09-25 01:32:31 -07:00
Kazu Hirata
c3fc763dc1
[MCA] Avoid repeated hash lookups (NFC) (#109905) 2024-09-25 01:31:33 -07:00
Kazu Hirata
ec60030639
[DWARFLinker] Avoid repeated hash lookups (NFC) (#109904) 2024-09-25 01:30:40 -07:00
Kazu Hirata
ba3d174d3f
[FuzzMutate] Avoid repeated hash lookups (NFC) (#109903) 2024-09-25 01:30:03 -07:00
Miguel A. Arroyo
99cd4cb123
[LLD][MINGW] Add --undefined-glob flag support (#109866) 2024-09-25 11:29:40 +03:00
Yingwei Zheng
c58e51ac97
[ConstantFPRange] Suppress unused result warnings. NFC. (#109921)
Fixes warnings `error: ignoring return value of function declared with
'nodiscard' attribute [-Werror,-Wunused-result]`.
2024-09-25 16:21:38 +08:00
Nikita Popov
b8d1bae648
[CmpInstAnalysis] Return decomposed bit test as struct (NFC) (#109819)
decomposeBitTestICmp() currently returns the result via two out
parameters plus an in-place modification of Pred. This changes it to
return an optional struct instead.

The motivation here is twofold. First, I'd like to extend this code to
handle cases where the comparison is against a value other than zero,
which would mean yet another out parameter. Second, while doing that I
was badly bitten by the in-place modification, so I'd like to get rid of
it.
2024-09-25 10:14:15 +02:00
David Sherwood
cda0cb3939
[NFC][LoopVectorize] Remove unused argument from fixupIVUsers (#109789)
The VectorHeader argument passed to fixupIVUsers is unused
and can be removed.
2024-09-25 08:56:37 +01:00
Stanislav Mekhanoshin
4f90e75bdc
[AMDGPU] Do not count implicit VGPRs in SIInsertWaitcnts (#109049)
When generating waitcounts before a use or def skip VGPRs. We never have
a real implicit VGPR operands on memory instructions, it is only for
super-reg liveness accounting.

Some other instructions (MOVRELS as an example) may have real implicit
VGPR uses though.

This is less then ideal but most of the problems observed with spills.
2024-09-25 00:41:49 -07:00
WANG Rui
8e3cde04cb [LoongArch][test] Add float-point atomic load/store tests. NFC 2024-09-25 15:39:22 +08:00