[llvm] [LoopVectorize] Enable vectorisation of early exit loops with live-outs (PR #120567)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 08:33:52 PST 2025
================
@@ -950,6 +957,26 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
}
}
+bool VPlan::isExitBlock(VPBlockBase *VPBB) {
+ if (!isa<VPIRBasicBlock>(VPBB) || VPBB->getNumSuccessors() ||
+ VPBB == getScalarHeader())
+ return false;
+
+ VPRegionBlock *RegionBlock = getVectorLoopRegion();
+ if (!RegionBlock)
+ return false;
+
+ // The block must be a successor of the region block.
+ if (llvm::is_contained(
+ vp_depth_first_shallow(RegionBlock->getSingleSuccessor()), VPBB)) {
+ assert(llvm::is_contained(getExitBlocks(), VPBB) &&
----------------
fhahn wrote:
```suggestion
assert(is_contained(getExitBlocks(), VPBB) &&
```
https://github.com/llvm/llvm-project/pull/120567
More information about the llvm-commits
mailing list