[llvm] [VPlan] Remove loop region in optimizeForVFAndUF. (PR #108378)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 1 15:53:28 PST 2025


================
@@ -2446,9 +2450,11 @@ InnerLoopVectorizer::getOrCreateVectorTripCount(BasicBlock *InsertBlock) {
 /// Introduces a new VPIRBasicBlock for \p CheckIRBB to \p Plan between the
 /// vector preheader and its predecessor, also connecting the new block to the
 /// scalar preheader.
-static void introduceCheckBlockInVPlan(VPlan &Plan, BasicBlock *CheckIRBB) {
+static void introduceCheckBlockInVPlan(VPlan &Plan, VPBlockBase *VectorPH,
+                                       BasicBlock *CheckIRBB) {
   VPBlockBase *ScalarPH = Plan.getScalarPreheader();
-  VPBlockBase *VectorPH = Plan.getVectorPreheader();
+  // FIXME: Cannot get the vector preheader at the moment if the vector loop
+  // region has been removed.
----------------
ayalz wrote:

Passing in `VectorPH` seems fine, still need "FIXME"? In fact, can pass both `VectorDestination` and `ScalarDestination`, i.e., the two block that the new check block is introduced to select between.

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


More information about the llvm-commits mailing list