Skip to content

Commit 2a3f27c

Browse files
authored
[AMDGPU][True16] Make NotHasTrue16BitInsts a True16Predicate (#84771)
NFC. Test coverage on VOPC shows NotHasTrue16BitInsts on the pre-gfx11 instructions is necessary (we cannot use the default NoTrue16Predicate). Update the VOP2 instructions in the same manner.
1 parent 034cc2f commit 2a3f27c

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ def Has16BitInsts : Predicate<"Subtarget->has16BitInsts()">,
19031903

19041904
def HasTrue16BitInsts : Predicate<"Subtarget->hasTrue16BitInsts()">,
19051905
AssemblerPredicate<(all_of FeatureTrue16BitInsts)>;
1906-
def NotHasTrue16BitInsts : Predicate<"!Subtarget->hasTrue16BitInsts()">;
1906+
def NotHasTrue16BitInsts : True16PredicateClass<"!Subtarget->hasTrue16BitInsts()">;
19071907

19081908
// Control use of True16 instructions. The real True16 instructions are
19091909
// True16 instructions as they are defined in the ISA. Fake True16

llvm/lib/Target/AMDGPU/VOP2Instructions.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ multiclass VOP2Inst_t16<string opName,
199199
SDPatternOperator node = null_frag,
200200
string revOp = opName,
201201
bit GFX9Renamed = 0> {
202-
let SubtargetPredicate = NotHasTrue16BitInsts, OtherPredicates = [Has16BitInsts] in {
202+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
203203
defm NAME : VOP2Inst<opName, P, node, revOp, GFX9Renamed>;
204204
}
205205
let SubtargetPredicate = UseRealTrue16Insts in {
@@ -219,7 +219,7 @@ multiclass VOP2Inst_e64_t16<string opName,
219219
SDPatternOperator node = null_frag,
220220
string revOp = opName,
221221
bit GFX9Renamed = 0> {
222-
let SubtargetPredicate = NotHasTrue16BitInsts, OtherPredicates = [Has16BitInsts] in {
222+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
223223
defm NAME : VOP2Inst<opName, P, node, revOp, GFX9Renamed>;
224224
}
225225
let SubtargetPredicate = HasTrue16BitInsts in {
@@ -900,7 +900,7 @@ def LDEXP_F16_VOPProfile_True16 : VOPProfile_Fake16<VOP_F16_F16_F16> {
900900

901901
let isReMaterializable = 1 in {
902902
let FPDPRounding = 1 in {
903-
let SubtargetPredicate = NotHasTrue16BitInsts, OtherPredicates = [Has16BitInsts] in
903+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in
904904
defm V_LDEXP_F16 : VOP2Inst <"v_ldexp_f16", LDEXP_F16_VOPProfile>;
905905
let SubtargetPredicate = HasTrue16BitInsts in
906906
defm V_LDEXP_F16_t16 : VOP2Inst <"v_ldexp_f16_t16", LDEXP_F16_VOPProfile_True16>;
@@ -950,15 +950,15 @@ let SubtargetPredicate = isGFX11Plus in {
950950
} // End SubtargetPredicate = isGFX11Plus
951951

952952
let FPDPRounding = 1, isReMaterializable = 1, FixedSize = 1 in {
953-
let SubtargetPredicate = isGFX10Plus, OtherPredicates = [NotHasTrue16BitInsts] in {
953+
let SubtargetPredicate = isGFX10Plus, True16Predicate = NotHasTrue16BitInsts in {
954954
def V_FMAMK_F16 : VOP2_Pseudo <"v_fmamk_f16", VOP_MADMK_F16, [], "">;
955955
}
956956
let SubtargetPredicate = HasTrue16BitInsts in {
957957
def V_FMAMK_F16_t16 : VOP2_Pseudo <"v_fmamk_f16_t16", VOP_MADMK_F16_t16, [], "">;
958958
}
959959

960960
let isCommutable = 1 in {
961-
let SubtargetPredicate = isGFX10Plus, OtherPredicates = [NotHasTrue16BitInsts] in {
961+
let SubtargetPredicate = isGFX10Plus, True16Predicate = NotHasTrue16BitInsts in {
962962
def V_FMAAK_F16 : VOP2_Pseudo <"v_fmaak_f16", VOP_MADAK_F16, [], "">;
963963
}
964964
let SubtargetPredicate = HasTrue16BitInsts in {
@@ -971,7 +971,7 @@ let Constraints = "$vdst = $src2",
971971
DisableEncoding="$src2",
972972
isConvertibleToThreeAddress = 1,
973973
isCommutable = 1 in {
974-
let SubtargetPredicate = isGFX10Plus, OtherPredicates = [NotHasTrue16BitInsts] in {
974+
let SubtargetPredicate = isGFX10Plus, True16Predicate = NotHasTrue16BitInsts in {
975975
defm V_FMAC_F16 : VOP2Inst <"v_fmac_f16", VOP_MAC_F16>;
976976
}
977977
let SubtargetPredicate = HasTrue16BitInsts in {

llvm/lib/Target/AMDGPU/VOPCInstructions.td

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def VOPC_I64_I64 : VOPC_NoSdst_Profile<[Write64Bit], i64>;
408408

409409
multiclass VOPC_F16 <string opName, SDPatternOperator cond = COND_NULL,
410410
string revOp = opName> {
411-
let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in {
411+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
412412
defm NAME : VOPC_Pseudos <opName, VOPC_I1_F16_F16, cond, revOp, 0>;
413413
}
414414
let OtherPredicates = [HasTrue16BitInsts] in {
@@ -424,7 +424,7 @@ multiclass VOPC_F64 <string opName, SDPatternOperator cond = COND_NULL, string r
424424

425425
multiclass VOPC_I16 <string opName, SDPatternOperator cond = COND_NULL,
426426
string revOp = opName> {
427-
let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in {
427+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
428428
defm NAME : VOPC_Pseudos <opName, VOPC_I1_I16_I16, cond, revOp, 0>;
429429
}
430430
let OtherPredicates = [HasTrue16BitInsts] in {
@@ -439,7 +439,7 @@ multiclass VOPC_I64 <string opName, SDPatternOperator cond = COND_NULL, string r
439439
VOPC_Pseudos <opName, VOPC_I1_I64_I64, cond, revOp, 0>;
440440

441441
multiclass VOPCX_F16<string opName, string revOp = opName> {
442-
let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in {
442+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
443443
defm NAME : VOPCX_Pseudos <opName, VOPC_I1_F16_F16, VOPC_F16_F16, COND_NULL, revOp>;
444444
}
445445
let OtherPredicates = [HasTrue16BitInsts] in {
@@ -454,7 +454,7 @@ multiclass VOPCX_F64 <string opName, string revOp = opName> :
454454
VOPCX_Pseudos <opName, VOPC_I1_F64_F64, VOPC_F64_F64, COND_NULL, revOp>;
455455

456456
multiclass VOPCX_I16<string opName, string revOp = opName> {
457-
let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in {
457+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
458458
defm NAME : VOPCX_Pseudos <opName, VOPC_I1_I16_I16, VOPC_I16_I16, COND_NULL, revOp>;
459459
}
460460
let OtherPredicates = [HasTrue16BitInsts] in {
@@ -940,7 +940,7 @@ def VOPC_F32_I32 : VOPC_Class_NoSdst_Profile<[Write32Bit], f32>;
940940
def VOPC_F64_I32 : VOPC_Class_NoSdst_Profile<[Write64Bit], f64>;
941941

942942
multiclass VOPC_CLASS_F16 <string opName> {
943-
let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in {
943+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
944944
defm NAME : VOPC_Class_Pseudos <opName, VOPC_I1_F16_I16, 0>;
945945
}
946946
let OtherPredicates = [HasTrue16BitInsts] in {
@@ -949,7 +949,7 @@ multiclass VOPC_CLASS_F16 <string opName> {
949949
}
950950

951951
multiclass VOPCX_CLASS_F16 <string opName> {
952-
let OtherPredicates = [NotHasTrue16BitInsts, Has16BitInsts] in {
952+
let OtherPredicates = [Has16BitInsts], True16Predicate = NotHasTrue16BitInsts in {
953953
defm NAME : VOPCX_Class_Pseudos <opName, VOPC_I1_F16_I16, VOPC_F16_I16>;
954954
}
955955
let OtherPredicates = [HasTrue16BitInsts] in {

0 commit comments

Comments
 (0)