[llvm] [MachineVerifier] Improve checks for G_INSERT_SUBVECTOR. (PR #109209)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 15:25:14 PDT 2024


================
@@ -11,9 +11,11 @@ body:             |
     %1:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
     %2:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
 
+    ; CHECK: generic instruction must use register operands
----------------
topperc wrote:

anything that has a type declared in the .td automatically generates a check that the operand is a register. This handles a significant portion of the generic instructions like G_ADD, G_FADD without writing any custom code.

I was going to remove the error from G_INSERT_SUBVECTOR and G_EXTRACT_SUBVECTOR, but we need the call to `isReg()` to avoid an assert in `getReg()` later. The assert will crash the test without letting us get through all the test cases.

https://github.com/llvm/llvm-project/pull/109209


More information about the llvm-commits mailing list