[llvm] [VPlan] Model branch cond to enter scalar epilogue in VPlan. (PR #92651)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 23 03:59:18 PDT 2024


================
@@ -8992,6 +8979,9 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
     }
   }
   Builder.setInsertPoint(&*LatchVPBB->begin());
+  VPBasicBlock *MiddleVPBB =
+      cast<VPBasicBlock>(VectorLoopRegion->getSingleSuccessor());
+  VPBasicBlock::iterator IP = MiddleVPBB->begin();
----------------
fhahn wrote:

Updated to use getFirstNonPhi, thanks,

> Is this change needed, perhaps to retain insn order in tests, compared to the current code which seems to use end()?
Yes, as now MiddleVPBB may contain other VPINsts.

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


More information about the llvm-commits mailing list