================
@@ -5498,6 +5505,22 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr 
&MI,
     return false;
   }
 
+  // Lowering relies on exactly one memory operand, since a sub-dword store
+  // synthesizes a load operand from it, and on the index carrying no
+  // subregister, since the custom inserter rewrites it in place to M0.
+  if (auto *LdStIdx = dyn_cast<AMDGPUMI::VLoadStoreIdxInst>(&MI)) {
+    if (MI.getNumMemOperands() != 1) {
+      ErrInfo = "v_load/store_idx should have exactly one memory operand.";
+      return false;
+    }
+
+    const MachineOperand &IdxOp = LdStIdx->getIdxOp();
+    if (IdxOp.isReg() && IdxOp.getSubReg() != 0) {
+      ErrInfo = "v_load/store_idx register index must not have a subregister.";
+      return false;
+    }
----------------
arsenm wrote:

This isn't a valid rule to enforce. The operand / register class compatibility 
APIs won't be aware of it

https://github.com/llvm/llvm-project/pull/213223
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to