[llvm] [LV, VPlan] Check if plan is compatible to EVL transform (PR #92092)
Shih-Po Hung via llvm-commits
llvm-commits at lists.llvm.org
Wed May 15 00:40:13 PDT 2024
================
@@ -8539,6 +8539,29 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
return tryToWiden(Instr, Operands, VPBB);
}
+// EVL transform doesn't support backends where EVL diffs from RuntimeVF
+// in the second-to-last iteration.
+// Return false if the vector region has recipes relying on
+// RuntimeVF.
+static bool isCompatibleToEVLTransform(VPlan &Plan) {
+ auto HasAnyRuntimeVFUserInLoop = [](VPlan &Plan) -> bool {
+ for (auto &Phi : Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis())
+ if (isa<VPWidenIntOrFpInductionRecipe>(&Phi) ||
+ isa<VPWidenPointerInductionRecipe>(&Phi))
+ return true;
+ for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
+ vp_depth_first_deep(Plan.getVectorLoopRegion())))
+ for (VPRecipeBase &Recipe : *VPBB)
+ if (auto *VecPtrR = dyn_cast<VPVectorPointerRecipe>(&Recipe))
+ if (VecPtrR->isReverse())
----------------
arcbbb wrote:
Removed. I didn't notice that foldTailWithEVL would check for CM_Widen_Reverse. Thanks!
https://github.com/llvm/llvm-project/pull/92092
More information about the llvm-commits
mailing list