[llvm] [LV, VPlan] Check if plan is compatible to EVL transform (PR #92092)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 03:05:24 PDT 2024


================
@@ -8539,6 +8539,20 @@ 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) {
+  if (any_of(Plan.getVectorLoopRegion()->getEntryBasicBlock()->phis(),
+             [](VPRecipeBase &Phi) {
+               return (isa<VPWidenIntOrFpInductionRecipe>(&Phi) ||
+                       isa<VPWidenPointerInductionRecipe>(&Phi));
+             }))
+    return false;
----------------
fhahn wrote:

nit: can replace `if()` with direct `return` (possibly needing to negate/or use `all_of`. With it being that compact, it would probably be better to directly fold this into the transform that introduces EVL

https://github.com/llvm/llvm-project/pull/92092


More information about the llvm-commits mailing list