[X86][APX] Keep hoist-folded-copy test effective
inline-spiller-hoist-folded-copy.ll reproduces a null VNInfo
dereference in HoistSpillHelper that needs greedy to fold a spill
into the COPY inserted by an NDD reload fold. SlotIndexes compaction
shortens the outer loop in index space, greedy spills differently,
and the test passes even with the fix reverted.
Add four empty asm statements to lengthen the loop again. The test
then crashes without the fix whether compaction is on or off.
[X86] Enable SlotIndexes compaction by default
Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.
Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.
Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for.
[X86][APX] Test the relocation of an NF add
test_regclass_not_updated_by_regalloc_2 only produced an NDD/NF add
with a GOT operand because the allocator happened to give the add a
destination different from its source. With SlotIndexes compaction it
picks the same register, so the add is compressed to the legacy form
and the CODE_6 TODO lost its test.
Add a function whose add keeps its source live, so it stays NDD and
becomes NF under any allocation.
[libc++] Assume __is_{,nothrow_,trivially_}destructible builtins are available (#246195)
The `__is_destructible`, `__is_trivially_destructible` and
`__is_nothrow_destructible` builtins are available in all compilers we
support, so we can remove the now unused implementations. Since the
implementations are rather small now, this patch also merges the three
headers into `is_destructible.h`.
[libc++] Simplify the implementation of iterator_traits a bit (#222297)
This change does a few things:
- remove concepts which have only a single use
- use functions returning `type_identity`s instead of specializing a
class
- use `__detected_or_t`
All of these changes simplify the implementation a bit, resulting in
quite a bit less code.
[libc++abi] Make the dst_type uniqueness flag in dynamic_cast a bool (#243530)
`number_of_dst_type` is only ever 0 or 1. Capture that fact by making it
a bool.
[libc++abi] Remove has_path_to_static_ptr from dynamic_cast (#244144)
`path_dst_ptr_to_static_ptr` already contains whether we found a path to
static_ptr, so there is no need to track it separately.
libsaslc(3): reduce verbiage
Prune "f() - The function f() does X" to just "f() - Do X." This also
gets rid of the visual clutter created by two long function names in
bold right next to each other.
Move saslc_strerror() next to other context functions - it's their
errors that it reports. It's far more important than the superficial
similarity with saslc_sess_strerror().
Leave encode/decode alone for now. Rewording that bit is not as
straightforward as the rest of them.
[LV] Vectorize select-based FP min/max reductions without fast-math. (#243462)
Model select(fcmp) FP min/max reductions without nnan/nsz as new
FMinSelect/FMaxSelect recurrence kinds and handle them like
FMinNum/FMaxNum in handleMaxMinNumReductions: exit the vector loop early
on NaN inputs and re-execute the last vector iteration in the scalar
loop.
Selects pick one of two equal operands depending on their order, and
equal non-NaN values only differ in the sign of zero, so also exit early
on -0.0 inputs, or +0.0 if the start value is -0.0. Restrict this to
IEEE types with IEEE denormals, as otherwise equal values can differ in
more than the sign of zero, and the vector reduction may flush
denormals. Non-constant and NaN start values are not supported yet.
Only use the select's fast-math flags, as nsz on its fcmp does not apply
to the result. Drop nnan/ninf from the selects using the reduction phi,
and set nnan on the reduction result, which cannot be NaN, to avoid
fmin/fmax libcalls.
[6 lines not shown]
[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.
[VectorUtils] Exempt root users from the out-of-the-chain check
computeMinimumValueSizes bails out when it finds a not visited
integer user of a visited value. The main motivation for this
is to avoid adding extra casts.
For roots (currently it's truncs and icmps), this is overly
conservative. Shrinking these instructions only changes their
operands but not their result types. Because of this root's users
won't need additional casts.
For the reference, SLP made a similar relaxation for its own
minimum bitwidth analysis in #72679.
[lldb][NFC] Remove redundant zero assignments in TypeSystemClang
TypeSystemClang::GetChildAtIndex starts from a value-initialized
ChildTypeInfo, so it doesn't need to set byte_offset to 0.
assisted by claude
[RISCV] Limit outer-loop unrolling (#244182)
At O3, LLVM fully unrolls an outer loop in a hotspot found in SPEC
CPU 2026 `706.stockfish_r`, duplicating its inner vector loop 16 times.
Cap the full-unroll threshold at the partial-unroll threshold for
non-innermost loops. Small loops and explicit unroll requests can
still unroll.
With `-march=rv64gcv -O3`, the reproducer shrinks from 1550 to 128
bytes.
QEMU instruction counting also shows 8.45%, 8.11%, and 7.43% fewer
instructions at VLEN=128, 256, and 512, respectively.
This matches GCC partially since GCC is conservative as well here.
Reproducer: https://godbolt.org/z/8b9KPYd3d
Assisted-by: TRAE CLI (GPT-6)