[PowerPC] Enable SlotIndexes compaction by default
Greedy measures live ranges in slot indexes, and instructions erased
before allocation (by PHI elimination, two-address lowering and the
coalescer) leave entries behind that make ranges look longer than
they are. Opt PowerPC in to dropping them, as AMDGPU and ARM do, so
allocation works with real distances. Passing
-greedy-compact-slot-indexes=false restores the old behaviour.
On CTMark (pwr8, pwr10, AIX, ppc32), .text and llc compile time move
by less than 0.03% and evictions drop by 1.5-5.8%.
The test updates are register allocation changes; csr-split.ll gets
back the live range split it was written to check.
[RISCV] Fix RVV callee-saves in realigned frames
The prologue saves RVV callee-saved registers before it realigns SP
and sets up BP, but their slots were addressed from the realigned SP
or BP. The epilogue reloaded them from the wrong address, BP frames
stored them through the caller's s1, and their CFI was wrong.
Address these slots from FP, which does not move, and derive their
CFI from getFrameIndexReference so the two cannot diverge.
Fixes #244792
[RISCV] Add tests for RVV CSRs in realigned frames
Precommit the tests for #244792 so that its fix shows up as a diff.
The checks record the current, wrong output: the prologue saves the
vector callee-saved registers before it realigns the stack, and the
epilogue reloads them from a different address.
[lldb] Publish the attaching state before sending the attach request (#245632)
When attaching to a process that was connected before the attach (e.g.
`process connect` followed by `process attach --waitfor`), the private
state thread is already running, so Process::Attach has to publish
eStateAttaching itself. It only did so after
DoAttachToProcessWithName/ID returned, but by then the attach request
may already be on its way to the server.
TestAttachWaitConnected.py shows the resulting race:
1. The test calls SBTarget::Attach with a wait-for attach info.
Process::Attach calls DoAttachToProcessWithName, which hands the
vAttachWait packet to the gdb-remote async thread and returns.
2. The mock server receives vAttachWait, and the test immediately calls
SBProcess::SendAsyncInterrupt to cancel the attach.
3. Process::SendAsyncInterrupt sends eBroadcastBitInterrupt to the
[14 lines not shown]
[lld][MachO] Stream FunctionStartsSection from laid-out code sections (#247021)
Currently, `FunctionStartsSection::finalizeContents()` scans every
`ObjFile`'s full symbol table, resolves `defined->getVA()` for each live
code symbol, and sorts all addresses with `llvm::sort`.
By the time `FunctionStartsSection::finalizeContents()` runs, output
segments, their sections, and each `ConcatOutputSection`'s inputs are
already laid out in ascending virtual address order, and each input
section's `symbols` list is kept sorted by offset. This PR walks those
laid-out code sections directly.
To avoid calling `isCodeSection()` on every subsection, we add an
`isCodeSection(const Section &)` overload and cache its result across
consecutive inputs sharing the same originating `Section`. This targets
the common case where most subsections remain in their original input
order (even under an order file, non-code sections and unprioritized
code sections stay grouped by `Section`).
[13 lines not shown]
[CIR] Emit the object of an inherited static call operator
Sema converts the object argument of an inherited static operator() or
operator[] to the base class with a CK_NoOp cast, not a derived-to-base
conversion. emitCastLValue rejects a CK_NoOp that changes the record
type and reports errorNYI.
emitCall now drops that cast before emitting the object as an ignored
expression. The object is never read, so the cast has no effect on the
IR. emitCastLValue still rejects every other record-changing CK_NoOp.
This change does not handle CK_AddressSpaceConversion, which Sema uses
when the object is in a different address space.
libc++'s ranges::begin, ranges::end and ranges::data now inherit a
static operator() from std::_CPO. Without this change, 860 libc++ std/
tests fail to compile under -fclangir.
Assisted-by: Cursor / Claude Opus 5.5
xprt_verbs.c: Use the default fib# for route lookups
Without this patch, fib4_lookup()/fib6_lookup() are
called with the fib# for the current thread.
During a reconnect, this could be any thread, so use
the default fib# instead.
Reported by: llm-postcr
MFC after: 1 month
Fixes: 80bee4d83637 ("nfsclrdma: Add code to support client side NFS over RDMA")
[compiler-rt] Add Region-Encoded AddressSanitizer runtime
Host and device runtime for reasan, built on the sanitizer_common offload
layer. The common layer gains the HSA pieces reasan needs: pool and agent
queries, virtual memory reservation and sharing, code object enumeration,
cache publication, and device symbolization. The runtime keeps the
allocator, global aliasing, and report formatting. Each device begins on
its own metadata granule, so an entry load stays on the device that owns
the object.
The runtime follows ubsan's offload shape: HSA interceptors that report HSA
as absent when it is not loaded, a reasan-preinit archive, static and shared
runtimes, a receive-only RPC handler on SANITIZER_OFFLOAD_REASAN, and lit
tests on the common GPU substitutions. The report handlers elect the first
active lane, which is the first failing one, and take their return address
as the location of the access. Host checks call __reasan_report_load and
__reasan_report_store and take the caller's frame.
Fine-grain pools are placed only when the AMD extension honors pool flags
[5 lines not shown]
[Clang] Add -fsanitize=readdress for Region-Encoded AddressSanitizer
Wire the sanitizer through the driver, codegen, and preprocessor. Emit
sanitize_region_encoded_address, run the reasan pass, and link the reasan runtime
on AMDGPU offload and supported Linux hosts.
RFC: https://discourse.llvm.org/t/rfc-add-a-device-address-sanitizer-for-gpus-dasan/92710
[LLVM] Add RegionEncodedAddressSanitizer instrumentation pass
Instrument loads, stores, and memory intrinsics against reasan's
size-class metadata. The handler locates the access by its return
address, so each check calls a report of its own that is never merged,
inlined, or tail called. On AMDGPU, keep the dispatch pointer that
shared memory checks read, and preserve the __reasan_ entry points.
AMDGPU keeps one decode per inbounds root and selects the zero word for
an outside pointer, so the load can be hoisted and the wave does not
branch. Elsewhere an outside pointer is the common case, so membership
is a branch and the decode is its cold side. Global relocation defaults
to AMDGPU and follows -reasan-instrument-globals when set. The metadata
pointer uses the data layout's default globals address space.
RFC: https://discourse.llvm.org/t/rfc-add-a-device-address-sanitizer-for-gpus-dasan/92710
[IR] Add sanitize_region_encoded_address function attribute
Mark functions that should receive Region-Encoded AddressSanitizer checks,
matching the other sanitize_* attributes. Bitcode, LangRef, editor
syntax, and inliner compatibility rules are updated accordingly.
Speculative loads, non-local GVN load elimination, and hot/cold
splitting are suppressed under it, as they are for sanitize_address.
RFC: https://discourse.llvm.org/t/rfc-add-a-device-address-sanitizer-for-gpus-dasan/92710