Add PISA codegen pipeline and lowering passes
Add the IR- and MIR-level passes that make up the PISA code generation
pipeline and wire them into PISAPassConfig in PISATargetMachine:
- Intrinsic handling: PISAEmitIntrinsics, PISAExpandIntrinsics,
PISAReplaceIntrinsics
- Call/ABI lowering: PISALegalizeCalls, PISAKernelByValArgsLowering
- IR preparation: PISAPropagateNullPointers, PISALayout, PISAConstProp
- Legalization/verification: PISALegalizePredicates, PISAVerifyTypes,
PISAVerifier
- Post-selection: PISAScopeSelector, PISACacheHintSelector,
PISALegalizeSubregAccess, PISAOptimizeSubregAccess,
PISAOptimizeRedundantCopies, PISAMarkConvergentNoMerge,
PISAInsertLifetimeStart
PISAPassConfig now overrides the GlobalISel and pre/post-regalloc hooks
to run these passes, disables the machine passes that assume physical
registers, and runs the load/store vectorizer and atomic expansion in
[4 lines not shown]
[AMDGPU] Fold integer wmma with zero multiplicand to the accumulator (#247931)
For integer wmma and swmmac, $A \times 0 + C = C$, so if A or B is zero
the result is just C. The sign or neg modifiers, clamp, reuse hints and
sparsity index cannot change this, because the product is zero and C
cannot overflow.
```llvm
%r = call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x64.iu8.v8i32.v8i32(i1 0, <8 x i32> %a, i1 0, <8 x i32> zeroinitializer, <8 x i32> %c, i1 0, i1 0, i1 1)
-->
%r = %c
```
Floating point variants are not folded, since $0 \times \infty$ and $0
\times \mathrm{NaN}$ give NaN and $-0.0 + 0.0 = +0.0$.
netipsec: Requeue a nested IPsec header on IPv6 input
In transport mode ipsec6_common_input_cb() delivers the packet itself,
on the stack of the crypto callback that called it. With a synchronous
crypto driver that is the stack of the thread that dispatched the
request. Since 3cd5f1b307ad the callback hands a further AH, ESP or
IPComp header to ipsec_common_input() from there, so the transform, its
callback and the next delivery all ran below the first one. Every
nested header added a set of frames and only the size of the packet
limited their number. IPComp carries no authentication and
ipcomp_input() only refuses an IPComp header that is directly followed
by another, so anyone who could reach a host with an IPv6 IPComp SA
could overflow the kernel stack with one packet that hides each IPComp
header behind a destination options header.
Requeue the packet to the IPv6 netisr instead, as the IPv4 callback
does for every transport mode packet, and let ip6_input() hand the
header over from a fresh stack. ip6_input() refuses addresses in the
embedded scope form that its first pass left behind, so put them back
[19 lines not shown]
[X86][APX] Print explicit $1 for NDD shift/rotate by 1 (#181565)
The NDD shift/rotate by 1 instructions were printed without the
immediate, e.g. "shlw %ax, %bx". GNU as rejects this with "operand type
mismatch", so -mapxf -no-integrated-as produced assembly binutils
couldn't assemble.
Print them as "shlw $1, %ax, %bx" ("shl bx, ax, 1" in Intel syntax),
which is what binutils prints and accepts. This also removes the
ambiguity between "shlb %cl, %al" as 8r1_ND and as 8rCL, so 8r1_ND and
8r1_NF_ND no longer need to be DisassembleOnly.
The two-operand spelling is still accepted by the assembler through
InstAliases, except for the 8-bit register forms where it would be
ambiguous with the shift by %cl.
Fixes #181553
[AMDGPU] Keep execz skips over pending WMMA co-execution hazards (#245431)
On gfx1250 the hazard recognizer resolves XDL WMMA co-execution hazards
by counting intervening VALUs. VALUs skipped because EXEC = 0 do not
issue and do not resolve the hazard. SIPreEmitPeephole runs before the
hazard recognizer and removes short s_cbranch_execz skips, so a VALU
region that may run with EXEC = 0 ends up counted toward the hazard and
no V_NOPs are inserted before a later use of the WMMA result.
Revert "[Clang][Sema] Add fortify warnings for getlogin_r, ttyname_r, ptsname_r, and confstr (#244704)" (#248276)
Reverts llvm/llvm-project#244704
(`8964a284801acee5924c2b546ecb598e2b087f92`).
Registering `getlogin_r` as a typed `GNULibBuiltin` broke building
`busybox-w32` on `i686-w64-mingw32`, where `getlogin_r` is polyfilled
with `__attribute__((regparm(3),stdcall))`, triggering a
`-Wignored-attributes` warning (stripping `stdcall`) and an
`err_regparm_mismatch` hard error in `Sema::MergeFunctionDecl` (see
https://github.com/llvm/llvm-project/pull/244704#issuecomment-7359463527
and https://github.com/rmyorston/busybox-w32/issues/631).
Will reland after fixing `Sema::MergeFunctionDecl` to warn and avoid
treating the declaration as a builtin on calling-convention / `regparm`
mismatches against implicit predefined library builtins.
cc @nickdesaulniers @mstorsjo @efriedma-quic @llvm/android-maintainers
libthr: fix libc spinlock initialization
Publish thr_extra with a release store only after _thr_umutex_init()
and read it with an acquire load, so that a thread racing the first use
of a libc spinlock cannot lock the umutex before it is initialized.
PR: 301407
Fixes: bddd24cd9c3e ("Replace internal usage of struct umtx with umutex which can ...")
Reviewed by: kib
MFC after: 1 week
security/boringssl: update to the recent snapshot
Introduce DISABLE_DEATHTESTS option that disables death tests
(core dumped) on FreeBSD. Please visit for details:
https://issues.chromium.org/issues/584386506
[SPIR-V] Lower freeze of undef/poison to OpConstantNull (#247456)
Without SPV_KHR_poison_freeze, selectFreeze is meant to lower a freeze
of a statically undefined value to OpConstantNull. It only matched an
operand defined by an ASSIGN_TYPE of a G_IMPLICIT_DEF or by an OpUndef.
However, a scalar or vector undef/poison reaches instruction selection
as a bare G_IMPLICIT_DEF, and an aggregate one as the spv_undef
intrinsic. Both fell through to the COPY path, so the OpUndef itself was
returned, and its value could differ at every use. For example, freeze
followed by xor %y, %y could be non-zero.
This adds cases for a bare G_IMPLICIT_DEF and for the spv_undef
intrinsic, both using the result type for the OpConstantNull.
freeze.ll already had the scalar cases (test_nil1, test_nil2) but didn't
check their return values. It now checks that both return an
OpConstantNull, and adds tests for vector, struct and array freeze. The
two OpUndef checks for i32 and float are removed, since those values are
no longer emitted.
Fixes #247428.
[MemProf] Skip matching constant 0 hints in MemProfUse (#248231)
When -memprof-match-hot-cold-new is enabled with
-optimize-existing-hot-cold-new=cold and
-min-existing-hot-cold-new-hint,
MemProfUse previously matched allocation profiles onto existing hot/cold
operator new calls whose hint was already a compile-time constant 0.
Taking the minimum with any compiler hint leaves 0 unchanged, so
matching
these calls only triggers no-op ThinLTO cloning and unnecessary hot text
growth.
Skip existing hot/cold operator new calls in
isAllocationWithHotColdVariant when the hint argument is a compile-time
constant 0, while continuing to match non-zero constant hints and
dynamic
runtime hints.
Assisted-by: Antigravity