[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 11:51:24 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:
No, I think `NumOps > 1` is right - we're just making sure that the `I.getOperand(Index)` here (where `Index == 1`) will crash in a helpful way. This makes the assumption here more explicit.
https://github.com/llvm/llvm-project/pull/110864
More information about the llvm-commits
mailing list