[Transforms] Remove write-only and unused members (NFC) (#245544)
ModuleAddressSanitizer::Recover: Added on November 11, 2015 in commit
d7731988ef44c9417a79bd4db042183a60900f14 without any readers. This
patch also removes its initializer and the now-unused Recover
constructor parameter.
ModuleMemProfiler::Mapping: Added on August 13, 2020 in commit
7ed8124d46f94601d5f1364becee9cee8538265e without any readers. This
patch also removes its initializer.
ModuleSanitizerCoverage::FunctionPCsArray: The last readers were removed
on September 13, 2018 in commit
3bea25e5543606758ab10d395b1e7283255be75b. This patch also removes its
assignments and drops the now-unused return value of CreatePCArray.
SCCPInstVisitor::Ctx: The last reader was removed on June 19, 2023 in
commit 664b7a4cd51d9273888e79688f64cc8bbcbdbe25. This patch also
removes its initializer and the now-unused Ctx constructor parameter.
[5 lines not shown]
[ARM] Remove write-only private member variables (NFC) (#245543)
ARMFastISel::TM: The last readers were removed on August 20, 2026 in
commit 239b30e2f5bd11df57e7c4a054bf3a9b7b0bd714. This patch also
removes its initializer.
ARMLowOverheadLoops::MRI: The last reader was removed on September 17,
2019 in commit 36c922278e6e7fb2083dc29dda950dfac73a194c. This patch
also removes its assignment.
Assisted-by: Antigravity
Bitstream: Decode single-chunk VBR fields inline
Share one decoder between ReadVBR and ReadVBR64, decode the first chunk
inline from a word load, and only call out of line for the remaining
chunks. The inline part is always_inline because GCC otherwise clones
ReadVBR out of line, which made bitcode reading slower.
Instructions in parseIRFile with opt -passes=verify:
clang 23 GCC 15
k.bc -6.17% -0.14%
cnf.bc -5.93% +0.74%
sqlite3 -5.02% -0.38%
z08.bc -4.54% -0.56%
Whole opt -O3 runs: -0.14% to -0.47% with clang, within 0.02% with GCC.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SPIR-V] Use one helper for temp registers in the selector (#241373)
Some temp registers in the selector were made with
createVirtualRegister, which sets the full LLT. For wide vectors this
LLT is larger than the register class, so builds with assertions fail with
"VReg's low-level type and register class have different sizes",
for example on uitofp <8 x i1> to <8 x float>.
Add createTempVReg, which sets only the register class and the SPIR-V
type. Use it instead of createVirtualRegister, and in the places that did the
same steps by hand.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[C][Clang] Fix some formatting issues; NFC (#245730)
This puts the css class in the right place and fixes a misnumbering (we
had two issues numbered 1024).
[DAG] Add getFreeze(SDValue, UndefPoisonKind) variant (#245320)
Makes it easier to filter for just POISON/UNDEF cases, which will be
more common in upcoming patches - but avoids the need for manual
DemandedElts handling.
I had hoped to entirely remove the isGuaranteedNotToBeUndefOrPoison
check inside getNode() but there's a lot of code changes due to
different SDLoc etc. that should be handled separately.
[AMDGPU] Promote 16-bit return to i32 in the calling convention (#245288)
A follow up patch of https://github.com/llvm/llvm-project/pull/242694.
Same promotion for return
Co-authored-by: Claude Opus 5.5
[noreply at anthropic.com](mailto:noreply at anthropic.com)
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
[MLIR][XeGPU] Add a barrier after SLM reads in WgToSg distribution (#245104)
The SLM paths of convert_layout and of the cross-subgroup
multi_reduction emit store_matrix, gpu.barrier, then load_matrix, with
no barrier after the read. Inside a loop, a subgroup that finishes
reading can start the next iteration and overwrite the buffer while
another subgroup is still reading it. Add a barrier after the reads, so
the buffer is not rewritten until every subgroup has read it.
Found through IMEX layer_norm_4096x4096, which produced wrong results
once a convert_layout through SLM ended up inside its K loop.
assisted-by-claude
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[ConstantFolding] Fold constrained fpext of a constant (#244838)
An fpext is exact in every rounding mode, so the only floating-point
exception it can raise is invalid for a signaling NaN input. Fold
llvm.experimental.constrained.fpext of a constant, using
mayFoldConstrained to decide the signaling NaN case like the other
constrained intrinsics.
Without this, -frounding-math leaves a runtime conversion of a constant
behind. On targets with a soft fp128 that is a libcall, e.g.
_Qp_dtoq/_Qp_stoq on sparc64.
Update f21 in fp-intrinsics.ll, which expected the call to stay.
Fixes #244637
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DAG: Use the LibCall action for atomic operations lowered to calls
An Expand action on an atomic operation without an expansion falls
back to libcall lowering. Switch the VE atomicrmw operations and the
ARM and CSKY fences which relied on this fallback to LibCall, so the
action reflects whether the operation is intended to emit a call.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SandboxVec][LoadStoreVec] Support mixed-type store vectorization of arbitrary values
vectorizeStores() only handled chains whose stored values were all
consecutive loads or all constants. Any other chain, e.g., storing
function arguments or computed values, was left alone.
Pack such values into a vector with createPack(). For a chain of mixed
types the vector has integer lanes, so each value is first
reinterpreted (bitcast / ptrtoint) as the lanes it occupies with
Reinterpret::reinterpretValue(), and a value spanning several lanes is
inserted lane by lane. The pack is placed right before the vector
store, where every stored value is available. Whether this pays off is
left to the existing cost check in acceptOrRevert().
Chains storing a non-integral pointer are left alone.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Co-authored-by: Cursor <cursoragent at cursor.com>
[SandboxVec][LoadStoreVec] Vectorize store chains whose loads have external uses
Loads that feed a store chain used to block vectorization whenever
they had more than one use. Now the store chain can be vectorized even
if the loads have external uses. Once the scalar stores are erased,
each original load is rebuilt from the lanes it occupies in the new
vector load, and reinterpreted back to its original type if needed,
using canUnpackLoads() and unpackLoads().
The legality check runs before any IR is created, so a load whose lanes
cannot be reinterpreted (for example, a non-integral pointer) rejects
the whole chain instead of leaving a partially rewritten block.
Co-authored-by: Cursor <cursoragent at cursor.com>
[SandboxVec][LoadStoreVec] Factor out canUnpackLoads and unpackLoads (NFC)
Move the logic that unpacks each original load from the lanes it
occupies in a vector load, and the check that those lanes can be
reinterpreted as the load's type, out of vectorizeLoads() into the new
canUnpackLoads() and unpackLoads() helpers.
This is in preparation for sharing the unpacking with vectorizeStores(),
so that store chains whose loads have external uses can be vectorized.
Co-authored-by: Cursor <cursoragent at cursor.com>
[SPIR-V] Serialize the last inserted type in MIR (#245276)
Without it, types and constants created after MIR load go to the start
of the entry block and change the output order
[llubi] Mark caller stack objects inaccessible during tail calls (#245569)
Mark the caller's allocas and incoming byval objects inaccessible after
copying byval arguments. Then restore them on return since tail calls
are not always in tail position.
Fixes https://github.com/llvm/llvm-project/issues/235436
Coroutines: Fix test dependence on host compiler type name printing (#245740)
The printed name of RequireAnalysisPass depends on the host compiler,
so fix the check line regex.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[mlir][scf] Simplify selects on the condition forwarded by scf.condition (#245010)
Add a `WhileConditionSelect` canonicalization pattern, next to
`WhileConditionTruth`, that:
- replaces the uses of the `do` block argument with `%a` and the uses of
the loop result with `%b`, if they are defined outside of the loop;
- forwards `%a` (or `%b`) instead of the select once the loop result (or
the `do` block argument) has no uses, so that the select can fold away.
This complements `WhileMoveIfDown` once `scf.if` folds to
`arith.select`. Such selects also arise when lifting a CFG loop to SCF
with `transformCFGToSCF`: a value that only the exit edge passes to its
successor is forwarded through the loop results, with a dummy value on
the edge into the loop body, which canonicalization merges with a select
on the condition. When the dummy is not `ub.poison` (whose select folds
already), the select hides that the result is a value defined before the
loop.
[Clang][Docs] Clarify extension handling for -std (#245192)
Clang may accept language extensions in a selected standard mode.
Clarify this in the `-std` entry and link to the `-pedantic-errors`
option.
Verified on Windows with Clang 23.1.6. A GNU statement expression passed
a C++20 syntax check and produced the expected error with
`-pedantic-errors`. The updated Markdown page rendered locally with
Sphinx warnings treated as errors using the generated files from the
23.1.6 docs build.
Refs #39694.
Assisted-by: OpenAI Codex