[llvm] a9ccc7b - [AMDGPU] Properly mark MUBUF and FLAT LDS DMA instructions. NFC.
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 26 14:20:34 PDT 2022
Author: Stanislav Mekhanoshin
Date: 2022-04-26T14:20:26-07:00
New Revision: a9ccc7bc54bd5bb403e949b7a60a5306b19ccccb
URL: https://github.com/llvm/llvm-project/commit/a9ccc7bc54bd5bb403e949b7a60a5306b19ccccb
DIFF: https://github.com/llvm/llvm-project/commit/a9ccc7bc54bd5bb403e949b7a60a5306b19ccccb.diff
LOG: [AMDGPU] Properly mark MUBUF and FLAT LDS DMA instructions. NFC.
Add these bits to the MUBUF and FLAT LDS DMA instructions:
- LGKM_CNT - these operate on LDS;
- VALU - SPG 3.9.8: This instruction acts as both a MUBUF and
VALU instruction;
Codegen currently does not produce any of this, so the change is NFC.
Differential Revision: https://reviews.llvm.org/D124472
Added:
Modified:
llvm/lib/Target/AMDGPU/BUFInstructions.td
llvm/lib/Target/AMDGPU/FLATInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/BUFInstructions.td b/llvm/lib/Target/AMDGPU/BUFInstructions.td
index 78da8e3f7b260..f79f00f883aef 100644
--- a/llvm/lib/Target/AMDGPU/BUFInstructions.td
+++ b/llvm/lib/Target/AMDGPU/BUFInstructions.td
@@ -360,6 +360,8 @@ class MUBUF_Real <MUBUF_Pseudo ps> :
let mayStore = ps.mayStore;
let IsAtomicRet = ps.IsAtomicRet;
let IsAtomicNoRet = ps.IsAtomicNoRet;
+ let VALU = ps.VALU;
+ let LGKM_CNT = ps.LGKM_CNT;
bits<12> offset;
bits<5> cpol;
@@ -504,6 +506,7 @@ class MUBUF_Load_Pseudo <string opName,
let AsmMatchConverter = !if(isLds, "cvtMubufLds", "cvtMubuf");
let Constraints = !if(HasTiedDest, "$vdata = $vdata_in", "");
+ let LGKM_CNT = isLds;
let mayLoad = 1;
let mayStore = 0;
let maybeAtomic = 1;
@@ -511,6 +514,7 @@ class MUBUF_Load_Pseudo <string opName,
let has_tfe = !not(isLds);
let lds = isLds;
let elements = getMUBUFElements<vdata_vt>.ret;
+ let VALU = isLds;
}
class MUBUF_Offset_Load_Pat <Instruction inst, ValueType load_vt = i32, SDPatternOperator ld = null_frag> : Pat <
@@ -615,6 +619,7 @@ class MUBUF_Pseudo_Store_Lds<string opName>
(outs),
(ins SReg_128:$srsrc, SCSrc_b32:$soffset, offset:$offset, CPol:$cpol, SWZ:$swz),
" $srsrc, $soffset$offset lds$cpol$swz"> {
+ let LGKM_CNT = 1;
let mayLoad = 0;
let mayStore = 1;
let maybeAtomic = 1;
@@ -623,6 +628,7 @@ class MUBUF_Pseudo_Store_Lds<string opName>
let has_vaddr = 0;
let has_tfe = 0;
let lds = 1;
+ let VALU = 1;
let Uses = [EXEC, M0];
let AsmMatchConverter = "cvtMubufLds";
diff --git a/llvm/lib/Target/AMDGPU/FLATInstructions.td b/llvm/lib/Target/AMDGPU/FLATInstructions.td
index 17a885d15abbd..fbebe8952ad5a 100644
--- a/llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ b/llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -99,6 +99,7 @@ class FLAT_Real <bits<7> op, FLAT_Pseudo ps> :
let IsAtomicNoRet = ps.IsAtomicNoRet;
let VM_CNT = ps.VM_CNT;
let LGKM_CNT = ps.LGKM_CNT;
+ let VALU = ps.VALU;
// encoding fields
bits<8> vaddr;
@@ -258,6 +259,7 @@ class FLAT_Global_Load_LDS_Pseudo <string opName, bit EnableSaddr = 0> : FLAT_Ps
let mayStore = 1;
let has_saddr = 1;
let enabled_saddr = EnableSaddr;
+ let VALU = 1;
let PseudoInstr = opName#!if(EnableSaddr, "_SADDR", "");
let Uses = [M0, EXEC];
let SchedRW = [WriteVMEM, WriteLDS];
@@ -418,6 +420,7 @@ class FLAT_Scratch_Load_LDS_Pseudo <string opName, bit EnableSaddr = 0,
let has_vaddr = EnableVaddr;
let has_sve = EnableSVE;
let sve = EnableVaddr;
+ let VALU = 1;
let PseudoInstr = opName#!if(EnableSVE, "_SVS", !if(EnableSaddr, "_SADDR", !if(EnableVaddr, "", "_ST")));
let Uses = [M0, EXEC];
let SchedRW = [WriteVMEM, WriteLDS];
More information about the llvm-commits
mailing list