[llvm] [VPlan] Dispatch to multiple exit blocks via middle blocks. (PR #112138)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 23 11:27:55 PST 2024
================
@@ -9167,11 +9179,32 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
"VPBasicBlock");
RecipeBuilder.fixHeaderPhis();
+ if (Legal->hasUncountableEarlyExit()) {
+ VPlanTransforms::handleUncountableEarlyExit(
+ *Plan, *PSE.getSE(), OrigLoop, Legal->getUncountableExitingBlocks(),
+ RecipeBuilder);
+ }
addScalarResumePhis(RecipeBuilder, *Plan);
- SetVector<VPIRInstruction *> ExitUsersToFix = collectUsersInExitBlock(
+ SetVector<VPIRInstruction *> ExitUsersToFix = collectUsersInExitBlocks(
OrigLoop, RecipeBuilder, *Plan, Legal->getInductionVars());
addExitUsersForFirstOrderRecurrences(*Plan, ExitUsersToFix);
- addUsersInExitBlock(*Plan, ExitUsersToFix);
+ addUsersInExitBlocks(*Plan, ExitUsersToFix);
+
+ // Currently only live-ins can be used by exit values. We also bail out if any
+ // exit value isn't handled in VPlan yet, i.e. a VPIRInstruction in the exit
+ // without any operands.
+ if (Legal->hasUncountableEarlyExit()) {
----------------
fhahn wrote:
The latest version updated `addUsersInExitBlocks` to return false if it encounters any exit users it cannot handle . Removed the explicit check here.
https://github.com/llvm/llvm-project/pull/112138
More information about the llvm-commits
mailing list