[llvm] [VPlan] Generalize collectUsersInExitBlocks for multiple exit bbs. (PR #115066)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 06:36:01 PST 2024
================
@@ -306,6 +306,15 @@ template <> struct GraphTraits<VPlan *> {
}
};
+inline auto VPlan::getExitBlocks() {
+ VPBlockBase *ScalarHeader = getScalarHeader();
+ return make_filter_range(
+ VPBlockUtils::blocksOnly<VPIRBasicBlock>(
+ vp_depth_first_shallow(getVectorLoopRegion()->getSingleSuccessor())),
+ [ScalarHeader](VPIRBasicBlock *VPIRBB) {
+ return VPIRBB != ScalarHeader && VPIRBB->getNumSuccessors() == 0;
----------------
david-arm wrote:
Ah, I think the reason why this works is because of the extra `VPIRBB->getNumSuccessors() == 0` condition, since the middle block will always have at least one successor.
https://github.com/llvm/llvm-project/pull/115066
More information about the llvm-commits
mailing list