[AArch64][GlobalISel] Turn ANDs that clear a single lane into an insert of zero (#240841)
A vector G_AND whose constant mask keeps every lane except one is an
insert of zero into that lane, which selects to a single `mov v.<T>[i],
wzr` (or `xzr` for 64-bit lanes). This handles all vector sizes, and
skips ANDs feeding a G_OR, which are better matched as a bitwise select.
The constant mask is expected on the RHS, where constants are
canonicalized.
| mask | before | after (same as SelectionDAG) |
|---|---|---|
| `<2 x i32>` clear lane 1 | `movi` + `and` | `mov v0.s[1], wzr` |
| `<4 x i32>` clear lane 2 | `adrp` + `ldr` + `and` | `mov v0.s[2], wzr`
|
| `<2 x i64>` clear lane 1 | `adrp` + `ldr` + `and` | `mov v0.d[1], xzr`
|
| `<8 x i16>` clear lane 3 | `adrp` + `ldr` + `and` | `mov v0.h[3], wzr`
|
| `<16 x i8>` clear lane 5 | `adrp` + `ldr` + `and` | `mov v0.b[5], wzr`
[7 lines not shown]
[mlir][LLVM] Add an inherent strictfp attribute to intrinsic ops
The strictfp call-site attribute tells LLVM that a call sits in a scope with
strict floating-point semantics. The llvm.intr.* operations could not carry
it.
They now have an optional `strictfp` unit attribute. The feature class
LLVM_IntrStrictfp adds it, and LLVM_IntrOp inherits the class. The export
sets the attribute on the call and the import reads it back. Both are code
of the feature class, so the hand-written builders splice it like the code
of the other features and the translation needs no special case.
The constrained and the debug intrinsics derive from the new
LLVM_IntrOpNoStrictfp and do not have the attribute. A constrained call is
always strictfp, and a debug intrinsic is no call.
Assembly formats without prop-dict print the attribute as the keyword
`strictfp`. 112 of the operations had no attribute before. They now have
properties, which deprecates their builders that take the operands as one
[3 lines not shown]
[AMDGPU] Pre-commit gfx125x VALU completion pipe tests
Record current expert-scheduling waits before updating the gfx125x VALU completion pipe classifications.
Assisted-by: Claude Fable 5.2, Claude Opus 5.5, Codex
[AMDGPU] Classify gfx125x VALU completion pipes for expert scheduling
VA_VDST decrements in issue order only among VALU instructions that
complete on the same pipe. The expert scheduling classification did not
match the MI400 documentation in several places:
- 64-bit transcendentals complete with the DP-MACC, not with the 16-bit
and 32-bit transcendentals.
- More instructions complete on the DP-MACC: conversions to f64,
v_fmac/fmaak/fmamk_f64, 64-bit min/max, v_mul_u64, packed f64 and
v_wmma_f64_16x16x4_f64.
- 32-bit multiplies, 64-bit shifts, adds, moves and 64-bit compares
complete on the side MACC on gfx1250 and on the DP-MACC on gfx1251.
Add a subtarget feature for the former. gfx12-5-generic has to be
valid for both, so it gets no order for them. 64-bit integer V_CMPX
uses the side MACC on both.
- DOT4 and DOT8 use the side MACC, not the XDL pipe.
Add an unordered class for instructions without a usable order. A
[9 lines not shown]
[PowerPC][XRay][test] Add CR-bit and CTR conditional return tests (#247294)
The if-converter predicates a return on a single CR bit (BCLR/BCLRn)
or on CTR (BDZLR8/BDNZLR8). PATCHABLE_RET emits these as bare bclr,
bdzlr and bdnzlr, so the function exit is not instrumented, and
getInstSizeInBytes reports a full sled for them, which the object
emitter's size check rejects on assertions builds.
Assisted-by: Claude Code
[llvm-mca][X86] Add Key Locker (KL/WideKL) resource tests (#246849)
Add llvm-mca resource tests for the Key Locker (KL) and Wide Key Locker
(WideKL) instructions.
Fixes #246666
AI assistance was used to help draft the test inputs and to run the
build and test commands. The CHECK lines were generated with
`update_mca_test_checks.py`, and I reviewed the inputs and the output.
[InstCombine] Fix phi slicing for inputs defined by a terminator (#248106)
`SliceUpIllegalIntegerPHI` splits a phi of an illegal integer type into
smaller phis. It inserts a trunc of each incoming value at the end of
the incoming block, before its terminator. When the incoming value is
the result of that terminator, the trunc uses it before it is defined.
The verifier rejects this and without verification the `asm goto` code
in the issue reads a stale register.
The function already bailed out for this case but only for `invoke`.
This makes the check cover any terminator, so `callbr` is handled too.
It is the same problem as #247678, in a different function.
Fixes #248039
Assisted-by: Claude Code (Opus 5.5)
AddressSanitizer: Declare runtime functions with RuntimeLibcallsInfo
Declare the asan runtime functions with RuntimeLibcallsInfo, so they
get the signatures and attributes from the libcall definitions. The
ELF globals registration functions are only declared for ELF targets,
which are the only users.
It is now an error to run the pass for a target that does not provide
the asan runtime. Tests with no triple, or a triple without an OS, now
use a Linux triple.
The experiment report functions are only used by a hidden testing
option, so keep declaring them by name and drop their RuntimeLibcalls
entries.
The kind of hacky part of this is the pass is now reasoning directly
in terms of LibcallImpl, instead of looking up the LibcallImpl from
the Libcall. This is because at the moment non-codegen passes don't
have a simple way of using LibcallLoweringInfo. There arguably should
[4 lines not shown]
[AMDGPU] Classify gfx125x VALU completion pipes for expert scheduling
VA_VDST decrements in issue order only among VALU instructions that
complete on the same pipe. The expert scheduling classification did not
match the MI400 documentation in several places:
- 64-bit transcendentals complete with the DP-MACC, not with the 16-bit
and 32-bit transcendentals.
- More instructions complete on the DP-MACC: conversions to f64,
v_fmac/fmaak/fmamk_f64, 64-bit min/max, v_mul_u64, packed f64 and
v_wmma_f64_16x16x4_f64.
- 32-bit multiplies, 64-bit shifts, adds, moves and 64-bit compares
complete on the side MACC on gfx1250 and on the DP-MACC on gfx1251.
Add a subtarget feature for the former. gfx12-5-generic has to be
valid for both, so it gets no order for them. 64-bit integer V_CMPX
uses the side MACC on both.
- DOT4 and DOT8 use the side MACC, not the XDL pipe.
Add an unordered class for instructions without a usable order. A
[8 lines not shown]
Add explicit map for lastprivate value
Add explicit map for lastprivate scalar value to allow copy back due to
missing implicit map (known issue #49496).
[clang][OpenMP] Emit lastprivate final copies in no-loop kernels
Promotion rejected lastprivate because the no-loop branch leaves the
worksharing path before it privatizes or copies out, so the clause would
have been silently dropped.
Privatize the non-counter variables in the parallel region and copy them
out under the last iteration that applyWorkshareLoop publishes, forcing
the exit barrier the copy reads through. Loop counters stay at the
distribute level and reach EmitOMPSimdFinal.
[llvm-cov] Warn when an object file is passed as a source file (#243524)
Only the first positional argument to llvm-cov show/report/export is an
object; the rest are source files. This makes it easy to accidentally
pass objects as sources.
This patch adds a warning when a positional source argument has a magic
number that looks like an object. This is only applied to arguments
named directly on the command line; files found by scanning a directory
aren't checked, so passing a large source tree doesn't incur extra
overhead.
Assisted-by: claude
AMDGPU: Resolve VALU hazards at SI_RETURN_TO_EPILOG on gfx11
The shader part after SI_RETURN_TO_EPILOG is compiled separately and
assumes no outstanding VALU writes, so VALU forwarding hazards across
the boundary were missed. Insert s_waitcnt_depctr va_vdst(0) before
the return. Mesa currently conservatively hacks in this wait when
linking shader parts.
Assisted-by: Claude
[Offload][L0] Copy a single slice as a 2D region (#246571)
For a 3D copy with a depth of one, add the z offsets to the source and
destination pointers and pass a z origin of zero to
zeCommandListAppendMemoryCopyRegion, instead of passing a nonzero z
origin with a depth of one.
Assisted by Claude.
---------
Co-authored-by: blazej-smorawski <blazej.smorawski at intel.com>
[ValueTracking] Limit compare analysis to integer types (#239757)
Fix bug introduced in https://github.com/llvm/llvm-project/pull/237661.
Improving KnownBits by doing compare analysis must not be done on fat
pointers since compares on them only test address bits and provide no
information on non-address bits. Fix by limiting analysis to integers.
Also do not analyze ICMP_NE since it provides almost no information.
---------
Signed-off-by: John Lu <John.Lu at amd.com>
[lldb] Show the stub's error string on failed memory access (#247810)
A stub that supports QEnableErrorStrings can say why a memory read or
write failed by replying `Exx;<hex text>`. ProcessGDBRemote dropped the
text and reported only the address. Append it to the error:
```
memory read failed for 0x1000: no such region
```
A bare `Exx` reply keeps the current message.
rdar://193043790
Assisted-by: Claude
loader.efi: Measure boot policy and loaded contents with a TPM
Use the EFI TCG2 protocol, or the legacy TCG protocol on TPM 1.2
firmware, to extend the loader PCRs and record EV_IPL events in the
firmware event log.
Extend PCR 8 with the final kernel environment and the type, name, and
arguments of each loaded boot input. Prefix both record types with
versioned, NUL-terminated domain strings. These make the records
self-identifying and define an explicit measured policy encoding. Store
the complete measured pre-images in the event data so attestation and
diagnostic tools can audit the values without an out of band copy.
Extend PCR 9 with the initialized contents of kernels, modules, and raw
boot inputs, but record only descriptive labels rather than copying file
contents into the event log.
The Lua module table has no defined traversal order. Retain content
ranges as loader-private metadata, then sort the final file list before
[32 lines not shown]