[PATCH] D124472: [AMDGPU] Properly mark MUBUF and FLAT LDS DMA instructions. NFC.
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 26 12:39:40 PDT 2022
rampitec created this revision.
rampitec added a reviewer: arsenm.
Herald added subscribers: hsmhsm, foad, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
rampitec requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.
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;
- hasSideEffects - we do not see both pointers and cannot produce
proper memory operands, so we do not model what memory do they touch.
Codegen currently does not produce any of this, so the change is NFC.
https://reviews.llvm.org/D124472
Files:
llvm/lib/Target/AMDGPU/BUFInstructions.td
llvm/lib/Target/AMDGPU/FLATInstructions.td
Index: llvm/lib/Target/AMDGPU/FLATInstructions.td
===================================================================
--- llvm/lib/Target/AMDGPU/FLATInstructions.td
+++ llvm/lib/Target/AMDGPU/FLATInstructions.td
@@ -99,6 +99,7 @@
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,8 @@
let mayStore = 1;
let has_saddr = 1;
let enabled_saddr = EnableSaddr;
+ let VALU = 1;
+ let hasSideEffects = 1;
let PseudoInstr = opName#!if(EnableSaddr, "_SADDR", "");
let Uses = [M0, EXEC];
let SchedRW = [WriteVMEM, WriteLDS];
@@ -418,6 +421,8 @@
let has_vaddr = EnableVaddr;
let has_sve = EnableSVE;
let sve = EnableVaddr;
+ let VALU = 1;
+ let hasSideEffects = 1;
let PseudoInstr = opName#!if(EnableSVE, "_SVS", !if(EnableSaddr, "_SADDR", !if(EnableVaddr, "", "_ST")));
let Uses = [M0, EXEC];
let SchedRW = [WriteVMEM, WriteLDS];
Index: llvm/lib/Target/AMDGPU/BUFInstructions.td
===================================================================
--- llvm/lib/Target/AMDGPU/BUFInstructions.td
+++ llvm/lib/Target/AMDGPU/BUFInstructions.td
@@ -360,6 +360,8 @@
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 @@
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,8 @@
let has_tfe = !not(isLds);
let lds = isLds;
let elements = getMUBUFElements<vdata_vt>.ret;
+ let VALU = isLds;
+ let hasSideEffects = isLds;
}
class MUBUF_Offset_Load_Pat <Instruction inst, ValueType load_vt = i32, SDPatternOperator ld = null_frag> : Pat <
@@ -615,6 +620,7 @@
(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 +629,8 @@
let has_vaddr = 0;
let has_tfe = 0;
let lds = 1;
+ let VALU = 1;
+ let hasSideEffects = 1;
let Uses = [EXEC, M0];
let AsmMatchConverter = "cvtMubufLds";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124472.425285.patch
Type: text/x-patch
Size: 2544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220426/9aa99fee/attachment.bin>
More information about the llvm-commits
mailing list