[llvm] [VPlan] Make CanIV part of region. (PR #144803)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 10 05:12:54 PDT 2025


================
@@ -1058,7 +1090,12 @@ void VPlan::execute(VPTransformState *State) {
       // Move the last step to the end of the latch block. This ensures
       // consistent placement of all induction updates.
       Instruction *Inc = cast<Instruction>(Phi->getIncomingValue(1));
-      Inc->moveBefore(std::prev(VectorLatchBB->getTerminator()->getIterator()));
+      if (VectorLatchBB->getTerminator()->getIterator() !=
+          VectorLatchBB->begin())
----------------
ayalz wrote:

Comment about this empty latch case, encountered now?

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


More information about the llvm-commits mailing list