[PATCH] D81649: [AMDGPU/MemOpsCluster] Compute `width` for `MIMG` instruction class.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 06:01:39 PDT 2020


hsmhsm created this revision.
hsmhsm added reviewers: foad, rampitec, arsenm.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.

`width` computation is missing for newly added `MIMG`
instruction class. Add it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81649

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp


Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -394,6 +394,11 @@
       BaseOps.push_back(getNamedOperand(LdSt, AMDGPU::OpName::vaddr));
     }
     Offset = 0;
+    // Get appropriate operand, and compute width accordingly.
+    DataOpIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vdst);
+    if (DataOpIdx == -1)
+      DataOpIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::vdata);
+    Width = getOpSize(LdSt, DataOpIdx);
     return true;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81649.270113.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200611/d109f03a/attachment.bin>


More information about the llvm-commits mailing list