[PATCH] D121804: [AMDGPU] Define new feature HasFlatScratchSVSMode. NFC.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 16 07:12:32 PDT 2022
foad created this revision.
foad added reviewers: rampitec, Joe_Nash.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
This is by analogy with HasFlatScratchSTMode and is slightly more
informative than using isGFX940Plus.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121804
Files:
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/FLATInstructions.td
llvm/lib/Target/AMDGPU/GCNSubtarget.h
Index: llvm/lib/Target/AMDGPU/GCNSubtarget.h
===================================================================
--- llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -571,6 +571,8 @@
return hasFlatScratchInsts() && (hasGFX10_3Insts() || hasGFX940Insts());
}
+ bool hasFlatScratchSVSMode() const { return GFX940Insts; }
+
bool hasScalarFlatScratchInsts() const {
return ScalarFlatScratchInsts;
}
Index: llvm/lib/Target/AMDGPU/FLATInstructions.td
===================================================================
--- llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -366,7 +366,7 @@
def _SADDR : FLAT_Scratch_Load_Pseudo<opName, regClass, HasTiedOutput, 1>,
FlatScratchInst<opName, "SS">;
- let SubtargetPredicate = isGFX940Plus in
+ let SubtargetPredicate = HasFlatScratchSVSMode in
def _SVS : FLAT_Scratch_Load_Pseudo<opName, regClass, HasTiedOutput, 1, 1>,
FlatScratchInst<opName, "SVS">;
@@ -383,7 +383,7 @@
def _SADDR : FLAT_Scratch_Store_Pseudo<opName, regClass, 1>,
FlatScratchInst<opName, "SS">;
- let SubtargetPredicate = isGFX940Plus in
+ let SubtargetPredicate = HasFlatScratchSVSMode in
def _SVS : FLAT_Scratch_Store_Pseudo<opName, regClass, 1, 1>,
FlatScratchInst<opName, "SVS">;
@@ -1272,7 +1272,7 @@
}
def : ScratchLoadSVaddrPat<!cast<FLAT_Pseudo>(!cast<string>(inst)#"_SVS"), node, vt> {
- let SubtargetPredicate = isGFX940Plus;
+ let SubtargetPredicate = HasFlatScratchSVSMode;
let AddedComplexity = 27;
}
}
@@ -1288,7 +1288,7 @@
}
def : ScratchStoreSVaddrPat<!cast<FLAT_Pseudo>(!cast<string>(inst)#"_SVS"), node, vt> {
- let SubtargetPredicate = isGFX940Plus;
+ let SubtargetPredicate = HasFlatScratchSVSMode;
let AddedComplexity = 27;
}
}
@@ -1303,7 +1303,7 @@
}
def : ScratchLoadSVaddrPat_D16 <!cast<FLAT_Pseudo>(!cast<string>(inst)#"_SVS"), node, vt> {
- let SubtargetPredicate = isGFX940Plus;
+ let SubtargetPredicate = HasFlatScratchSVSMode;
let AddedComplexity = 27;
}
}
Index: llvm/lib/Target/AMDGPU/AMDGPU.td
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPU.td
+++ llvm/lib/Target/AMDGPU/AMDGPU.td
@@ -1396,6 +1396,8 @@
def HasFlatScratchSTMode : Predicate<"Subtarget->hasFlatScratchSTMode()">,
AssemblerPredicate<(any_of FeatureGFX10_3Insts, FeatureGFX940Insts)>;
+def HasFlatScratchSVSMode : Predicate<"Subtarget->hasFlatScratchSVSMode()">,
+ AssemblerPredicate<(any_of FeatureGFX940Insts)>;
def HasGFX10_AEncoding : Predicate<"Subtarget->hasGFX10_AEncoding()">,
AssemblerPredicate<(all_of FeatureGFX10_AEncoding)>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121804.415819.patch
Type: text/x-patch
Size: 2787 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220316/1bfed26e/attachment.bin>
More information about the llvm-commits
mailing list