548842 Commits

Author SHA1 Message Date
Matt Arsenault
a4c65ba7ed Use try_compile tests to get sizeof(uintptr_t) 2025-08-17 10:05:33 +09:00
Matt Arsenault
49f4496de2 Add LLVM_NATIVE_ARCH_SIZEOF_UINTPTR_T 2025-08-17 10:05:33 +09:00
Matt Arsenault
985a510a8c Use Bitset 2025-08-17 10:05:33 +09:00
Matt Arsenault
d51a2488b5 RuntimeLibcalls: Add bitset for available libcalls
This is a step towards separating the set of available libcalls
from the lowering decision of which call to use. Libcall recognition
now directly checks availability instead of indirectly checking through
the lowering table.
2025-08-17 10:05:32 +09:00
knickish
bc3754de0a
[M68k] Add anyext patterns for PCD addressing mode (#150356)
Does what it says on the tin: anyext loads with the PCD addressing mode
were failing addr mode selection, adding the patterns resolved it.
2025-08-16 23:33:47 +00:00
Aiden Grossman
29d49c8a37
[libc] Correct standard for getcpu (#153982) 2025-08-16 16:05:45 -07:00
Aiden Grossman
1f5047e430
[Github] Remove call to llvm-project-tests.yml from spirv-tests.yml
This will eventually allow for removing llvm-project-tests.yml. This
should significantly reduce the complexity of these workflows at the
cost of a little bit of duplication standard to github actions.

Reviewers: michalpaszkowski, sudonatalie

Reviewed By: sudonatalie

Pull Request: https://github.com/llvm/llvm-project/pull/153869
2025-08-16 15:52:39 -07:00
Fangrui Song
2cedb286b8 MCSymbol: Remove unused IsTarget parameter from declareCommon 2025-08-16 15:47:39 -07:00
Fangrui Song
aa96e20dce MCSymbol: Remove AMDGPU-specific Kind::TargetCommon
The SymContentsTargetCommon kind introduced by
https://reviews.llvm.org/D61493 lackes significant and should be treated
as a regular common symbol with a different section index.

Update ELFObjectWriter to respect the specified section index.
The new representation also works with Hexagon's SHN_HEXAGON_SCOMMON.
2025-08-16 15:39:33 -07:00
Fangrui Song
190778a8ba MCSymbol: Rename SymContents to kind
The names "SymbolContents" and "SymContents*" members are confusing.
Rename to kind and Kind::XXX similar to lld/ELF/Symbols.h

Rename SymContentsVariable to Kind::Equated as the former term is
"equated symbol", not "variable".
2025-08-16 15:10:35 -07:00
Sergei Barannikov
7bb73455f7
[TableGen][DecoderEmitter] Add helpers for working with scopes (NFC) (#153979)
Part of an effort to simplify DecoderEmitter code.
2025-08-16 21:49:17 +00:00
Shafik Yaghmour
f8740920ee
[Clang][Sema] Check the return value of DiagnoseClassNameShadow in ActOnEnumConstant (#143754)
Static analysis flagged that we were not checking the return value of
DiagnoseClassNameShadow when we did so everywhere else. Modifying this
case to match how other places uses it makes sense and does not change
behavior. Likely if this check fails later actions will fail as well but
it is more correct to exit early.
2025-08-16 14:08:39 -07:00
Aiden Grossman
ddae3b74a3 [CI] Show Stats in CI Log
This patch makes utils.sh also print the stats out. This is particularly
useful in postcommit CI where we are currently not saving artifacts.
2025-08-16 20:55:45 +00:00
Florian Hahn
73775a0f27
[LV] Add test for #153946.
Add test for miscompile from
https://github.com/llvm/llvm-project/issues/153946, caused by poison
propagation.
2025-08-16 21:19:20 +01:00
Kazu Hirata
1c8da29f48
[ADT] Use small_buckets() in SmallPtrSetImpl::remove_if (NFC) (#153962) 2025-08-16 13:15:36 -07:00
Leandro Lacerda
75bf739208
[libc][gpu] Disable loop unrolling in the throughput benchmark loop (#153971)
This patch makes GPU throughput benchmark results more comparable across
targets by disabling loop unrolling in the benchmark loop.

Motivation:
* PTX (post-LTO) evidence on NVPTX: for libc `sin`, the generated PTX
shows the `throughput` loop unrolled 8x at `N=128` (one iteration
advances the input pointer by 64 bytes = 8 doubles), interleaving eight
independent chains before the back-edge. This hides latency and
significantly reduces cycles/call as the batch size `N` grows.
* Observed scaling (NVPTX measurements): with unrolling enabled, `sin`
dropped from ~3,100 cycles/call at `N=1` to ~360 at `N=128`. After
enforcing `#pragma clang loop unroll(disable)`, results stabilized
(e.g., from ~3100 cycles/call at `N=1` to ~2700 at `N=128`).
* libdevice contrast: the libdevice `sin` path did not exhibit a similar
drop in our measurements, and the PTX appears as compact internal calls
rather than a long FMA chain, leaving less ILP for the outer loop to
extract.

What this change does:
* Applies `#pragma clang loop unroll(disable)` to the GPU `throughput()`
loop in both NVPTX and AMDGPU backends.

Leaving unrolling entirely to the optimizer makes apples-to-apples
comparisons uneven (e.g., libc vs. vendor). Disabling unrolling yields
fairer, more consistent numbers.
2025-08-16 20:14:26 +00:00
Sergei Barannikov
3acb679bda [TableGen] Remove redundant variable (NFC) 2025-08-16 23:11:53 +03:00
Florian Hahn
351d398a37
[VPlan] Run final VPlan simplifications before codegen.
Dissolving the hierarchical VPlan CFG and converting abstract to
concrete recipes can expose additional simplification opportunities.

Do a final run of simplifyRecipes before executing the VPlan.
2025-08-16 18:54:27 +01:00
Fangrui Song
1893caa9bc MCSymbol: Decrease the bitfield size of SymbolContents
Follow-up to 57b0843f68f5f349c73d1bf54e321a1a6d1800bf

The size of MCSymbol has been reduced to 24 bytes on 64-bit systems.
2025-08-16 10:43:05 -07:00
Sergei Barannikov
aa2fe4eb3d
[PowerPC] Remove some unused SDNodes and FastISel workaround (NFC) (#153964)
These nodes have never been used since introduction in 2013/2015.
2025-08-16 17:01:03 +00:00
Matthias Springer
0d8aa9d9ec
[mlir][SparseTensor] Simplify pipeline (#152908)
This refactoring improves compilation time.
2025-08-16 18:45:26 +02:00
Timm Baeder
373206d5e0
[clang][bytecode] Prefer ParmVarDecls as function parameters (#153952)
We might create a local temporary variable for a ParmVarDecl, in which
case a DeclRefExpr for that ParmVarDecl should _still_ result in us
choosing the parameter, not that local.
2025-08-16 17:22:14 +02:00
Matt Arsenault
0b1b567d9f RuntimeLibcalls: Temporarily disable benchmark depending on llvm-nm
Breaks some builds
2025-08-16 23:29:38 +09:00
Mircea Trofin
c971c25544
[licm] don't drop MD_prof when dropping other metadata (#152420)
Part of Issue #147390
2025-08-16 07:26:13 -07:00
Matt Arsenault
30007a5414
AMDGPU: Fix crash in rewrite AGPR copy MFMA pass on dead valnos (#153915)
Test isn't great, probably won't reliably reproduce the problem
in the future.
2025-08-16 23:09:23 +09:00
Kazu Hirata
fc6f235101
[llvm] Proofread LangRef.rst (#153932) 2025-08-16 06:47:33 -07:00
Kazu Hirata
84f4465135
[ExecutionEngine] Remove unnecessary casts (NFC) (#153931)
getLoadAddressWithOffset() and getLoadAddress() already return
uint64_t.
2025-08-16 06:47:25 -07:00
Kazu Hirata
0ede7ace0d
[ADT] Use llvm::copy in SmallPtrSet.cpp (NFC) (#153930)
This patch uses llvm::copy in combination with buckets() and
small_buckets().
2025-08-16 06:47:18 -07:00
Maksim Levental
6fc1deb8b7
[mlir][python] handle more undefined symbols not covered by nanobind (#153861)
Introduced (but omitted from this CMake) in
https://github.com/llvm/llvm-project/pull/151246.
2025-08-16 09:25:15 -04:00
Mingjie Xu
a293573c4e
[SSAUpdater] Only iterate blocks modified by CheckIfPHIMatches() in RecordMatchingPHIs() (#153596)
In https://github.com/llvm/llvm-project/pull/100281, we use
`TaggedBlocks` to record blocks modified by `CheckIfPHIMatche()`, so do
not need to clear every block in `BlockList` if `CheckIfPHIMatches()`
match failed.

If `CheckIfPHIMatches()` match succeed, we can reuse `TaggedBlocks` to
only record matching PHIs for modified blocks, avoid checking every
block in `BlockList` to see if `PHITag` is set.
2025-08-16 19:59:10 +08:00
Matthias Springer
2692ff8213
[mlir][LLVM] Fix build (#153947)
Fix build after #153937.
2025-08-16 13:06:58 +02:00
Matthias Springer
f8f23e838a
[mlir][LLVM] ControlFlowToLLVM: Add 1:N type conversion support (#153937)
Add support for 1:N type conversions to the `ControlFlowToLLVM` lowering
patterns. Not applicable to `cf.switch` and `cf.assert`.

---------

Co-authored-by: Tobias Gysi <tobias.gysi@nextsilicon.com>
2025-08-16 12:51:40 +02:00
Matthias Springer
f0967fca04
[mlir][LLVM] FuncToLLVM: Add 1:N type conversion support (#153823)
Add support for 1:N type conversions to the `FuncToLLVM` lowering
patterns. This commit does not change the lowering of any types (such as
`MemRefType`). It just sets up the infrastructure, such that 1:N type
conversions can be used during `FuncToLLVM`.

Note: When the converted result types of a `func.func` have more than 1
type, then the results are wrapped in an `llvm.struct`. That's because
`llvm.func` does not support multiple result values. This "wrapping" was
already implemented for cases where the original `func.func` has
multiple results. With 1:N conversions, even a single result can now
expand to multiple converted results, triggering the same wrapping
mechanism.

The test cases are exercised with both the old and the new no-rollback
conversion driver.
2025-08-16 09:45:08 +02:00
Matheus Izvekov
1d73b2c10d
[clang] don't create type source info for vardecl created for structured bindings (#153923)
These are implicit vardecls which its type was never written in source
code. Don't create a TypeLoc and give it a fake source location.

The fake as-written type also didn't match the actual type, which after
fixing this gives some unrelated test churn on a CFG dump, since
statement printing prefers type source info if thats available.

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

This is a regression introduced in
https://github.com/llvm/llvm-project/pull/147835

This regression was never released, so no release notes are added.
2025-08-16 02:04:31 -03:00
Kazu Hirata
627f8018fe
[ADT] Rename NumNonEmpty to NumEntries in SmallPtrSet (NFC) (#153757)
Without this patch, we use NumNonEmpty, which keeps track of the
number of valid entries plus tombstones even though we have a separate
variable to keep track of the number of tombstones.

This patch simplifies the metadata.  Specifically, it changes the name
and semantics of the variable to NumEntries to keep track of the
number of valid entries.

The difference in semantics requires some code changes aside from
mechanical replacements:

- size() just returns NumEntries.

- erase_imp() and remove_if() need to decrement NumEntries in the
  large mode.

- insert_imp_big() increments NumEntries for successful insertions,
  regardless of whether a tombstone is being replaced with a valid
  entry.  It also computes the number of non-tombstone empty slots as:

  CurArraySize - NumEntries - NumTombstones

- Grow() no longer needs NumNonEmpty -= NumTombstones.

Overall, the resulting code should look more intuitive and more
consistent with DenseMapSet.
2025-08-15 21:22:37 -07:00
Thurston Dang
638bd11c13
[msan] Handle SSE/AVX pshuf intrinsic by applying to shadow (#153895)
llvm.x86.sse.pshuf.w(<1 x i64>, i8) and llvm.x86.avx512.pshuf.b.512(<64
x i8>, <64 x i8>) are currently handled strictly, which is suboptimal.

llvm.x86.ssse3.pshuf.b(<1 x i64>, <1 x i64>)
llvm.x86.ssse3.pshuf.b.128(<16 x i8>, <16 x i8>) and
llvm.x86.avx2.pshuf.b(<32 x i8>, <32 x i8>) are currently heuristically
handled using maybeHandleSimpleNomemIntrinsic, which is incorrect.

Since the second argument is the shuffle order, we instrument all these
intrinsics using `handleIntrinsicByApplyingToShadow(...,
/*trailingVerbatimArgs=*/1)`
(https://github.com/llvm/llvm-project/pull/114490).
2025-08-15 20:28:30 -07:00
Kelvin Li
a44bd1568c
[clang-repl][AIX][zOS] Disable clang/test/Interpreter tests on AIX and zOS (NFC) (#153587) 2025-08-15 23:18:18 -04:00
Hristo Hristov
0561ede6c6
[libc++][jthread] LWG3788: jthread::operator=(jthread&&) postconditions are unimplementable under self-assignment (#153758)
Already implemented in LLVM18:
[695138c](695138ca84)

For details see:
https://github.com/llvm/llvm-project/issues/105045#issuecomment-3190674947

Closes #105045
2025-08-16 11:17:30 +08:00
Sergei Barannikov
76d993bd25
[Hexagon] Add missing operand when disassembling Y4_crswap10 (#153849)
Auto-generated decoder fails to add the $sgp10 operand because it has no
encoding bits.
Work around this by adding the missing operand after decoding is
complete.

Fixes #153829.
2025-08-16 02:13:43 +00:00
joaosaffran
37729d8ceb
[HLSL] Refactoring DXILABI.h to not depend on scope printer (#153840)
This patch refactors DXILABI to remove the dependency on scope printer. 
Closes: #153827

---------

Co-authored-by: Joao Saffran <{ID}+{username}@users.noreply.github.com>
2025-08-15 21:33:44 -04:00
Fangrui Song
e342dcd589
github: Add llvm:mc label for generic MC interface (#153737)
As a member of github.com/orgs/llvm/teams/pr-subscribers-llvm-mc , I was
not notified about PR #149935.

This commit introduces the `llvm:mc` label to cover the generic MC
interface, excluding target-specific MCTargetDesc files.

- Rename the `mc` label to `llvm:mc` for consistency with other LLVM
subdirectory labels.
- Exclude `llvm/test/MC` from the label scope, as it contains many
target-specific directories.

Admin: please change the name of
https://github.com/orgs/llvm/teams/pr-subscribers-llvm-mc
to "pr-subscribers-llvm:mc", similar to pr-subscribers-llvm:ir
2025-08-15 18:23:24 -07:00
Matt Arsenault
3e5d8a1439 Reapply "RuntimeLibcalls: Generate table of libcall name lengths (#153… (#153864)
This reverts commit 334e9bf2dd01fbbfe785624c0de477b725cde6f2.

Check if llvm-nm exists before building the benchmark.
2025-08-16 09:53:50 +09:00
Leandro Lacerda
cf5f311b26
[libc] Polish GPU benchmarking (#153900)
This patch provides cleanups and improvements for the GPU benchmarking
infrastructure. The key changes are:

- Fix benchmark convergence bug: Round up the scaled iteration count
(ceil) to ensure it grows properly. The previous truncation logic causes
the iteration count to get stuck.
- Resolve remaining compiler warning.
- Remove unused `BenchmarkLogger` files: This is dead code that added
maintenance and cognitive overhead without providing functionality.
- Improve build hygiene: Clean up headers and CMake dependencies to
strictly follow the 'include what you use' (IWYU) principle.
2025-08-15 19:51:52 -05:00
Stanislav Mekhanoshin
4198649c19
[AMDGPU] Use encodeFieldVaVdst in hazard recognizer. NFCI. (#153881)
Co-authored-by: Stephen Thomas <Stephen.Thomas@amd.com>

---------

Co-authored-by: Stephen Thomas <Stephen.Thomas@amd.com>
2025-08-15 17:50:27 -07:00
Slava Zakharin
5178aeff7b
Revert "[flang] Lower EOSHIFT into hlfir.eoshift." (#153907)
Reverts llvm/llvm-project#153106

Buildbots failing:
* https://lab.llvm.org/buildbot/#/builders/199/builds/5188
* https://lab.llvm.org/buildbot/#/builders/41/builds/8329
2025-08-15 17:48:40 -07:00
Stanislav Mekhanoshin
b7ec10ca6c
[AMDGPU] Update GCNHazardRecognizer's understanding of gfx12 waitcount instructions (#153880)
This simply updates the pass's cognizance of these instructions, and for
the
most part the hazards where they might be encountered do not exist for
gfx12.
Nonetheless, encountering them has to be checked for as doing so would
indicate
a compiler error.

Co-authored-by: Stephen Thomas <Stephen.Thomas@amd.com>

---------

Co-authored-by: Stephen Thomas <Stephen.Thomas@amd.com>
2025-08-15 17:18:41 -07:00
Craig Topper
e67ec12640
[RISCV] Remove experimental from Smctr and Ssctr. (#153903)
These extensions were ratified in November 2024.
2025-08-15 17:18:09 -07:00
Felipe de Azevedo Piovezan
99e690bc75
[lldb][nfc] Update docstring of StackFrame "get variable" methods. (#153728)
This commits makes the docs more precise, clarifying how scopes affect
the result of a method, as well as documenting a parameter of a
different method.
2025-08-15 16:47:31 -07:00
gulfemsavrun
f396657bf9
Revert "Remember LLVM_ENABLE_LIBCXX setting in installed configuration" (#153898)
Reverts llvm/llvm-project#139712

Caused an lld relocation issue as shown below:

https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8706642902273983073/+/u/clang/build/stdout
2025-08-15 16:45:40 -07:00
Chenguang Wang
e68989b930
[bazel] Fix //mlir:XeGPUDialect compilation. (#153904)
Broken by https://github.com/llvm/llvm-project/pull/153273.
2025-08-15 23:45:32 +00:00