[Github] Run generic-llvm-libc against libc changes (#234440)
libc changes have been breaking the libc++ tests reasonably often, so
run the generic-llvm-libc CI job on libc changes to ensure things do not
get broken premerge. This job typically runs in <20 minutes so shouldn't
be too interruptive.
[Analysis] Declare command line options in TableGen (#236489)
Port the file-local options of llvm/lib/Analysis to a per-LLVMContext
AnalysisOptions struct. These remain cl::opt: exported options, options
read by public APIs without IR context (getInlineParams, TTI getters,
InlineConstants::getInstrCost, generateParamAccessSummary), and options
read per query without an object to bind them (ValueTracking,
ConstantFolding, CFG reachability, ObjectSizeOffsetVisitor, TBAA,
ScopedNoAliasAA).
* Option-reading classes hold `const AnalysisOptions &`; the inline
constructors of BasicAAResult, MemoryDependenceResults,
DependenceInfo, MemoryDepChecker, RuntimePointerChecking,
InterleavedAccessInfo and ProfileSummaryInfo move out of line, and
InterleavedAccessInfo::isStrided becomes non-static.
* Rename -disable-gep-const-evaluation and
-da-disable-delinearization-checks to positive spellings; the old ones
remain aliases.
* The inline cost annotation printer no longer sets
[2 lines not shown]
[SandboxVec][LoadStoreVec] Vectorize store chains whose loads have external uses
vectorizeStores() used to give up on a load-store chain if any of the
loads had a user other than its store. Now that loads of mixed types
can be unpacked from a vector load, vectorize such chains as well: the
loads become a single vector load, and the external users are fed from
the lanes each load occupies, cast back to the load's type if needed.
The unpacking loop of vectorizeLoads() is factored out into
unpackLoads() (along with the canUnpackLoads() check) and shared by
both paths. Chains with a non-integral pointer load that has external
users are still left alone.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[SandboxVec][LoadStoreVec] Support mixed-type load vectorization
Remove the restriction that every load in a top-level load chain must
have the vector's element type. A chain of mixed types such as
{i32, float} or {double, i32, i32} is loaded as a vector of integers
(as chosen by VecUtils::getCombinedVectorTypeFor()), each original load
is unpacked from the lanes it occupies, and then reinterpreted back to
its own type with Reinterpret::reinterpretValue().
Chains involving a non-integral pointer are left alone, since such a
pointer cannot be recovered from an integer lane.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[SandboxVec][LoadStoreVec] Add Reinterpret helper for same-size type casts
Replace getEquivalentConstantWithType() with a Reinterpret utility that
reinterprets the bits of a value as another type of the same size. It
builds a chain of ptrtoint / bitcast / inttoptr casts, and applies it
either to a constant (folding) or to a runtime value (inserting casts).
The runtime form will be used to unpack mixed-type vector loads and to
pack mixed-type store operands.
Also add VecUtils::isNonIntegralPtr(). A non-integral pointer has no
stable integer representation, so it is no longer packed into an
integer lane. Previously only a non-integral destination type was
rejected (via an assert), while a non-integral source such as
'ptr addrspace(5) null' was silently converted with ptrtoint.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[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.