[llvm] [VPlan] Connect Entry to scalar preheader during initial construction. (PR #140132)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 20 12:52:22 PDT 2025


================
@@ -490,7 +490,7 @@ class InnerLoopVectorizer {
         MinProfitableTripCount(MinProfitableTripCount), UF(UnrollFactor),
         Builder(PSE.getSE()->getContext()), Cost(CM), BFI(BFI), PSI(PSI),
         RTChecks(RTChecks), Plan(Plan),
-        VectorPHVPB(Plan.getEntry()->getSingleSuccessor()) {}
+        VectorPHVPB(Plan.getEntry()->getSuccessors()[1]) {}
----------------
ayalz wrote:

So now Plan->entry has ScalarPH as its first successor and VectorPH as its second, rather than the latter as its only successor.

Good to assert there are two successors. Perhaps some API to retrieve "1of2" and "2of2", analogous to existing "1of1"?

Better look instead for first predecessor (among two) of first header block? Possibly as follow-up.

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


More information about the llvm-commits mailing list