[AMDGPU] Fix gfx950/gfx942 TRANS co-execute slot
On gfx950/gfx942, fix TRANS co-exec slot to be same as VALU.
Excluded from this commit:
TRANS on gfx950 (in unit of hardware cycle):
Reciprocal throughput (per SIMD):
f32/f16: 8
f64: 16
Def-to-use latency:
f32/f16: 12 to a non-TRANS reader, 8 to a TRANS reader
f64: 20 to a non-TRANS reader, 16 to a TRANS reader
Blocks this wave's issue for:
f32/f16: 8
f64: 16
On gfx942, f32/f16 have the same numbers as f64 above.
Currently, GCNHazardRecognizer inserts the correct s_nop between a TRANS
[4 lines not shown]
[AMDGPU] Precommit TRANS co-exec tests (NFC)
Add a gfx950 coexec scheduler case where a v_exp_f32 and a v_add_f32
compete for the window of an XDL2x (v_mfma_f32_16x16x32_bf16) MFMA.
No MFMA row allows TRANS so far, so the v_exp_f32 issues after the
MFMA window.
Assisted-by: Claude Opus 5.5
[AMDGPU] Fix gfx950/gfx942 v_pk f32 instr co-exec slot
On gfx950/gfx942, v_pk f32 instrs can issue only after the MFMA's own
cycles (in hardware cycles):
XDL/SMFMAC: 8 cycles
XDL2x/SMFMAC2x: 12 cycles
SGEMM/DGEMM: 8 cycles
Currently they are categorized as VALU. This is wrong for
XDL/SMFMAC/XDL2x/SMFMAC2x, since VALU can issue within the MFMA's own
cycles.
Fix this by adding a PK_F32 CoExecMask bit, a PK_F32 slot in each MFMA
row, and a PackedF32VALU InstructionFlavor. Classify the following
instrs as PackedF32VALU on gfx942/gfx950:
V_PK_{ADD,FMA,MUL}_F32, V_PK_MOV_B32.
NFC for gfx1250.
[2 lines not shown]
[AMDGPU] Precommit packed F32 co-exec tests (NFC)
Add a gfx950 coexec scheduler case where a v_pk_add_f32 and a v_add_f32
compete for the window of an XDL2x (v_mfma_f32_16x16x32_bf16) MFMA, and
a unit test for the co-execution class of the packed F32 instructions
and v_pk_add_f16. Packed F32 VALU is treated as plain VALU so far.
Assisted-by: Claude Opus 5.5
[AMDGPU] Add MFMA co-exec rows for gfx942 MFMAs
Add MFMA co-exec rows for gfx942 MFMAs for both gfx942 and gfx950.
Gfx950 support gfx942 mfma opcodes as well as others.
Add rows for:
XDL_2Pass:
v_mfma_f32_4x4x4_16b_{f16,bf16}
v_mfma_i32_4x4x4_16b_i8
XDL_4Pass:
v_mfma_f32_16x16x16_{f16,bf16}
v_mfma_i32_16x16x32_i8
v_mfma_f32_16x16x8_xf32 (gfx942 only)
v_mfma_f32_16x16x32_{bf8,fp8}_{bf8,fp8}
XDL_8Pass:
v_mfma_f32_16x16x4_4b_{f16,bf16}
[43 lines not shown]
[AMDGPU] Precommit legacy MFMA co-exec tests (NFC)
Add coexec scheduler cases for a gfx940 SMFMAC
(v_smfmac_f32_16x16x32_f16) on gfx950 and for a DGEMM
(v_mfma_f64_16x16x4_f64) on gfx942 and gfx950, a gfx942 RUN line in
coexec-sched-warning.mir, and unit test rows for one MFMA per legacy
variant on gfx950 plus v_mfma_f64_16x16x4_f64 on gfx942.
The legacy variants fall back to a permissive window that lets anything
co-execute. v_mfma_f64_16x16x4_f64 uses its gfx950 rule on gfx942 as
well, and gfx942 does not enable the co-exec model yet, so it warns and
its scheduler case runs without the model.
Assisted-by: Claude Opus 5.5
[AMDGPU] Fix gfx950 MFMA co-exec rows for XDL2x_8Pass, SMFMAC2x, DGEMM
Fix the co-exec rows for the following instructions:
XDL2x_8Pass:
v_mfma_f32_32x32x16_f16
v_mfma_f32_32x32x16_bf16
v_mfma_i32_32x32x32_i8
v_mfma_f32_32x32x64_f8f6f4 and v_mfma_scale_f32_32x32x64_f8f6f4
with no fp8/bf8 operand
SMFMAC2x_4Pass:
v_smfmac_f32_16x16x64_f16
v_smfmac_f32_16x16x64_bf16
v_smfmac_i32_16x16x128_i8
v_smfmac_f32_16x16x128_{bf8,fp8}_{bf8,fp8}
SMFMAC2x_8Pass:
v_smfmac_f32_32x32x32_f16
[8 lines not shown]
[AMDGPU] Precommit gfx950 MFMA co-exec row tests (NFC)
Add a gfx950 coexec scheduler case for v_smfmac_f32_16x16x64_f16, and a
unit test that checks the first co-exec stage of SALU, DS and VMEM, VALU
and the next MFMA for one MFMA per gfx950 variant.
Assisted-by: Claude Opus 5.5
[AMDGPU] Describe MFMAs with a variant in MAIInstInfoTable (NFC)
- Add an MFMAVariant enum. Each MFMA pseudo gets its variant from
MAIInstInfoTable, a TableGen GenericTable. Each real MFMA opcode
inherits the variant of its pseudo through VOP3P_Real.
- Look up an MFMA's co-execution info by its variant, as gfx1250 does
for WMMA, instead of matching every opcode.
- Replace the is_dgemm and is_gfx940_xdl fields with the variant.
- Describe each MFMA row by the first stage at which SALU, memory, VALU
and the next MFMA may issue, plus the window length.
Assisted-by: Claude Opus 5.5
[AMDGPU] Exclude real V_ACCVGPR_READ/WRITE_B32_vi opcodes from isMFMA
Currently, only pseudo V_ACCVGPR_{READ,WRITE}_B32_e64 is excluded, fix
by also exclude real V_ACCVGPR_READ/WRITE_B32_vi.
[RISCV] Avoid pairing QCI interrupt hardware-saved registers (#246249)
Zilsd CSR coalescing replaces QCI hardware-saved registers with register
pairs that the fixed-slot logic no longer recognizes, causing redundant
spills and reloads.
This commit skips pairing for these registers while retaining it for
other CSRs.
AI Usage: Tests assisted by Gemini 4 Neon and Opus 5.5
Found this while working on
https://github.com/llvm/llvm-project/pull/238325
syslogd: Create one forwarding socket per address pair
For each address a forwarding destination resolves to,
make_forw_socket_array() creates a socket bound to the address of each
listening socket and connects it to the destination. The same
<laddr, raddr> pair can come up more than once for one rule: the
resolver may return an address twice, e.g. when a host name appears on
several /etc/hosts lines for one IP, and several listening sockets may
be bound to one address. connect() then fails with EADDRINUSE.
maybe_dup_forw_socket() only searches the rules parsed earlier, so the
casper process exits and syslogd dies with "Failed to xfer
configuration nvlist" on every start and reload.
Skip address pairs the rule already has a socket for. A second socket
would add nothing, and with -A it would send each message twice.
Reported by: Marcos Mendoza
Reviewed by: markj
Fixes: ae4f708f0b38 ("syslogd: Ensure that forwarded...")
[4 lines not shown]
HBSD: Apply style(9) to helper function
We provide a `jailed()` function in libjail to make it easier to
determine whether the calling code is running within a jailed context.
However, that function didn't follow style(9) too well.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
[CodeGen] Generalize scalarization of vector intrinsics to extra arguments (#237973)
This is a preparatory patch for #237980.
lowerUnaryVectorIntrinsicAsLoop only handled intrinsics with a single
vector argument. Generalize it into lowerVectorIntrinsicAsLoop, which
extracts only the vector arguments from the current lane and passes
scalar arguments through unchanged. This lets the helper handle
intrinsics like powi with a scalar exponent. #237980 adds scalable powi
lowering to the pre-ISel pass and includes the corresponding regression
tests.
While generalizing, fix the scalar return type used to look up the
scalar declaration. For multi-result intrinsics it previously passed the
vector struct type straight to Intrinsic::getOrInsertDeclaration, which
fails the signature check. Build a struct of the scalar element types
instead.
Assisted-by: Claude
HBSD: Fix setting hardening.prohibit_ptrace_capsicum as a jail param
I missed fetching the jail parameter upon jail creation. This commit
does just that.
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
Radicle-issue: 187e40515749fcb384935a2eeb24f0122e05eddb
Reported-by: 0x1eef
MFC-to: 15-STABLE
[RISCV][GISel] Replace hasStdExtA() with hasStdExtZalrsc(). (#246495)
SelectionDAG supports using only LR/SC instructions so we should do the
same in GISel.
Assisted-by: Claude
don't use builtins for LDBL defines on arm64 and riscv64
Match other archs and drop the ifdef and builtin use. Use the same
values as the clang builtins.
ok miod@ kettenis@
[SelectionDAG] Look through freeze in CombineExtLoad
Folding an extend of an illegally-wide vector into extending loads only
matched when the extend operand was the load itself. A boolean select is
combined to an OR of a frozen operand and the freeze is pushed down to the
load, so the fold was skipped: the load stayed a plain vector load and each
half of the widened result needed an extract and a register-form extend.
Look through a single-use freeze and re-apply it to the split result.
Freeze is element-wise and extends are deterministic, so freezing the split
loads is equivalent to freezing the extended value.
For the loop in #245064 this replaces four 512-bit loads with their extracts
and register-form vpmovzxwd by memory-form vpmovzxwd, going from 57 to 49
instructions per 128 elements.
Adds llvm/test/CodeGen/X86/vector-extload-freeze.ll and updates the
existing avx512-ext.ll checks.
Fixes #245064
tzcode: Avoid integer truncation resulting in wrong weekday
From a report[1] on the tz mailing list:
In timesub() the weekday is stored in (int) tm_wday before reduction
modulo seven (DAYSPERWEEK). Previously this could overflow a 32-bit
int, resulting in an incorrect weekday calculation.
Calculate two additional intermediate terms modulo seven to avoid an
intermediate value that does not fit in 32 bits.
We're committing this patch now so we can have something in place for
FreeBSD 15.2. If a different change is committed upstream we will
replace this.
[1] https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/O3RZGBKSO5GXBFDZKW2JXO3OQIIGYBF3/
Approved by: re (cperciva)
PR: 300977
[6 lines not shown]