[SLP]Fix APInt assertion for constant stride wider than index type
The stride, computed as a difference of offsets wrapped in the index
width, may not fit the index type (e.g. 2^31 in i32). Truncate it;
address arithmetic wraps at the index width, so the accessed lanes
stay the same.
Fixes #236180
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/236627
[Driver][SYCL] Skip the spirv64 builtins library when it is missing (#236556)
#218528 made a missing `libclang_rt.builtins.bc` an error for SYCL
spirv64 device compilations. That library is only built when compiler-rt
is built for spirv64, so every Clang built without it, including the one
on godbolt.org, now fails on plain `-fsycl` (reported in
https://github.com/llvm/llvm-project/pull/218528#issuecomment-6426376844).
Link the library when it is present and skip it otherwise, as the driver
already does for the OpenMP NVPTX and AMDGPU builtins (#109152).
[SandboxVec][LoadStoreVec] Move contiguity check into canVectorize() (NFC)
Both vectorizeStores() and vectorizeLoads() (via createVectorLoad())
checked that the bundle is consecutive right before calling
canVectorize(). Fold that check into canVectorize() so that every
caller gets it.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[SandboxVec][LoadStoreVec] Reject bundles that cannot be scheduled
canVectorizeLSV() created a CantSchedule result when the scheduler
failed, but did not return it, so such bundles were still reported as
Widen. For a load chain like
%ld0 = load i32, ptr %p0
store i32 %ld0, ptr %p1
%ld1 = load i32, ptr %p1
the vector load was placed after %ld1 and the store was rewritten to
use a lane extracted from it, producing a use before its definition.
Return the CantSchedule result.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
ena: Reinit RSS components during queue count change flow
The io_queues_nb sysctl is writable while the interface is down, and
setting it destroys the RSS components. When the interface is not UP
nothing reinitialises them, so the indirection table is left referencing
queues that no longer exist until the next ifconfig up.
Call ena_rss_configure() after the queue count changes when the
interface is down. When it is up, this happens through ena_up().
This can configure RSS twice if the interface is brought up afterwards,
costing three redundant admin commands. That is preferred over changing
ena_up(), which the reset path also uses.
Reviewed by: cperciva
Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Update driver version to v2.8.5
New Features:
* Retrieve RSS indirection table size from device
Bug Fixes:
* Limit IO IRQ setup loop to active queues only
* Reinit RSS table on device restore when queue count shrinks
* Fix RSS not working after driver reload
* Fix NULL deref before NULL check in RSS sysctl
* Reinit RSS components during queue count change flow
Minor Changes:
* Fix ENA_MEM_FREE_COHERENT with an expression size argument
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Reinit RSS table on device restore when queue count shrinks
When ena_restore_device() is called after a reset, pci_alloc_msix()
may return fewer MSI-X vectors than requested, causing num_io_queues
to shrink. When this happens, the RSS indirection table retains
entries referencing queues that no longer exist, routing packets to
non-existent queues and causing connectivity loss.
Extract ena_set_io_queue_count() to pair the queue count update with
ena_com_rss_destroy(), ensuring the RSS table is always invalidated
when the queue count changes. Use it from both ena_update_io_rings()
and ena_restore_device().
Reviewed by: cperciva
Fixes: e2735b095b7e ("Fix assumptions about number of IO queues in the ENA")
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Fix NULL deref before NULL check in RSS sysctl
In ena_sysctl_rss_indir_table(), the code dereferenced
indir->sysctl_buf before checking whether indir itself is NULL.
Move the NULL check above the dereference so the early-return path
fires before any access through indir.
Reviewed by: cperciva
Fixes: 6d1ef2abd330 ("ena: Implement full RSS reconfiguration")
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Retrieve RSS table size from device
The current driver assumes a default RSS table size of 128 entries,
expecting the device's RSS table size to match this assumption.
This patch allows the driver to create RSS indirection table
with the size advertised by the device.
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Fix RSS not working after driver reload
When reloading the driver (kldunload/kldload),
ena_rss_init_default_deferred() is called before ena_attach()
completes. At this point, devclass_get_softc() returns NULL for all
devices because the adapter structs have not been populated yet. As a
result, ena_rss_init_default() is never called and ENA_FLAG_RSS_ACTIVE
is never set. Later, in ena_up_complete(), the code checks the flag,
finds it unset, and skips ena_rss_configure() entirely. RSS is never
initialized, and all traffic is directed to queue 0.
Remove the ENA_FLAG_RSS_ACTIVE gate in ena_up_complete() and always call
ena_rss_configure(), which initialises the table when tbl_log_size is
zero. The deferred SYSINIT is now redundant, so remove it.
Reviewed by: cperciva
Fixes: 9b8d05b8ac78 ("Add support for Amazon Elastic Network Adapter (ENA) NIC")
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Limit IO IRQ setup loop to active queues only
The loop in ena_request_io_irq() iterated over adapter->msix_vecs,
which reflects the maximum number of MSI-X vectors allocated at
init time. When the number of IO queues is reduced at runtime via
the io_queues_nb sysctl, msix_vecs is not updated, causing the
driver to bind interrupts and log CPU affinity for queues that no
longer exist.
Replace the loop bound with ENA_IO_IRQ_IDX(adapter->num_io_queues)
to iterate only over the currently active IO queues.
Also replace the loop in ena_free_io_irq() the same.
Reviewed by: cperciva
Fixes: 56d41ad5fe9c ("Add sysctl node for ENA IO queues number adjustment")
MFC after: 3 days
Sponsored by: Amazon, Inc.
[asan][test] XFAIL intercept-rethrow-exception.cpp on Android again (#236624)
#236607 removed this XFAIL together with the rest of #235557, on the
assumption that the failure came from #196388. It does not: the test
still fails on sanitizer-x86_64-linux-android, for both x86_64 and i686,
with #196388 reverted
(https://lab.llvm.org/buildbot/#/builders/186/builds/3859).
That bot only started running lit tests on Android emulators after
#196388 had landed, so it never showed this test passing before it. The
other two tests whose XFAILs #236607 removed now pass.
[lld-macho] Build the export trie by edges, not bytes
Emit singleton suffixes directly and scan common prefixes in one pass,
avoiding repeated byte-wise partitioning. This speeds up builds that
emit large export tries.
Wall time with
[LinkerBench](https://github.com/int3/macho-linker-bench),
release build, assertions off. Median ± 95% CI over at least 20
interleaved
runs per side.
## M4 Mac mini (10 cores, 16 GB):
| Link | Exports | 10 threads | 1 thread |
| --- | ---: | ---: | ---: |
| rust-analyzer (debug) | 248,607 | 650.3 ± 1.2 → 625.4 ± 1.9 ms (−3.8%)
| 951.7 ± 0.9 → 870.3 ± 1.7 ms (−8.6%) |
| SourceKit-LSP | 105,359 | 604.2 ± 2.3 → 605.4 ± 1.6 ms | 774.5 ± 1.3 →
[14 lines not shown]
[lld-macho] Build the export trie by edges, not bytes (#234857)
Emit singleton suffixes directly and scan common prefixes in one pass,
avoiding repeated byte-wise partitioning. This speeds up builds that
emit large export tries.
Wall time with
[LinkerBench](https://github.com/int3/macho-linker-bench),
release build, assertions off. Median ± 95% CI over at least 20
interleaved
runs per side.
## M4 Mac mini (10 cores, 16 GB):
| Link | Exports | 10 threads | 1 thread |
| --- | ---: | ---: | ---: |
| rust-analyzer (debug) | 248,607 | 650.3 ± 1.2 → 625.4 ± 1.9 ms (−3.8%)
| 951.7 ± 0.9 → 870.3 ± 1.7 ms (−8.6%) |
| SourceKit-LSP | 105,359 | 604.2 ± 2.3 → 605.4 ± 1.6 ms | 774.5 ± 1.3 →
[13 lines not shown]
[SLP]Extract vectorized pointers used by vector loads
Blended loads, loads of extracted aggregates and loads with leading
poison lanes use scalar pointers directly, which get erased if they
are vectorized. Register them as external uses to replace all their
uses with the extracts.
Fixes #236177
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/236623
www/mod_sgi4: removed MOVED line now the port has been reintroduced
The port has been reintroduced, so this is no longer needed
and may break existing setups that have mod_wsgi4 installed.
Fixes: 0121f370d86ddea8411bacfb72961eecedbd163a
Approved by: clusteradm
[LoongArch] Compute known bits and sign bits for BSTRINS/BSTRPICK (#233738)
BSTRINS and BSTRPICK are formed early by DAG combines, so the generic
known-bits and sign-bits analyses see them as opaque target nodes. When
such a value is live out of a block, its LiveOutInfo is lost and PHIs
merging it can no longer prove that the value is already sign- or
zero-extended, leaving redundant addi.w/bstrpick.d behind.
This is common in Rust code decoding UTF-8, e.g. `str::chars().rev()`,
where the multi-byte path assembles the code point with bstrins.d and is
merged with the ASCII byte loaded by ld.b before an i32 compare.
rustc-perf svg-parse-1 on LA664: instructions -2.4%, cycles -1.7%.
ena: Retrieve RSS indirection table size from the device in ena-com
This patch allows the driver to create RSS indirection table with the
size advertised by the device.
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
ena: Fix ENA_MEM_FREE_COHERENT with an expression size argument
ENA_MEM_FREE_COHERENT() discards its size parameter with "(void)size".
A cast binds tighter than '*', so when the argument is an in-place
calculation the macro expands to ((void)(a)) * b, which fails to
compile with "void value not ignored as it ought to be".
Wrap the parameter in parentheses before casting it. No functional
change for existing callers, which all pass a plain variable.
Reviewed by: cperciva
MFC after: 3 days
Sponsored by: Amazon, Inc.
[PGO] Load GPU wave counts into IR metadata
GPU profiles contain wave counts alongside lane counts, but profile use
does not expose them to optimizations. Wave visits do not obey scalar
flow conservation, so unmeasured blocks cannot use counts reconstructed
from neighboring blocks or ordinary branch weights.
Map wave-counter indices to the blocks selected by PGO instrumentation,
after reproducing its critical-edge splits. For dense profiles, also map the
appended wave-only slots to eligible blocks in function order, after the
original block/select prefix. Select the layout from the profile flags.
Attach measured counts using wave.profile metadata, retaining measured
zeros and marking blocks without measurements unavailable. Require a
measured entry count for normalization and exclude select-counter slots
from the block mapping. Repeated instrumentation sites for the same block
represent one measurement and are not summed.
Validate the wave-counter layout against the accepted lane profile.
Clear old wave metadata when loading a replacement profile, including
[14 lines not shown]
amd64 FRED: normalize the user-provided 'fred' knob value
Assembler accesses 'fred' as byte, ensure that any non-zero
user-provided value works. This is pure cosmetics.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
amd64 resumectx(): restore FRED state before loading %cr4
%cr4 has the FRED enable bit. This only matters for NMI and #MC, and the
kernel is really not ready to handle them while in resumectx(), but do
it for formal correctness.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week