[llvm] f23c4c6 - [AMDGPU] Separate out real exp instructions by subtarget. NFC.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 09:14:13 PST 2020
Author: Jay Foad
Date: 2020-11-11T17:13:40Z
New Revision: f23c4c6f8a3866d0fcd9537a2e95de355e48b6de
URL: https://github.com/llvm/llvm-project/commit/f23c4c6f8a3866d0fcd9537a2e95de355e48b6de
DIFF: https://github.com/llvm/llvm-project/commit/f23c4c6f8a3866d0fcd9537a2e95de355e48b6de.diff
LOG: [AMDGPU] Separate out real exp instructions by subtarget. NFC.
Differential Revision: https://reviews.llvm.org/D91247
Added:
Modified:
llvm/lib/Target/AMDGPU/EXPInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/EXPInstructions.td b/llvm/lib/Target/AMDGPU/EXPInstructions.td
index 90e3309a8eba..b3b55ddd2c97 100644
--- a/llvm/lib/Target/AMDGPU/EXPInstructions.td
+++ b/llvm/lib/Target/AMDGPU/EXPInstructions.td
@@ -10,66 +10,85 @@
// EXP classes
//===----------------------------------------------------------------------===//
-class EXPCommon<dag outs, dag ins, string asm, list<dag> pattern> :
- InstSI<outs, ins, asm, pattern> {
+class EXPCommon<bit done, string asm = ""> : InstSI<
+ (outs),
+ (ins exp_tgt:$tgt,
+ ExpSrc0:$src0, ExpSrc1:$src1, ExpSrc2:$src2, ExpSrc3:$src3,
+ exp_vm:$vm, exp_compr:$compr, i32imm:$en),
+ asm> {
let EXP = 1;
let EXP_CNT = 1;
- let mayLoad = 0; // Set to 1 if done bit is set.
+ let mayLoad = done;
let mayStore = 1;
let UseNamedOperandTable = 1;
let Uses = [EXEC];
let SchedRW = [WriteExport];
+ let DisableWQM = 1;
}
-class EXP_Helper<bit done> : EXPCommon<
- (outs),
- (ins exp_tgt:$tgt,
- ExpSrc0:$src0, ExpSrc1:$src1, ExpSrc2:$src2, ExpSrc3:$src3,
- exp_vm:$vm, exp_compr:$compr, i32imm:$en),
- "exp$tgt $src0, $src1, $src2, $src3"#!if(done, " done", "")#"$compr$vm", []> {
+class EXP_Pseudo<bit done> : EXPCommon<done>,
+ SIMCInstr <NAME, SIEncodingFamily.NONE> {
+ let isPseudo = 1;
+ let isCodeGenOnly = 1;
+}
+
+class EXP_Real<bit done, string pseudo, int subtarget>
+ : EXPCommon<done, "exp$tgt $src0, $src1, $src2, $src3"#!if(done, " done", "")
+ #"$compr$vm">,
+ SIMCInstr <pseudo, subtarget> {
let AsmMatchConverter = "cvtExp";
}
+//===----------------------------------------------------------------------===//
+// EXP Instructions
+//===----------------------------------------------------------------------===//
+
// Split EXP instruction into EXP and EXP_DONE so we can set
// mayLoad for done=1.
-multiclass EXP_m<bit done> {
- let mayLoad = done, DisableWQM = 1 in {
- let isPseudo = 1, isCodeGenOnly = 1 in {
- def "" : EXP_Helper<done>,
- SIMCInstr <NAME, SIEncodingFamily.NONE>;
- }
-
- let done = done in {
- def _si : EXP_Helper<done>,
- SIMCInstr <NAME, SIEncodingFamily.SI>,
- EXPe {
- let AssemblerPredicate = isGFX6GFX7;
- let DecoderNamespace = "GFX6GFX7";
- }
-
- def _vi : EXP_Helper<done>,
- SIMCInstr <NAME, SIEncodingFamily.VI>,
- EXPe_vi {
- let AssemblerPredicate = isGFX8GFX9;
- let DecoderNamespace = "GFX8";
- }
-
- def _gfx10 : EXP_Helper<done>,
- SIMCInstr <NAME, SIEncodingFamily.GFX10>,
- EXPe {
- let AssemblerPredicate = isGFX10Plus;
- let DecoderNamespace = "GFX10";
- }
- }
- }
+def EXP : EXP_Pseudo<0>;
+def EXP_DONE : EXP_Pseudo<1>;
+
+//===----------------------------------------------------------------------===//
+// SI
+//===----------------------------------------------------------------------===//
+
+class EXP_Real_si<bit _done, string pseudo>
+ : EXP_Real<_done, pseudo, SIEncodingFamily.SI>, EXPe {
+ let AssemblerPredicate = isGFX6GFX7;
+ let DecoderNamespace = "GFX6GFX7";
+ let done = _done;
}
+def EXP_si : EXP_Real_si<0, "EXP">;
+def EXP_DONE_si : EXP_Real_si<1, "EXP_DONE">;
+
//===----------------------------------------------------------------------===//
-// EXP Instructions
+// VI
+//===----------------------------------------------------------------------===//
+
+class EXP_Real_vi<bit _done, string pseudo>
+ : EXP_Real<_done, pseudo, SIEncodingFamily.VI>, EXPe_vi {
+ let AssemblerPredicate = isGFX8GFX9;
+ let DecoderNamespace = "GFX8";
+ let done = _done;
+}
+
+def EXP_vi : EXP_Real_vi<0, "EXP">;
+def EXP_DONE_vi : EXP_Real_vi<1, "EXP_DONE">;
+
//===----------------------------------------------------------------------===//
+// GFX10+
+//===----------------------------------------------------------------------===//
+
+class EXP_Real_gfx10<bit _done, string pseudo>
+ : EXP_Real<_done, pseudo, SIEncodingFamily.GFX10>, EXPe {
+ let AssemblerPredicate = isGFX10Plus;
+ let DecoderNamespace = "GFX10";
+ let done = _done;
+}
-defm EXP : EXP_m<0>;
-defm EXP_DONE : EXP_m<1>;
+def EXP_gfx10 : EXP_Real_gfx10<0, "EXP">;
+def EXP_DONE_gfx10 : EXP_Real_gfx10<1, "EXP_DONE">;
//===----------------------------------------------------------------------===//
// EXP Patterns
More information about the llvm-commits
mailing list