Skip to content

Commit 49ec8b7

Browse files
authored
AMDGPU: Define and Use HasInterpInsts for interp inst definitions (#84102)
1 parent f439c71 commit 49ec8b7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,9 @@ def NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
18771877
def HasExpOrExportInsts : Predicate<"Subtarget->hasExpOrExportInsts()">,
18781878
AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;
18791879

1880+
def HasInterpInsts : Predicate<"Subtarget->hasInterpInsts()">,
1881+
AssemblerPredicate<(all_of FeatureGFX11Insts)>;
1882+
18801883
def HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
18811884
AssemblerPredicate<(all_of FeatureGFX9Insts)>;
18821885

llvm/lib/Target/AMDGPU/GCNSubtarget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,10 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
651651
return !hasGFX940Insts();
652652
}
653653

654+
bool hasInterpInsts() const {
655+
return GFX11Insts;
656+
}
657+
654658
// DS_ADD_F64/DS_ADD_RTN_F64
655659
bool hasLdsAtomicAddF64() const { return hasGFX90AInsts(); }
656660

llvm/lib/Target/AMDGPU/VINTERPInstructions.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class VOP3_VINTERP_F16 <list<ValueType> ArgVT> : VOPProfile<ArgVT> {
105105
// VINTERP Pseudo Instructions
106106
//===----------------------------------------------------------------------===//
107107

108-
let SubtargetPredicate = isGFX11Plus in {
108+
let SubtargetPredicate = HasInterpInsts in {
109109

110110
let Uses = [M0, EXEC, MODE] in {
111111
def V_INTERP_P10_F32_inreg : VINTERP_Pseudo <"v_interp_p10_f32", VOP3_VINTERP_F32>;
@@ -123,7 +123,7 @@ def V_INTERP_P2_RTZ_F16_F32_inreg :
123123
VINTERP_Pseudo <"v_interp_p2_rtz_f16_f32", VOP3_VINTERP_F16<[f16, f32, f32, f32]>>;
124124
} // Uses = [M0, EXEC]
125125

126-
} // SubtargetPredicate = isGFX11Plus
126+
} // SubtargetPredicate = HasInterpInsts.
127127

128128
class VInterpF32Pat <SDPatternOperator op, Instruction inst> : GCNPat <
129129
(f32 (op

0 commit comments

Comments
 (0)