[llvm] [VPlan] Add VPInst::getNumOperandsForOpcode, use to verify in ctor (NFC) (PR #142284)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 06:02:46 PDT 2025


================
@@ -2706,7 +2760,10 @@ static void scalarizeInstruction(const Instruction *Instr,
 
   // Replace the operands of the cloned instructions with their scalar
   // equivalents in the new loop.
-  for (const auto &I : enumerate(RepRecipe->operands())) {
+  auto OpRange = RepRecipe->operands();
+  if (isa<CallBase>(Cloned))
+    OpRange = drop_end(OpRange);
+  for (const auto &I : enumerate(OpRange)) {
----------------
ayalz wrote:

How/is this related to introducing `getNumOperandsForOpcode()` (i.e., rest of patch)

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


More information about the llvm-commits mailing list