[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 20 13:13:31 PST 2025
================
@@ -306,6 +306,24 @@ template <> struct GraphTraits<VPlan *> {
}
};
+inline bool VPlan::isExitBlock(VPBlockBase *VPBB) {
+ if (!isa<VPIRBasicBlock>(VPBB) || VPBB->getNumSuccessors() ||
----------------
fhahn wrote:
Could we just check if it is one of the exit blocks returned by `getExitBlocks`? Might be slightly slower, but shouldn't matter as it is only called at most once per VPBasicBlock.
Of it that is not possible assert that it only returns true if the block is in `getExitBlocks`, to make sure they don't disagree.
Does this need to be defined in `llvm/lib/Transforms/Vectorize/VPlanCFG.h` or could it be moved to VPlan.cpp?
https://github.com/llvm/llvm-project/pull/120567
More information about the llvm-commits
mailing list