[PATCH] D128765: [AMDGPU] Relax verification of soffset in scalar stores

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 16:10:24 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG21895c6b5060: [AMDGPU] Relax verification of soffset in scalar stores (authored by rampitec).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128765/new/

https://reviews.llvm.org/D128765

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/test/CodeGen/AMDGPU/verify-scalar-store.mir


Index: llvm/test/CodeGen/AMDGPU/verify-scalar-store.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AMDGPU/verify-scalar-store.mir
@@ -0,0 +1,13 @@
+# RUN: not --crash llc -march=amdgcn -mcpu=tonga -run-pass=machineverifier -o /dev/null %s 2>&1 | FileCheck -check-prefix=GFX8-ERR %s
+# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=machineverifier -o - %s 2>&1 | FileCheck -check-prefix=GFX9 %s
+
+# GFX8-ERR: *** Bad machine code: scalar stores must use m0 as offset register ***
+# GFX9: S_STORE_DWORD_SGPR
+---
+name:            scalar_store_soffset_sgpr
+body:             |
+  bb.0:
+    S_STORE_DWORD_SGPR undef $sgpr2, undef $sgpr0_sgpr1, undef $sgpr10, 0
+    S_ENDPGM 0
+
+...
Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -4439,7 +4439,8 @@
   }
 
   if (isSMRD(MI)) {
-    if (MI.mayStore()) {
+    if (MI.mayStore() &&
+        ST.getGeneration() == AMDGPUSubtarget::VOLCANIC_ISLANDS) {
       // The register offset form of scalar stores may only use m0 as the
       // soffset register.
       const MachineOperand *Soff = getNamedOperand(MI, AMDGPU::OpName::soffset);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128765.440801.patch
Type: text/x-patch
Size: 1301 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220628/124cb008/attachment.bin>


More information about the llvm-commits mailing list