[llvm] [VPlan] Update final exit value via VPlan. (PR #112147)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 31 03:29:35 PST 2024


================
@@ -9022,11 +8963,16 @@ addUsersInExitBlocks(VPlan &Plan,
       if (ExitIRI->getParent()->getSinglePredecessor() != MiddleVPBB)
         return false;
 
+      VPValue *Incoming = ExitIRI->getOperand(0);
+      if (addInductionEndValue(Plan, ExitIRI, Incoming, Inductions, EndValues,
+                               TypeInfo))
+        continue;
+
       LLVMContext &Ctx = ExitIRI->getInstruction().getContext();
       VPValue *Ext = B.createNaryOp(VPInstruction::ExtractFromEnd,
                                     {Op, Plan.getOrAddLiveIn(ConstantInt::get(
                                              IntegerType::get(Ctx, 32), 1))});
-      ExitIRI->setOperand(Idx, Ext);
+      ExitIRI->setOperand(0, Ext);
----------------
ayalz wrote:

`Idx` is now useless. Still need to iterate over all operands?

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


More information about the llvm-commits mailing list