[llvm] [NFC][SPIRV] Fix for selectExtInst to be able to process intrinsics (PR #110864)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 2 09:29:25 PDT 2024


================
@@ -802,8 +784,12 @@ bool SPIRVInstructionSelector::selectExtInst(Register ResVReg,
                      .addImm(static_cast<uint32_t>(Set))
                      .addImm(Opcode);
       const unsigned NumOps = I.getNumOperands();
-      for (unsigned i = 1; i < NumOps; ++i)
-        MIB.add(I.getOperand(i));
+      unsigned Index = 1;
+      if (I.getOperand(Index).getType() ==
----------------
bogner wrote:

Might be worth an assert that `NumOps > 2` so folks get a better/quicker error if they accidentally misuse this

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


More information about the llvm-commits mailing list