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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 5 03:53:19 PST 2025


================
@@ -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);
----------------
fhahn wrote:

Should still use `Idx` for completeness, restored, thanks

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


More information about the llvm-commits mailing list