[flang][OpenACC] Remove unused members in AccAttributeVisitor (NFC) (#246530)
dataMappingAttributeFlags was added on July 26, 2020 in commit
ff25b2da2ab9049e154cc8b9af06a24f79a74209 without any readers.
accDataMvtFlags was added on June 28, 2023 in commit
eeba037e0bb6bf0686eca73f4b4cf5eaf573499b without any readers.
Assisted-by: Antigravity
[flang] Reject interface name declared by a later PROCEDURE statement (#232928)
C1515 requires that a name used as a procedure interface, when it is
itself declared by a procedure declaration statement, be declared before
that use. Name resolution creates a placeholder symbol for a forward
reference and only checks it after the whole specification part, by
which point the later PROCEDURE statement has given it an explicit
interface, so the program was accepted.
In the deferred check, report an error when the interface name resolves
to a procedure entity whose declaration comes after the use. Forward
references to interface bodies and module procedures are still accepted.
Fixes #229229
rtwn: move rtwn_get_qmap + write register to rtwn_set_qmap
Upcoming chipset support changes the definition of the register.
So instead of having the abstraction be "return the qmap to write
to the register", change it to "set the qmap however the chipset
wants it to be."
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D61928
Tested on: RTL8821AU (adrian)
[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 subtargets with packed FP32 ops (gfx90a,
gfx942, gfx950):
V_PK_{ADD,FMA,MUL}_F32, V_PK_MOV_B32.
[3 lines not shown]
[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
[SelectionDAG] Use target boolean for all-true leaf in convertMaskTree (#246219)
convertMaskTreeImpl, used by WidenVSELECTMask, materialized an all-ones
BUILD_VECTOR leaf with getAllOnesConstant. That is only a valid "true"
for ZeroOrNegativeOne vector booleans. On targets using ZeroOrOne vector
booleans, such as SPARC, the -1 later leaked into the result, e.g.
select(shuffle(a < b, true), 1, 0) returned -1 in the lanes coming from
the constant-true operand.
Use getBoolConstant instead. The resulting constant is still invariant
under sign-extend/truncate, so the leaf stays type-lenient.
Fixes #244589
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[flang] Fix FIR alias analysis of arrays of derived types (#245359)
The composite rule in fir::AliasAnalysis::alias makes the address of a
derived type object alias the descriptor of an allocatable or pointer
component in it. It recognized only references to scalar derived type
objects. An array of such objects, the descriptor value of one, or a
polymorphic object did not alias the descriptor of a component of an
element. A call taking the array was then NoModRef for that descriptor,
and LICM hoisted a load of the descriptor out of a loop across the call.
The rule for pointer dummy arguments had the same gap.
Use a predicate that accepts all of them. Since descriptor values are
now covered, the data of an allocatable or pointer array would alias its
own descriptor, which would add temporaries to FORALL pointer
assignments. With the predicate alone, two existing tests in flang/test
fail that way:
- HLFIR/order_assignments/forall-pointer-assignment-scheduling.f90:
test_no_conflict and test_null_no_conflict assign a pointer component of
[19 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] 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.