[AMDGPU] Price uniform constant loads by their dword count (#242550)
Drop the model of how legalization splits and widens a scalar load whose
size is not a legal number of dwords. It is a lot of code for a few rare
shapes.
Addresses post-merge review in #238840
interfaces: small simplification on dhclient-script
Reorder the add_new_routes / add_new_alias in the TIMEOUT case
to be in the order that the average case above also uses.
[OpenMP] Compare ISA names when a selector requires more traits (#242465)
isStrictSubset compared ISA names only when both selectors required the
same number of traits. When the second selector required more, the first
was a strict subset even if the second didn't require its ISA names, so
with
```
#pragma omp metadirective when(device = {isa("sse")} : parallel) \
when(device = {isa("sse2")}, user = {condition(1)} : single)
```
both WHEN clauses score the same and SINGLE was selected, although
neither selector is a subset of the other and the first one should win.
Compare the ISA names before checking whether the count is strict.
Assisted with Copilot and Clause Opus 5.5.
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
[AArch64] Test inexact-match overlap WAW is not clustered(NFC) (#243900)
Currently we only cluster exact-match WAW. Add a missing representative
tests that we dont cluster inexact overlap. AES requires FPR128 so it
cannot be easily tested.
[CalcSpillWeights] Do not rematerialize a partial definition (#238431)
Do not rematerialize a partial, non-undef, subregister definition. The
problem is that this type of instruction reads the other subregisters.
If this instruction is rematerialized, then those other subregisters may
be undefined at the rematerialization point. When this happens a
verifier error reports that the instruction contains undefined values.
This patch fixes the issue by not allowing a partial def to be
rematerialized.
[mlir][sroa] Skip forward-slice and toposort when no blocking uses exist (NFC) (#243437)
In MLIR's SROA pass, `computeDestructuringInfo` unconditionally calls
`mlir::getForwardSlice` on every destructurable slot, and
`destructureSlot` unconditionally calls `mlir::topologicalSort` on
`usersToRewire`. Because `mlir::topologicalSort` walks every operation
in the enclosing block, running SROA on large single-block modules with
many destructurable slots scales quadratically in the number of
operations.
This PR:
- Returns early from `computeDestructuringInfo` when
`userToBlockingUses` is empty, since the forward-slice loop skips every
operation absent from `userToBlockingUses`.
- Skips `mlir::topologicalSort` in `destructureSlot` when
`userToBlockingUses` is empty and no rewired accessor owns regions;
topological order is only required when promoting blocking uses (which
relies on erasing users before defs) or when region-bearing accessors
may nest other accessors.
[6 lines not shown]
Bitstream: Read fields with unaligned word loads (#243616)
Instead of buffering a word in CurWord and refilling it when a field
crosses a word boundary, track only the current bit number and read
each field from a word loaded at its first byte. Fall back to reading
a byte at a time near the end of the stream.
Parsing CTMark bitcode with opt -passes=verify executes 0.14-0.43%
fewer instructions. On kimwitu++ k.bc and sqlite3, cycles drop 2.3%
and 2.4%, and branch misses drop 12% and 10%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
interfaces: flatten the successful TIMEOUT branch #11231
The ping may not always go through. The lease life cycle
changes by assuming it is valid, but connectivity should
only be positively impacted by this.
While here remove the sleep and suprious inline exit. The newwanip
should keep the force this we could enter this condition after a cold
boot as long as the lease is still valid on paper.
Suggested by: @firestrife23
BPF: Fix the address of a block of another function
This was looking up every block address in a map of blocks of the
function using it, which asserted for a block of another
function. These addresses may be passed around, even if a jump to it
would be undefined behavior. Load the label of these blocks instead of
building a jump table. A private table with such blocks is loaded as
data the same way.
This also fixes illegally modifying the IR in doFinalization where
unused tables were deleted from the IR. Skip emitting them instead,
unless referenced by code.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[WPD] Support speculative devirtualization with distributed ThinLTO (#243576)
Extend the speculative devirtualization support added for LTO in #233380
to support distributed ThinLTO, which doesn't see the new option. Do
this by recording the decision in the combined index, which is then
consulted for ThinLTO index-only WPD and works for both in-process and
distributed ThinLTO.
Assisted-by: Gemini
[libc][stdfix] Fix idiv for MIN / -EPS (#241529)
Fixes #241528
`fixed_point::idiv` divided in `CompType`, which is as wide as the
storage type. For x = MIN and
y = -EPS the quotient is 2^(TOTAL_LEN - 1), which does not fit in
`CompType`: for 16-bit storage
(`idivr`) the division result was truncated when stored back into
`CompType`, so it returned -32768
instead of 32768; for 32-bit storage (`idivlr`) the division is
`INT32_MIN / -1`, which traps with
SIGFPE. In both cases the exact quotient fits in the return type (`int`,
`long int`), so the result is
well defined.
Divide in a wider type (`int64_t`/`uint64_t` for storage narrower than
64 bits, `Int128`/`UInt128`
for 64-bit storage).
[15 lines not shown]
Internalize: Preserve the function analysis manager proxy (#243895)
InternalizePass only changes the linkage, visibility and comdats of
globals which don't matter to any function analysis. Every function
analysis was discarded, including TargetTransformInfo. AMDGPU runs it
at the start of the pipeline for -amdgpu-internalize-symbols, but
CTMark does not. A sample of ROCm bitcode files improves by -0.09%
(geomean).
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Clang][CFI] Use EmitVTableCheck for llvm.type.checked.load (#241646)
Non-trapping `cfi-vcall` reported a failed `llvm.type.checked.load`
(used with `-fvirtual-function-elimination`) with a bare `EmitCheck`:
the diagnostic handler got no arguments and printed no report, and
cross-DSO CFI never called `__cfi_slowpath_diag`.
Report it with `EmitVTableCheck`, like the `llvm.type.test` path.
Checked loads without a check no longer get `!nosanitize`.
This is an existing issue, but only `-fvirtual-function-elimination`
builds hit it now. #241647 moves all non-trapping `cfi-vcall` with
`-fwhole-program-vtables` to this path, which would expose it much more.
Assisted-by: Gemini
Co-authored-by: Benedict Schlüter <bschlueter at google.com>
[lldb-server] Honor LLDB_LAUNCH_FLAG_USE_PIPES for command-line launches (#243792)
The test suite sets `LLDB_LAUNCH_FLAG_USE_PIPES` so that Windows
inferiors get anonymous pipes instead of a `ConPTY`.
`TestPlatformConnect.py` does not honor that flag because
lldb-server.exe is started via the command line.
This patch makes the command line launch honor
`LLDB_LAUNCH_FLAG_USE_PIPES` like the client does.
rdar://191148941
[NFC][Clang][ubsan] Rename BackupT/T in EmitCheckTypeDescriptor (#242168)
Keep T for the original QualType and name the unwrapped enum type
UnderlyingT, as suggested in review.
Follow-up to #216460.
Assisted-by: Gemini
[mlir][SPIR-V] Fix leak in SPIRVToLLVM module conversion on rollback (#243742)
ModuleConversionPattern created the module with ModuleOp::create, which
adds a body block, and then erased that block. When the conversion is
rolled back, the block is never deleted. This leak shows up on sanitizer
bots since #242805 added a test where the conversion fails.
Create the module with an empty body region instead.
Assisted-by: Gemini
[Flang] Evaluate loop bounds once for implied do loops (#242450)
Follow up work from: https://github.com/llvm/llvm-project/pull/238923
The implied do loop collapse optimization evalulated the loop bounds
three times: (trip count, section triplet, and the do-variable's final
value).
In this PR the loop bounds are now evaluated only once and are reused
for the above cases.
Assisted-by: Opus 5.5