[llvm] [VPlan] Hook IR blocks into VPlan during skeleton creation (NFC) (PR #114292)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 3 16:34:22 PST 2024
================
@@ -1266,6 +1293,15 @@ VPlan *VPlan::duplicate() {
return NewPlan;
}
+VPBasicBlock *VPlan::getScalarPreheader() {
+ auto *MiddleVPBB =
+ cast<VPBasicBlock>(getVectorLoopRegion()->getSingleSuccessor());
+ auto *LastSucc = MiddleVPBB->getSuccessors().back();
+ // Order is strict: if the last successor is VPIRBasicBlock, it must be the
+ // single exit.
+ return isa<VPIRBasicBlock>(LastSucc) ? nullptr : cast<VPBasicBlock>(LastSucc);
+}
+
----------------
ayalz wrote:
Better placed above next to getVectorLoopRegion(), than here at the end after duplicate()?
https://github.com/llvm/llvm-project/pull/114292
More information about the llvm-commits
mailing list