Skip to content

AMDGPU: Define and Use HasInterpInsts for interp inst definitions #84102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions llvm/lib/Target/AMDGPU/AMDGPU.td
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,9 @@ def NotLDSRequiresM0Init : Predicate<"!Subtarget->ldsRequiresM0Init()">;
def HasExpOrExportInsts : Predicate<"Subtarget->hasExpOrExportInsts()">,
AssemblerPredicate<(all_of (not FeatureGFX90AInsts))>;

def HasInterpInsts : Predicate<"Subtarget->hasInterpInsts()">,
AssemblerPredicate<(all_of FeatureGFX11Insts)>;

def HasDSAddTid : Predicate<"Subtarget->getGeneration() >= AMDGPUSubtarget::GFX9">,
AssemblerPredicate<(all_of FeatureGFX9Insts)>;

Expand Down
4 changes: 4 additions & 0 deletions llvm/lib/Target/AMDGPU/GCNSubtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,10 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
return !hasGFX940Insts();
}

bool hasInterpInsts() const {
return GFX11Insts;
}

// DS_ADD_F64/DS_ADD_RTN_F64
bool hasLdsAtomicAddF64() const { return hasGFX90AInsts(); }

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/VINTERPInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class VOP3_VINTERP_F16 <list<ValueType> ArgVT> : VOPProfile<ArgVT> {
// VINTERP Pseudo Instructions
//===----------------------------------------------------------------------===//

let SubtargetPredicate = isGFX11Plus in {
let SubtargetPredicate = HasInterpInsts in {

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

} // SubtargetPredicate = isGFX11Plus
} // SubtargetPredicate = HasInterpInsts.

class VInterpF32Pat <SDPatternOperator op, Instruction inst> : GCNPat <
(f32 (op
Expand Down