[CIR] Add a temporary symbol table scope inside the inline inherited constructor helper (#239173)
**Fixes issue** : #233327
Create a symbol table whenever the inline inherited constructor helper
(`emitInlinedInheritingCXXConstructorCall`) runs. it gives the synthetic
`this` declaration’s symbol table entry a scope while CIRGen generates
the constructor work.
**AI Usage:** GPT 6.0 Luna was used to understand CIR architecture and
understand how symbol table and lexical scope works in CIR.
Revert "[AArch64] Decompose store(insert(insert(..)) to separate stor… (#243722)
#238314 Hangs on some compilations.
This reverts commit 68de95d0d271e79b7a84cae534716745513c2b8e.
[lldb][test] Mark tests that cannot build for Wasm as unsupported (#243729)
Fix various API tests that are unresolved in the WebAssembly stage of
lldb-cmake-matrix, because the tests do not compile for wasm32-wasip1.
[lldb][test] Skip TestInlinedFunctionStatic.py on older Clang (#243728)
The test fails on the matrix bot, which builds the inferior with older
Clang releases. Skip it for Clang older than 24.
AMDGPU: Don't include stack size of chain callees (#234520)
Chain callees are always tail called into and overwrite the caller's
stack. Therefore, their stack size should not be added up to that of
their caller when computing the resource usage.
Assisted-by: AI
[lldb][test] Add a debugger fixture for SB API unit tests (NFC) (#243724)
The SB API unit tests require LLDB to be initialized, and most require a
debugger and target. Add a new SBDebuggerFixture, which does all that.
[CIR][NFC] Decouple target lowering selection from C++ ABI setup (#236537)
Select target lowering rules from the target triple without constructing
a `LowerModule` or allocating Clang target and C++ ABI state. Share the
factory with ABI lowering so type conversion can query target
representations independently.
Assisted-by: Codex / GPT-6
[libc][stdio] Implement putc_unlocked (#243329)
Implements `putc_unlocked` for Linux full builds.
Adds the entrypoint, internal header, stdio.yaml declaration, CMake
targets,
entrypoint entries for aarch64/riscv/x86_64, and three unit tests.
Part of #242485
GlobalDCE: Only clear the analyses of deleted functions (#243713)
GlobalDCE reported no preserved analyses whenever it deleted anything,
which clears every cached function analysis in the module. Refine this
to only discard analyses of erased functions.
callgrind instructions, opt -O3: kimwitu++ k.bc -0.07%, where the
cleared TargetLibraryInfo had to be computed again for each function.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[lldb][test] Fix DebuggerSupportsLLVMTarget always returning false (#243716)
SBStructuredData::GetStringValue returns the size needed to hold the
string, which includes the terminating NUL. The StringRef built from
that size never compared equal to the target name, so the helper
reported every target as unsupported.
[Flang][OpenMP] Fix missing implicit barrier for empty sections constructs. (#241735)
This patch fixes a missing implicit barrier at the end of an empty
`!$omp sections` construct, where threads could previously proceed
without synchronization, violating OpenMP semantics.
The fix ensures that `convertOmpSections` emits the required implicit
barrier when `sectionCBs` is empty, unless the `nowait` clause is
specified.
DeadArgumentElimination: Only invalidate the analyses of changed functions (#243712)
DeadArgumentElimination reported no preserved analyses whenever it
changed anything, discarding all cached function analyses in the
module. Refine this to functions whose calls or argumenst are changed.
callgrind instructions, opt -O3: kimwitu++ k.bc -0.21%, sqlite3 -0.11%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Use SCC branches for uniform truncates to i1 (#241944)
A branch on a set low bit reaches isel as brcond (truncate x), either
from an IR trunc to i1 or from SimplifySetCC folding (and x, 1) != 0
into truncate x. The uniform truncate-to-i1 patterns already select to
S_CMP and produce SCC, but isCBranchSCC only accepted SETCC, so the
branch went through s_cselect, a lane mask and EXEC before branching on
VCC.
Also accept a one-use uniform truncate from i16, i32 or i64, the source
types the SCC-producing patterns in SIInstructions.td cover, so these
branches become s_bitcmp + s_cbranch_scc. Divergent truncates keep the
lane-mask path.
Assisted-by: Claude Opus 5.5
AlwaysInliner: Preserve the function analysis manager proxy (#243711)
AlwaysInliner already updates the analyses of the functions it inlines
or deletes, but did not preserve FunctionAnalysisManagerModuleProxy,
which ends up clearing every cached function analysis in the module.
This doesn't make much difference in CTMark since few of the programs
use alwaysinline, with the exception of kimwitu++ k.bc (-0.50%).
always_inline is well overused in GPU code, so a sample of 441 ROCm
bitcode files show a -0.08% geomean improvement.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[MIR2Vec] Fix the common operand index for MO_LaneMask (#243374)
CommonOperandNames has no MO_DbgInstrRef entry, so lookups for later
types used the wrong slot
Map each operand type to its vocabulary entry explicitly, so the index
no longer depends on enum order
Operand types without an entry get a zero embedding
GlobalDCE: Only clear the analyses of deleted functions
GlobalDCE reported no preserved analyses whenever it deleted anything,
which clears every cached function analysis in the module. Refine this
to only discard analyses of erased functions.
callgrind instructions, opt -O3: kimwitu++ k.bc -0.07%, where the cleared
TargetLibraryInfo had to be computed again for each function.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc][math][NFC] Rename PolyEval.h to polyeval.h. (#243339)
Rename src/__support/FPUtil/PolyEval.h to polyeval.h to match lowercase
snake_case header naming, and update includes, CMake, and Bazel rules.
[libc][math] Expand polyeval.h with array, loop, and Estrin evaluation. (#243523)
Add array-based, non-unrolled loop, and right-heavy Estrin polynomial
evaluation helpers to `fputil`:
- Add array overloads with optional `OFFSET` template parameter for
`polyeval` and `altpolyeval`, using `sub_multiply` for `altpolyeval` and
supporting both value (`<= sizeof(double)`) and const-ref (`>
sizeof(double)`) coefficient types.
- Add `loop_polyeval` and `loop_altpolyeval` with `LIBC_LOOP_NOUNROLL`
for code-size-sensitive evaluations.
- Add `estrin_polyeval` (array and variadic overloads) using a
precomputed dyadic power table and a minimum-depth right-heavy binary
tree.
- Add unit tests in `polyeval_test.cpp` covering `float`, `double`,
`DoubleDouble`, `DyadicFloat<128>`, and `Frac128` across rounding modes
and evaluation-order sensitivity.
[libc][math] Use multiply_sub and sub_multiply across math functions. (#243290)
Replace `multiply_add(a, b, -c)`, `multiply_add(-b, c, a)`, and
`multiply_add(b, -c, a)` with `multiply_sub` and `sub_multiply`.
[libc][math] Add multiply_sub and sub_multiply to multiply_add.h. (#243269)
- Add `fputil::multiply_sub` `(x * y - z)` and `fputil::sub_multiply`
`(x - y * z)` alongside `fputil::multiply_add` `(x * y + z)`.
- Add `NumberPair<T>` `add/sub` overloads in `double_double.h`, and
matching `multiply_sub` and `sub_multiply` overloads for `DoubleDouble`
and `DyadicFloat`.
- Specialization to use `fmadd`/`fmsub` instructions when available.
DeadArgumentElimination: Only invalidate the analyses of changed functions
DeadArgumentElimination reported no preserved analyses whenever it
changed anything, discarding all cached function analyses in the
module. Refine this to functions whose calls or argumenst are changed.
callgrind instructions, opt -O3: kimwitu++ k.bc -0.21%, sqlite3 -0.11%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
AlwaysInliner: Preserve the function analysis manager proxy
AlwaysInliner already updates the analyses of the functions it inlines
or deletes, but did not preserve FunctionAnalysisManagerModuleProxy,
which ends up clearing every cached function analysis in the module.
This doesn't make much difference in CTMark since few of the programs
use alwaysinline, with the exception of kimwitu++ k.bc (-0.50%).
always_inline is well overused in GPU code, so a sample of 441 ROCm
bitcode files show a -0.08% geomean improvement.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[compiler-rt] Fill Windows runtime version metadata (#243544)
Windows compiler-rt DLLs lack descriptions, copyright information and
original filenames, and their numeric ProductVersion is zero.
Fill the descriptive fields and identify ASan as "AddressSanitizer
runtime". Record the actual DLL filename and set numeric ProductVersion
to the same numeric version as FileVersion.