[llvm] [VPlan] Handle canonical VPWidenIntOrFpInduction in branch-condition simplification (PR #153539)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 14 09:05:17 PDT 2025
================
@@ -1498,10 +1498,21 @@ static bool simplifyBranchConditionForVFAndUF(VPlan &Plan, ElementCount BestVF,
// the region, otherwise replace the terminator controlling the latch with
// (BranchOnCond true).
auto *Header = cast<VPBasicBlock>(VectorRegion->getEntry());
- if (all_of(Header->phis(),
- IsaPred<VPCanonicalIVPHIRecipe, VPEVLBasedIVPHIRecipe,
- VPFirstOrderRecurrencePHIRecipe, VPPhi>)) {
+ if (all_of(Header->phis(), [](VPRecipeBase &Phi) {
+ if (auto *R = dyn_cast<VPWidenIntOrFpInductionRecipe>(&Phi))
+ return R->isCanonical();
----------------
Mel-Chen wrote:
Could we simplify it if it’s not canonical? If so, could we mark a TODO comment?
https://github.com/llvm/llvm-project/pull/153539
More information about the llvm-commits
mailing list