[llvm] [VPlan] Replace VPRegionBlock with explicit CFG before execute (NFCI). (PR #117506)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon May 12 04:36:53 PDT 2025
================
@@ -2845,11 +2837,15 @@ void InnerLoopVectorizer::fixVectorizedLoop(VPTransformState &State) {
// Don't apply optimizations below when no vector region remains, as they all
// require a vector loop at the moment.
- if (!State.Plan->getVectorLoopRegion())
+ VPBasicBlock *HeaderVPBB = find_singleton<VPBasicBlock>(
+ vp_depth_first_shallow(State.Plan->getEntry()),
+ [&State](VPBlockBase *VPB, bool) {
+ auto *VPBB = dyn_cast<VPBasicBlock>(VPB);
+ return VPBB && VPBB->isHeader(State.VPDT) ? VPBB : nullptr;
+ });
+ if (!HeaderVPBB)
return;
- VPRegionBlock *VectorRegion = State.Plan->getVectorLoopRegion();
- VPBasicBlock *HeaderVPBB = VectorRegion->getEntryBasicBlock();
BasicBlock *HeaderBB = State.CFG.VPBB2IRBB[HeaderVPBB];
// Remove redundant induction instructions.
----------------
fhahn wrote:
Yep, this should also be moved to a VPlan-transform. The limitation to the loop region isn't really material for the VPlan version.
https://github.com/llvm/llvm-project/pull/117506
More information about the llvm-commits
mailing list