[CodeGen] Declare command line options of the machine pipeliner in TableGen (#246484)
WindowSchedulingFlag becomes an enum class with WS_On, the -window-sched
default, as its zero enumerator.
-pipeliner-opt-size reads its value, so -enable-pipeliner-opt-size=false
no longer enables the pipeliner at -Os. -pipeliner-dbg-res and
-pipeliner-show-mask, read only in LLVM_DEBUG, exist only in assertions
builds.
Renames, with the old spelling kept as an alias:
```
-enable-pipeliner-opt-size -> -pipeliner-opt-size
```
LLM-aided
[analyzer][NFC] Use a base region map in RemoveDeadBindingsWorker (#246433)
RemoveDeadBindingsWorker looked up the cluster of a region in the store
every time it was added to the worklist, and tracked visited clusters in
a separate set that it probed again when filtering the store.
Record every cluster and a visited flag in a map from the base region
when the clusters are generated, so adding a region to the worklist is a
single hash lookup. If every cluster is live, return the store
unchanged. The worker no longer uses ClusterAnalysis.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) this
reduces the instructions of the static analyzer by 2.5-3.3%.
Assisted-by: Claude Opus 5.5
---------
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[cmake] Escape compiler launchers in the NATIVE configure command (#246475)
Newer ccache versions support specifying options directly on the command
line. Make sure `-DCMAKE_<LANG>_COMPILER_LAUNCHER` is correctly
propagated to the NATIVE sub-build if the user passed a list.
Assisted-By: Claude
Co-authored-by: Claude Sonnet 5.5 <noreply at anthropic.com>
[LifetimeSafety][NFC] Use one allocator per analyzed function (#246490)
Each of the four immutable collection factories created its own
BumpPtrAllocator, and the fact, origin list and loan managers had one
each, so every analyzed function allocated seven slabs and four
allocator objects even when it produced only a handful of facts. Most
functions are small, so this setup dominated their cost. Allocate
everything from a single allocator owned by LifetimeSafetyAnalysis.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) with
-fsyntax-only -Wlifetime-safety, this reduces the instructions of the
lifetime safety analysis by 4.7-8.8% (0.6-0.9% of the whole
compilation).
Assisted-by: Claude Opus 5.5
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[LifetimeSafety][NFC] Skip the moved loans analysis for functions without moves (#246489)
Most functions do not pass anything to an rvalue reference parameter, so
no loan is ever moved and the analysis computes an empty map at every
point. Record whether a MovedOriginFact was created and skip the
analysis otherwise.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) with
-fsyntax-only -Wlifetime-safety, this reduces the instructions of the
lifetime safety analysis by 5.3-7.3% (0.5-0.8% of the whole
compilation).
Assisted-by: Claude Opus 5.5
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[libc++][pstl] Add a parallel implementation of exclusive scanning (#244683)
This PR generalises the existing implementation of parallel
`transform_inclusive_scan` to support both inclusive and exclusive
scans.
The implementation is pulled out into a new free function
`__statpart::__transform_scan()` that gets an additional template
parameter specifying the flavour of scanning.
Depending on that parameter the leaf scanning lambda implicitly switches
between inclusive and exclusive scans.
Both `inclusive_transform_scan` and `exclusive_transform_scan` just call
this new function with a different template parameter, i.e.
`__transform_scan</*inclusive=*/true>(...)` and
`__transform_scan</*inclusive=*/false>(...)`.
[llvm-cov] Look up expansion regions by FileID with binary search
Region vectors are already sorted by FileID, so filtering for one file
is just selecting a contiguous subrange. Do that with a binary search
instead of scanning the whole function.
[CIR] Test lowering of undef and poison aggregate constants
An undef or poison array, record or complex constant lowers to
llvm.mlir.undef or llvm.mlir.poison of the whole type before the
per-type lowering, so the removed isa checks never matched.
Assisted-by: Claude Code (Opus 5.5).
[libc++][pstl] Add a parallel implementation of std::copy_if (#241966)
This PR adds a parallel implementation of `std::copy_if` based on a
single-pass scanning.
Each partition is represented in the look back as the number of elements
for which the user-provided predicate returns `true` (partition
occupancy in other words).
This way the prefix of the loopback partition represents the position in
the destination range where its elements should be copied to.
The predicate flags are stored in a dynamically allocated bitset, which
has a size of `max_partition_size * max_workers_count` bits, aligned to
the cache line size.
[LowerMemIntrinsics] Make TTI non-optional and simplify signature of expandMemSet(Pattern)AsLoop (NFC) (#246090)
Simplify and remove the TTI-pointer null-allowing overloads. Nothing is
currently using them anyway.
[LangRef][MemoryBuiltins] Add support for CHERIoT's heap_allocate and heap_free functions. (#245094)
This requires relaxing the LangRef requirement that `allockind(free)`
functions must return `void`. CHERIoTRTOS' primary heap free API
`heap_free` returns an integer error code, necessitating this change.
Once integer-returning `allockind(free)` functions are permitted, we
also add an extensible path for looking up the return value to substitue
in the case where `free(alloc(...))` is elided. For now we require this
to be 0.
[lld-macho] Collect S_ATTR_LIVE_SUPPORT sections with the markLive roots
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply at anthropic.com>
[clang-format] Use formatted breaks to align trailing comments (#246023)
With Allman braces, the first formatting pass can pad a block comment
after a closing brace to align it with a comment after `else`. The
second pass removes that padding because the brace now starts a line in
the input.
Use the formatter's recorded line-break decision when checking the
closing brace. Fall back to the original whitespace when the token has
no formatting decision.
The new regression failed before the change and passed afterward. All 54
comment formatting tests passed in a Windows build that reapplied this
change to LLVM 23.1.6.
Fixes #245606.
Assisted-by: OpenAI Codex. Draft for contributor review.
[Offload][Omp] Use olMemCpy3D in omp_target_memcpy_rect
Implement olMemCpyRect more generically in DeviceTy using the
accelerated olMemCy3D if supported by the device.
Use it to reimplement omp_target_memcpy_rect.
Assisted by Claude.
[Offload] Add olMemcpy3D API (#241959)
Add a new API that allows to copy 2D or 3D regions. Implement the
support for all the backends.
This API can be used to implement more efficitently
omp_target_memcpy_rect (see #241960)
or SYCL's sycl_ext_oneapi_memcpy2d.
Assisted by Claude.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[CIR] Lower constrained FP ops to typed LLVM dialect ops
Constrained FP ops were lowered to llvm.call_intrinsic with the intrinsic
name spelled as a string and the rounding mode, exception behavior and
fcmp predicate passed as metadata operands. The LLVM dialect has typed
ops for these intrinsics, which take the modes as enum attributes and
translate through IRBuilder::CreateConstrainedFPCall/CreateConstrainedFPCmp.
Use them: constrainedLLVMOp names the typed op in ODS (derived from
llvmOp where the names line up), whether it takes a rounding mode comes
from its RoundingModeOpInterface trait, and constrained fcmp reuses
convertCmpKindToFCmpPredicate. This removes the metadata helpers, the
predicate string tables and constrainedLLVMIntrinsicHasRoundingMode.
The LLVM IR now carries the strictfp call-site attribute on constrained
intrinsic calls, matching classic codegen.
Assisted-by: Claude Code (Opus 5.5).
[lld-macho] Collect S_ATTR_LIVE_SUPPORT sections with the markLive roots
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply at anthropic.com>
[clang][bytecode] Fix non-determinism diagnosing allocations. (#246151)
If there are multiple dynamic allocations, make sure we pick
consistently. Fixes failure on reverse-iteration bot
(https://lab.llvm.org/buildbot/#/builders/110).
[X86] canonicalizeShuffleWithOp - VZEXT_MOVL(LOGIC(X,Y)) ensure LOGIC uses integer type (#246469)
Missed in #245974 - VZEXT_MOVL nodes might have been used for fp-types,
so we must cast to an equivalent integer vector to perform the
and/or/xor op.
Fixes #246253
[analyzer][NFC] Avoid rebuilding full type ranges in the range inferrer (#246441)
SymbolicRangeInferrer::infer(QualType) built the full range of the type
for every symbol whose range was queried, and intersecting it with the
symbol's constraint built and uniqued another copy of the constraint.
Cache the full range set per integer type in RangeSet::Factory, and let
intersect return an operand directly when the other one is a single
range covering it.
On some LLVM TUs (GVN, LiveVariables, RegionStore, SemaExpr) this
reduces the instructions of the static analyzer by 1.7-3.2%.
Assisted-by: Claude Opus 5.5
Co-authored-by: Gabor Horvath <gaborh at apple.com>
[CIR] Lower constrained FP ops to typed LLVM dialect ops
Constrained FP ops were lowered to llvm.call_intrinsic with the intrinsic
name spelled as a string and the rounding mode, exception behavior and
fcmp predicate passed as metadata operands. The LLVM dialect has typed
ops for these intrinsics, which take the modes as enum attributes and
translate through IRBuilder::CreateConstrainedFPCall/CreateConstrainedFPCmp.
Use them: constrainedLLVMOp names the typed op in ODS (derived from
llvmOp where the names line up), whether it takes a rounding mode comes
from its RoundingModeOpInterface trait, and constrained fcmp reuses
convertCmpKindToFCmpPredicate. This removes the metadata helpers, the
predicate string tables and constrainedLLVMIntrinsicHasRoundingMode.
The LLVM IR now carries the strictfp call-site attribute on constrained
intrinsic calls, matching classic codegen.
Assisted-by: Claude Code (Opus 5.5).
[CIR] Call the library exp10 in a constrained FP environment
LLVM has no constrained exp10 intrinsic. Under strict FP, CIRGen still
emitted cir.exp10 with an fenv attribute, which lowered to a call to the
nonexistent llvm.experimental.constrained.exp10 and failed in translation
to LLVM IR with "could not find LLVM intrinsic". Fall back to the library
call instead, as classic codegen does, and reject fenv on cir.exp10 in its
verifier so no other producer can create the unlowerable form.
Assisted-by: Claude Code (Opus 5.5).
[libc++] Fix locale_base on generic Unix (#238740)
This re-adds an `#if` for MVS that was dropped in 182ae96a82fc, and
uses the generic linux path whenever glibc is in use.
[libc++][NFC] Fix figure captions in __vector/layout.h (#242817)
The caption of Figure 1 refers to boxes marked with `xx`, but the
diagram marks allocated-but-unused slots with `------`.
Signed-off-by: Alexander Kuleshov <kuleshovmail at gmail.com>
[GlobalsModRef] Remove leftover TLI pass dependency (NFC) (#246470)
The last use of TargetLibraryInfoWrapperPass in GlobalsAAWrapperPass was
removed on November 26, 2026 in commit
6e3568595dfd49d950b75c00be2b522455885bd1. This patch removes the
remaining analysis requirement and the unused Trip variable.
Assisted-by: Antigravity
[llvm] Remove write-only and unused members (NFC) (#246266)
This patch removes private member variables across llvm/ that are
initialized or assigned to but never read, along with their initializers
and assignments. This patch also removes two unimplemented private
member function declarations, MachOWriter::strTableSize and
XCoreTargetLowering::LowerGlobalTLSAddress.
Assisted-by: Antigravity