[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.
[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.
[Attributor] Do not use the exclusion set for the dominating-write query (#242762)
Fixes #242203.
When determining whether a write in another function can be skipped
because of a dominating write, `AAPointerInfoImpl` asks
`AAInterFnReachability` whether the function containing that write can
be reached from the least dominating write, and passes the exclusion set
to this query. The exclusion set contains the instruction itself as well
as other must-write accesses to the same location. This logic was
introduced in b84ea7a47586.
No member of the exclusion set should block this query. First, the
instruction may be in a cycle: the write can happen after it and still
be observed by a later execution of it. In the reproducer, a loop
counter is incremented by a callee: every path from `store i32 0` to
`call @inc` goes through the load in the loop header, so the store in
`@inc` was considered not to interfere. It was deleted and the load was
folded to `0`, turning the loop into an infinite loop.
[32 lines not shown]
[CodeGen][Rematerializer] Fix region bounds tracking logic
This addresses a few edge-case/rare issues with keeping the bounds of
rematerialization regions valid and up-to-date as rematerializations
happen.
1. An upper region boundary deleted through dead-def elimination needs
to be pushed to the next valid instruction.
2. Updating any region boundary in any case may require updating
boundaries of other "touching" regions to keep them valid too. Issues
could typically happen when a rematerialization region's end would be
the beginning of the next one. Receeding the beginning of the latter
region also requires receeding the ending of the former region to
keep them non-overlapping.
Added unit-tests would crash without changes.
search: match several fields with -S any
The search fields were either a single column or the fixed combination of
the comment and the description, so matching a keyword in the name, the
origin, the comment and the description at once, the way the ports tree
searches its index, required as many runs.
Add an "any" field composing them, sorted by package name.
Fixes: #2700
[CodeGen][Rematerializer] Region upper-bounds are not rematerializable
Upper-bounds of rematerialization regions should not be considered
rematerializable instructions since they are semantically outside the
regions they delimitate. Rematerializing them would make region bounds
invalid.
[SPIRV] Emit DebugTypedef with DebugInfoNone base for typedef void (#244223)
Typedefs now use the same recently introduced helper and can handle a
typedef with no base type (`typedef void V;`). It is now emitted as a
`DebugTypedef` with a `DebugInfoNone` base.
`spirv-val` now accepts `DebugInfoNone` as a debug type operand
(https://github.com/KhronosGroup/SPIRV-Tools/issues/6744). The standard
might actually allow DebugInfoNone in all NSDI operands (see
https://github.com/KhronosGroup/SPIRV-Tools/issues/7025).
The tests run `spirv-val` too.
Co-authored-by: Cursor <cursoragent at cursor.com>
[flang-rt] Don't dereference an empty optional at the end of NAMELIST input (#245579)
InputNamelist checked the character after a group's last item with
`*next && ...`.
When the input ends before the group's terminating '/', `next` is empty,
so `*next`
dereferences an empty optional. With libstdc++ assertions on, the test
from issue
#244882 aborts at this dereference; the SIGTRAP in that issue is from a
build against
libc++. Test `next` instead.
Such input still gets the existing "No '/' found after NAMELIST group"
error.
Fixes #244882
Assisted-by: AI
[OpenMP] Honour memory-order clauses on the flush directive (#241295)
At present the acquire, release and acq_rel clauses on 'flush' are
accepted but have no effect. Flushes are emitted as `__kmpc_flush`
runtime calls, which implement a seq_cst fence.
AMD have had a downstream patch for a while (by Carlo Bertolli) which
adds per-ordering `__kmpc_flush_*` entry points to the device runtime.
This patch takes a slightly different approach: for the host, a seq_cst
flush still calls `__kmpc_flush`, and a flush with any other ordering
calls the `__kmpc_flush_explicit` entry point from #133325, so it needs
a runtime that has that. For the GPU, it emits a fence directly.
This has mild benefits: OpenMPOpt already handles fences when it
converts kernels to SPMD mode, but has no knowledge of the new
`__kmpc_flush` calls (either _explicit or Carlo's per-ordering flush
calls). Scope names differ per-GPU: they are determined using the
mechanism introduced by #213810 ("[LLVM] Unify atomic scope handling
between LLVM and Clang").
[19 lines not shown]
[VPlan] Create interleave groups before scalarization decisions. (#245585)
Move createInterleaveGroups to right after the memory widening
decisions,so makeScalarizationDecisions sees the group's single
address use. Mostly no change yet, as the legacy cost model still
marks those addresses uniform.
Needed by https://github.com/llvm/llvm-project/pull/244728.
Follow-up to earlier
movehttps://github.com/llvm/llvm-project/pull/243789
[SystemZ] Select WCEFB/WCELFB/WCFEB/WCLFEB for vector-element conversions (#245369)
On z15, use the scalar-in-vector convert instructions when one side of
an i32<->f32 conversion already lives in a vector register:
* (s|u)itofp of an extracted <4 x i32> element -> WCEFB/WCELFB, using
VREPF first for elements 1-3.
* fptosi/fptoui whose i32 result goes into element 0 of a vector
(scalar_to_vector, insert into undef, or splat) -> WCFEB/WCLFEB.
This avoids the GPR round trip (vlgvf + cefbr, cfebr + vlvgf). GPR<->FPR
conversions and variable-index extracts are unchanged.
Also fix the dest/source operand types of VCFEB/VCLFEB/WCFEB/WCLFEB
(which were reversed) and VCEFB/VCELFB (v128g -> v128f).
Add vec-conv-04.ll and vec-strict-conv-04.ll, including negative and z14
checks.
Assisted by: IBM Bob
[SystemZ] Add missing CC def to TRANSLATE EXTENDED (TRE) (#245460)
TRE sets the condition code (0: operand processed, 1: test character
found, 3: CPU-determined amount processed), but its definition did not
list CC as an implicit def.
Adding the def raises TRE's write count from two to three, so update the
TRE scheduling entries for z196 through z17 to match (as for CU41/CU42).
Assisted by: IBM Bob
[SystemZ] Support ISD::AVGCEILS and ISD::AVGCEILU (#244786)
Mark ISD::AVGCEILS and ISD::AVGCEILU as legal for vector types on z13+
and for i128 on z17 (VectorEnhancements3). Match them to VAVG* and
VAVGL* instructions while preserving mappings for existing s390
intrinsics.
Assisted by: IBM Bob
acpi_spmc: Make Intel device-specific state optional
The Intel Low Power S0 Idle _DSM specification marks the minimum
device-specific state of a constraint package as optional, and its own
example returns {0xFF, 0}. Requiring three elements rejected such
constraints, with one boot message each.
Reviewed by: olce
Approved by: olce
Fixes: 508efe35e577 ("acpi_spmc: Check Intel constraint packages")
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/134
fetch: look the server list up once
When the SRV records or the mirror list of a repository cannot be resolved,
pkg falls back on the host of its URL, but the list was only cached on
success: the failing lookup, which is slow on a network without DNS, was
done again for every file fetched from the repository, and its error was
reported as many times.
Remember that the list could not be resolved for the repository, so that a
run looks it up once and reports it once.
Reported in #2786.