[llvm] [VPlan] Hook IR blocks into VPlan during skeleton creation (NFC) (PR #114292)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 25 13:29:28 PST 2024
================
@@ -2429,6 +2429,30 @@ InnerLoopVectorizer::getOrCreateVectorTripCount(BasicBlock *InsertBlock) {
return VectorTripCount;
}
+/// Helper to connect both the vector and scalar preheaders to the Plan's
+/// entry. This is used when adjusting \p Plan during skeleton
+/// creation, i.e. adjusting the plan after introducing an initial runtime
+/// check.
+static void connectScalarPreheaderInVPlan(VPlan &Plan) {
+ VPBlockBase *VectorPH = Plan.getVectorPreheader();
+ VPBlockBase *ScalarPH = Plan.getScalarPreheader();
+ VPBlockBase *PredVPB = Plan.getEntry();
+ VPBlockUtils::connectBlocks(PredVPB, ScalarPH, -1, 0);
+ VPBlockUtils::connectBlocks(PredVPB, VectorPH, 0, -1);
----------------
fhahn wrote:
Updated to connect + swap, thanks.
> Furthermore, TCCheckBlock could then be inserted on this Entry-->vector_PH edge, so that connectScalarPreheaderInVPlan() assimilates introduceCheckBlockInVPlan().
Not sure how exactly, left as is for now.
https://github.com/llvm/llvm-project/pull/114292
More information about the llvm-commits
mailing list