554634 Commits

Author SHA1 Message Date
Michael Buch
faf070f062 [lldb][test] TestExprDefinitionInDylib.py adjust test to account for older compiler versions
Skip tests that require `-gstructor-decl-linkage-names` on Clang versions that don't support it.

 Don't pass `-gno-structor-decl-linkage-names` on Clang versions where it the flag didn't exist but it was the default behaviour of the compiler anyway.

Drive-by:
- We used to run `self.expect("Bar()")` which would always fail. So the `error=True` would be true even if we didn't pass the `-gno-structor-linkage-names`. So it wasn't testing the behaviour properly. This patch changes these to `self.expect("expr Bar()")`.
2025-10-02 14:08:40 +01:00
Matt Arsenault
e7839eed6b
AMDGPU: Switch test to generated checks (#161658) 2025-10-02 13:05:50 +00:00
Rahul Joshi
c2159f2d3a
[LLVM-Test] Fix a regression in test dependencies introduced by 0e14973 (#161623)
Add `UnitTests` as an explicit dependency for `check-llvm` and
`llvm-test-depends`. In
https://github.com/llvm/llvm-project/pull/161442, the intent was to
remove `UnitTests` as a dependency for the individual per-directory
`check-llvm-*` test suites created but not to drop it from `check-llvm`
or `llvm-test-depends`. This missing dependency will cause LLVM unit
tests to be not rebuilt and resulting in either `warning: test suite
'LLVM-Unit' contained no tests` or running stale running versions of the
unit tests when running `check-llvm`.
2025-10-02 06:05:16 -07:00
Lang Hames
0cb9d402f3 [orc-rt] Fix typo in comment. NFC. 2025-10-02 22:52:33 +10:00
Michael Buch
82b3057a5e [lldb][test] TestAbiTagStructors.py adjust test to account for older compiler versions
Skip tests that require `-gstructor-decl-linkage-names` on Clang
versions that don't support it.

Don't pass `-gno-structor-decl-linkage-names` on Clang versions where it
the flag didn't exist but it was the default behaviour of the compiler
anyway.
2025-10-02 13:48:46 +01:00
Lang Hames
99ce206246
[orc-rt] Add support for constructing Expected<Error> values. (#161656)
These will be used in upcoming RPC support patches where the outer
Expected value captures any RPC-infrastructure errors, and the inner
Error is returned from the romet call (i.e. the remote handler's return
type is Error).
2025-10-02 22:36:02 +10:00
Corentin Jabot
9583b399d8
[Clang] Normalize constraints before checking for satisfaction (#141776)
In the standard, constraint satisfaction checking is done on the
normalized form of a constraint.

Clang instead substitutes on the non-normalized form, which causes us to
report substitution failures in template arguments or concept ids, which
is non-conforming but unavoidable without a parameter mapping

This patch normalizes before satisfaction checking. However, we preserve
concept-id nodes in the normalized form, solely for diagnostics
purposes.

This addresses #61811 and related concepts conformance bugs, ideally to
make the remaining implementation of concept template parameters easier

Fixes #135190
Fixes  #61811

Co-authored-by: Younan Zhang <zyn7109@gmail.com>
2025-10-02 14:35:38 +02:00
Nikita Popov
db39ef9d56 [GVN] Add additional tests for inverted condition propagation (NFC) 2025-10-02 14:35:14 +02:00
Michael Buch
7e6d277d3b [lldb][test] TestStructuredBinding.py: adjust assertion to check for compatible compiler version
Requires a compiler with the changes in https://github.com/llvm/llvm-project/pull/122265
2025-10-02 13:33:21 +01:00
Michael Buch
86ba1986a2 [lldb][test] Un-XFAIL TestDataFormatterStdUnorderedMap.py for older Clang versions
Fixed in https://github.com/llvm/llvm-project/pull/156033
2025-10-02 13:30:43 +01:00
Matt Arsenault
3537e8abfa
RegAllocGreedy: Check if copied lanes are live in trySplitAroundHintReg (#160424)
For subregister copies, do a subregister live check instead of checking
the main range. Doesn't do much yet, the split analysis still does not
track live ranges.
2025-10-02 12:21:02 +00:00
Marco Borgeaud
8dd2846fcf
[analyzer] Harden RegionStoreManager::bindArray (#153177)
Fixes https://github.com/llvm/llvm-project/issues/147686 by handling
symbolic values similarly to bindStruct and handling constant values.
The latter is actually more of a workaround: bindArray should not have
to deal with such constants.

CPP-6688
2025-10-02 14:13:09 +02:00
David Green
dbf44c2823 [AArch64] Remove unused tablegen classes and code cleanup. NFC 2025-10-02 12:40:15 +01:00
Corentin Jabot
39d0e41a5f
[NFC][Clang Improve performance of DoMarkVarDeclReferenced (#161648)
Address post commit feedback from #161231
2025-10-02 13:27:57 +02:00
Paul Walker
8cf43aebc6
[LLVM][CodeGen][SVE] Remove failure cases when widening vector load/store ops. (#160515)
When unable to widen a vector load/store we can replace the operation
with a masked variant. Support for extending loads largely came for free
hence its inclusion, but truncating stores require more work.

Fixes https://github.com/llvm/llvm-project/issues/159995
2025-10-02 12:24:23 +01:00
Henrich Lauko
f3f9e7b928
[CIR] Make all opt tests verify roundtrip (#161439)
This mirrors incubator changes from https://github.com/llvm/clangir/pull/1923
2025-10-02 13:02:16 +02:00
Lucie Choi
2eb6337591
[SPIR-V] Prevent adding duplicate binding instructions for implicit binding (#161299)
Prevent adding duplicate instructions for implicit bindings when they
are from the same resource. The fix is to store and check if the binding
number is already assigned for each `OrderId`.


Resolves https://github.com/llvm/llvm-project/issues/160716
2025-10-02 11:00:56 +00:00
Michael Buch
6382bb5dda [lldb][test] XFAIL TestGlobalSymbolObjCConflict.c on Windows
Failing with:
```
error: command failed with exit status: 1
executed command: 'c:\buildbot\as-builder-10\lldb-x86-64\build\bin\filecheck.exe' 'C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\Shell\Expr\TestGlobalSymbolObjCConflict.c'
.---command stderr------------
| C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\Shell\Expr\TestGlobalSymbolObjCConflict.c:30:11: error: CHECK: expected string not found in input
| // CHECK: (lldb) p OglobalVar
|           ^
| <stdin>:1:1: note: scanning from here
| (lldb) command source -s 0 'C:/buildbot/as-builder-10/lldb-x86-64/build/tools/lldb\test\Shell\lit-lldb-init-quiet'
| ^
| <stdin>:4:1: note: possible intended match here
| (lldb) target create "C:\\buildbot\\as-builder-10\\lldb-x86-64\\build\\tools\\lldb\\test\\Shell\\Expr\\Output\\TestGlobalSymbolObjCConflict.c.tmp.out"
| ^
|
| Input file: <stdin>
| Check file: C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\Shell\Expr\TestGlobalSymbolObjCConflict.c
|
| -dump-input=help explains the following input dump.
|
| Input was:
| <<<<<<
|             1: (lldb) command source -s 0 'C:/buildbot/as-builder-10/lldb-x86-64/build/tools/lldb\test\Shell\lit-lldb-init-quiet'
| check:30'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
|             2: Executing commands in 'C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\test\Shell\lit-lldb-init-quiet'.
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|             3: (lldb) command source -C --silent-run true lit-lldb-init
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|             4: (lldb) target create "C:\\buildbot\\as-builder-10\\lldb-x86-64\\build\\tools\\lldb\\test\\Shell\\Expr\\Output\\TestGlobalSymbolObjCConflict.c.tmp.out"
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| check:30'1     ?                                                                                                                                                       possible intended match
|             5: Current executable set to 'C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\test\Shell\Expr\Output\TestGlobalSymbolObjCConflict.c.tmp.out' (x86_64).
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|             6: (lldb) b 27
| check:30'0     ~~~~~~~~~~~~
| >>>>>>
`-----------------------------
error: command failed with exit status: 1
```

We probably need to use LLD here or something. But I don't have a Windows machine to test this on. So XFAILing for now.
2025-10-02 11:59:26 +01:00
Florian Hahn
7c4f188f27
[LV] Support multiplies by constants when forming scaled reductions. (#161092)
We can create partial reductions for multiplies with constants, if the
constant is small enough to be extended from source to destination type
w/o changing the value.

This only handles constant on the right side of a multiply, relying on
other passes to canonicalize the input.

Alive2 Proofs: https://alive2.llvm.org/ce/z/iWRMr6

PR: https://github.com/llvm/llvm-project/pull/161092
2025-10-02 10:53:17 +00:00
Lang Hames
2165aa4c9d [orc-rt] Tidy up some type_traits uses. NFC. 2025-10-02 20:35:53 +10:00
Corentin Jabot
2daa2f1538
[Clang] Fix a crash when using ctad with a template template parameter. (#161488)
This fixes the crash reported in #130604.
It does not try to improve diagnostics or resolve CWG3003 (this will be
explored separately).

Fixes #130604
2025-10-02 10:33:39 +00:00
Mehdi Amini
0db784ed3c [MLIR] Apply clang-tidy fixes for llvm-else-after-return in TransformOps.cpp (NFC) 2025-10-02 03:32:41 -07:00
Marco Elver
7ccb5c08f0
Thread Safety Analysis: Optimize LocalVariableMap's canonical reference computation (#161600)
We observed slowdowns in auto-generated million+ line C++ source files
due to recent fixes to LocalVariableMap.
Rather than recompute the canonical underlying non-reference
VarDefinition every time we need to perform variable definition
intersection at CFG merge points, pre-compute the canonical references
once on construction. Ensure to
maintain the invariant that if both the direct and canonical reference
are being invalidated, both become 0.

Reported-by: Bogdan Graur <bgraur@google.com>
2025-10-02 12:05:43 +02:00
Ruoyu Qiu
3c391877c1
[ELF]Add overflow check to ELF note iterator (#160451)
Add overflow check to ELF note iterator to handle large `p_filesz` or
`sh_size`, avoid accessing invalid memory.

---------

Signed-off-by: Ruoyu Qiu <cabbaken@outlook.com>
2025-10-02 11:02:55 +01:00
Orlando Cazalet-Hyams
2cb530868c
[DebugInfo][InstrRef] Copy instr-ref to replacement instrs in X86FixupSetCCPass (#159777)
...to preserve variable location coverage.

Fixes missing variable location coverage in #49818 reproducer
2025-10-02 10:45:27 +01:00
Ryan Cowan
eb803df502
[AArch64][GlobalISel] Add G_FMODF instruction (#160061)
This commit adds the intrinsic `G_FMODF` to GMIR & enables its
translation, legalization and instruction selection in AArch64.
2025-10-02 10:30:31 +01:00
LLVM GN Syncbot
04c01ff144 [gn build] Port 55803b8af1e4 2025-10-02 09:20:19 +00:00
Nikolas Klauser
55803b8af1
Reapply "[libc++] Avoid constructing additional objects when using map::at" (#160738) (#161485)
This reverts commit b86aaacf28b358b187071bc87075f1faa2d65c4e.

The issue in LLVM has been fixed now.
2025-10-02 11:15:33 +02:00
Kerry McLaughlin
20e0e80a54
[AArch64] Combine PTEST_FIRST(PTRUE, CONCAT(A, B)) -> PTEST_FIRST(PTRUE, A) (#161384)
When the input to ptest_first is a vector concat and the mask is all active,
performPTestFirstCombine returns a ptest_first using the first operand
of the concat, looking through any reinterpret casts.

This allows optimizePTestInstr to later remove the ptest when the first
operand is a flag setting instruction such as whilelo.
2025-10-02 10:13:06 +01:00
Michael Klemm
8aa64edb34
[Flang] Add -ffast-real-mod and direct code for MOD on REAL types (#160660)
This patch adds direct code-gen support for a faster MOD intrinsic for
REAL types. Flang has maintained and keeps maintaining a high-precision
implementation of the MOD intrinsic as part of the Fortran runtime. With
the -ffast-real-mod flag, users can opt to avoid calling into the
Fortran runtime, but instead trigger code-gen that produces faster code
by avoiding the runtime call, at the expense of potentially risking bit
cancelation by having the compiler use the MOD formula a specified by
ISO Fortran.
2025-10-02 10:50:05 +02:00
Benjamin Maxwell
031fb7414f
[AArch64][SME] Preserve Chain when selecting multi-vector LUT4Is (#161494)
Previously, the `Chain` was dropped meaning LUTI4 nodes that only
differed in the chain operand would be incorrectly CSE'd.

Fixes: #161420
2025-10-02 09:27:48 +01:00
Ramkumar Ramachandra
6e52e538cd
[LAA] Test different-type-sizes in safe-dep-dist (#161244)
The isSafeDependenceDistance routine is guarded by a HasSameSize check
which can be removed, as the test demonstrates.
2025-10-02 09:17:36 +01:00
Fabian Ritter
bf847a8b9d
[AMDGPU][SDAG] Enable ISD::PTRADD for 64-bit AS by default (#146076)
Also removes the command line option to control this feature.

There seem to be mainly two kinds of test changes:
- Some operands of addition instructions are swapped; that is to be expected
  since PTRADD is not commutative.
- Improvements in code generation, probably because the legacy lowering enabled
  some transformations that were sometimes harmful.

For SWDEV-516125.
2025-10-02 10:06:25 +02:00
Nikolas Klauser
66558d70dc
[libc++] Fix <__algorithm/find.h> when using -flax-vector-conversions=none (#161362) 2025-10-02 10:05:26 +02:00
Alejandro Álvarez Ayllón
5f5a84e850
[clang][analyzer] Clear ObjCMethodCall's cache between runs (#161327)
`lookupRuntimeDefinition` assumed that a process would handle only one
TU. This is not true for unit tests, for instance. Multiple snippets of
code get parsed, and their AST are unloaded each time.

Since the cache relies on pointers as keys, if the same address happens
to be reused between runs, the cache would return a stale pointer,
potentially causing a segmentation fault. This is not that unlikely if
the snippets are similar, which would trigger similar allocation
patterns.

CPP-4889
2025-10-02 09:59:00 +02:00
Nikolas Klauser
0b0dcf856a
[libc++] Upgrade Xcode to 26.0 (#160097) 2025-10-02 09:32:30 +02:00
jeanPerier
662f56f428
[flang] handle scalars in getDescriptorWithNewBaseAddress (#161515)
Follow up on #161347 to allow scalar fir.box/class reconstruction (at
least required for polymorphic types).
The assert in genDimInfoFromBox was rejecting scalars while there is no
functional reason for that (only assumed-rank are an issue there).
2025-10-02 09:27:27 +02:00
Simon Pilgrim
e5b8c24cc0
[DAG] Add ComputeNumSignBits(FREEZE(X)) handling (#161507)
If X is known never under/poison then skip the freeze and return ComputeNumSignBits(X)
2025-10-02 07:27:17 +00:00
Nikita Popov
a4767e63ee
[MemorySanitizer] Use getelementptr instead of ptrtoint+add+inttoptr (#161392)
MemorySanitizer currently does a lot of pointer arithmetic using
ptrtoint+add+inttoptr instead of using getelementptr. As far as I can
tell, there is no need to use this pattern -- msan is not trying to
synthesize pointers with different provenance here. The pointers in
question stay within one object (like the TLS parameter area).

I suspect that this is just a leftover from pre-opaque-pointer types
where this was a natural way to perform offset arithmetic. Nowadays we
should just emit a getelementptr i8, aka ptradd.
2025-10-02 09:16:08 +02:00
Stanislav Mekhanoshin
912a92a809
[AMDGPU] Update VOP3 gfx1250 tests to t16 syntax. NFC (#161611) 2025-10-01 23:15:11 -07:00
Stanislav Mekhanoshin
bd0f9db06a
[AMDGPU] Update gfx1250 vop3_from_vop1 tests to t16 syntax. NFC (#161609) 2025-10-01 23:14:52 -07:00
Stanislav Mekhanoshin
eedfbbe986
[AMDGPU] Update gfx1250 VOP1 tests to t16 syntax. NFC (#161603) 2025-10-01 23:14:26 -07:00
Kazu Hirata
17f6888d17 [IR] clang-format ValueMap.h
I'm planning to modify this file.
2025-10-01 22:38:20 -07:00
Yixuan Cao
bcc85f7670
[compiler-rt][asan][tests] Stabilize wchar tests on Darwin/Android (#161624)
### Summary
Stabilize ASan wchar tests across Darwin and Android. NFC: test-only.
Follow-up to PR #160493 (adds wchar interceptors/tests).

### Motivation
- Darwin: The top frame often resolves to `libclang_rt.asan_*` rather
than a source file, so strict checks that include file/line can fail.
See Chromium issue
[448631142](https://g-issues.chromium.org/issues/448631142).
- Android: The “ERROR:” header can go to logcat instead of stderr, so
FileCheck may not see it; stdout/stderr reordering also makes pre-crash
markers racy. See Android Buildbot
[186/12821](https://lab.llvm.org/buildbot/#/builders/186/builds/12821).

### Changes
- Android:
- Force reports to stderr via `%env_asan_opts=log_to_stderr=1`, avoiding
the “ERROR:” header going to logcat.
- Print the pre-crash “Good so far.” to stderr and `fflush(stderr)` to
avoid stdout/stderr reordering.
- Darwin:
- Relax the stack-frame check to only require the function name
(`wcscpy/wcsncpy/wcscat/wcsncat`) to tolerate `libclang_rt.asan_*`
frames.
- Common:
  - Reuse FileCheck var `[[ADDR]]` instead of redefining.
- Make wide string literals `const wchar_t*` to silence
`-Wwritable-strings`.

### Risk
- NFC: test-only; no change to runtime behavior.

### References
- Follow-up to PR #160493.
- Chromium: [448631142](https://g-issues.chromium.org/issues/448631142)
(Darwin failures).
- Android Buildbot:
[186/12821](https://lab.llvm.org/buildbot/#/builders/186/builds/12821).

Signed-off-by: Yixuan Cao <caoyixuan2019@email.szu.edu.cn>
2025-10-01 22:30:09 -07:00
Maksim Panchenko
d39095b193
[BOLT] Remove unused parameter. NFC (#161617)
`Skip` parameter not used/set inside `analyzeRelocation()`.
2025-10-01 22:21:12 -07:00
Matt Arsenault
9323fbbc4e
RegisterCoalescer: Avoid return after else (#161622) 2025-10-02 05:20:57 +00:00
Maksim Levental
fea2cca4d6
[MLIR][Python] expose Operation::setLoc (#161594) 2025-10-01 21:57:10 -07:00
Hongyu Chen
a88c83950b
[LLVM] Volunteer myself and Usman Nadeem as DFAJumpThreading maintainers (#161491)
Both Usman Nadeem and I have constantly contributed to the
DFAJumpThreading pass so far. To push DFAJumpThreading forwards and make
it enabled by default, I volunteer myself and Usman Nadeem as
DFAJumpThreading maintainers.
2025-10-02 12:53:38 +08:00
Matt Arsenault
c6e280e7ed
PeepholeOpt: Fix losing subregister indexes on full copies (#161310)
Previously if we had a subregister extract reading from a
full copy, the no-subregister incoming copy would overwrite
the DefSubReg index of the folding context.

There's one ugly rvv regression, but it's a downstream
issue of this; an unnecessary same class reg-to-reg full copy
was avoided.
2025-10-02 13:36:47 +09:00
Kazu Hirata
ac0e99e191 [Analysis] Fix a warning
This patch fixes:

  llvm/lib/Analysis/IR2Vec.cpp:289:14: error: unused variable
  'allSameDim' [-Werror,-Wunused-variable]
2025-10-01 20:06:15 -07:00