Skip to content

Commit

Permalink
[AMDGPU] Fix predicates for V_DOT instructions. (#78198)
Browse files Browse the repository at this point in the history
Resolves AsmParser ambiguities, e.g., between V_DOT4C_I32_I8_dpp_vi and
V_DOT4C_I32_I8_dpp_gfx10. The latter is predicated with isGFX10Only
while the first has no subtarget generation predicates.

Part of <#69256>.
  • Loading branch information
kosarev committed Jan 16, 2024
1 parent 41b09bb commit 03abf7f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llvm/lib/Target/AMDGPU/VOP2Instructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -2512,6 +2512,7 @@ defm V_FMAAK_F32 : VOP2_Real_MADK_gfx940 <0x18>;
}

multiclass VOP2_Real_DOT_ACC_gfx9<bits<6> op> : Base_VOP2_Real_e32e64_vi<op> {
let SubtargetPredicate = isGFX9Only in
def _dpp_vi : VOP2_DPP<op, !cast<VOP2_DPP_Pseudo>(NAME#"_dpp")>;
}

Expand All @@ -2526,22 +2527,22 @@ multiclass VOP2Only_Real_DOT_ACC_gfx10<bits<6> op> : VOP2_Real_dpp_gfx10<op>,
defm NAME : VOP2_Real_e32_gfx10<op>;
}

let SubtargetPredicate = HasDot5Insts in {
let OtherPredicates = [HasDot5Insts] in {
defm V_DOT2C_F32_F16 : VOP2_Real_DOT_ACC_gfx9<0x37>;
// NB: Opcode conflicts with V_DOT8C_I32_I4
// This opcode exists in gfx 10.1* only
defm V_DOT2C_F32_F16 : VOP2Only_Real_DOT_ACC_gfx10<0x02>;
}

let SubtargetPredicate = HasDot6Insts in {
let OtherPredicates = [HasDot6Insts] in {
defm V_DOT4C_I32_I8 : VOP2_Real_DOT_ACC_gfx9<0x39>;
defm V_DOT4C_I32_I8 : VOP2Only_Real_DOT_ACC_gfx10<0x0d>;
}

let SubtargetPredicate = HasDot4Insts in {
let OtherPredicates = [HasDot4Insts] in {
defm V_DOT2C_I32_I16 : VOP2_Real_DOT_ACC_gfx9<0x38>;
}
let SubtargetPredicate = HasDot3Insts in {
let OtherPredicates = [HasDot3Insts] in {
defm V_DOT8C_I32_I4 : VOP2_Real_DOT_ACC_gfx9<0x3a>;
}

Expand Down

0 comments on commit 03abf7f

Please sign in to comment.