[llvm] [LV]Enable max safe distance in predicated DataWithEVL vectorization mode. (PR #100755)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 13:40:01 PST 2024


================
@@ -4099,23 +4153,33 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
            "Invalid loop count");
     const SCEV *ExitCount = SE->getAddExpr(
         BackedgeTakenCount, SE->getOne(BackedgeTakenCount->getType()));
-    const SCEV *Rem = SE->getURemExpr(
-        SE->applyLoopGuards(ExitCount, TheLoop),
-        SE->getConstant(BackedgeTakenCount->getType(), MaxVFtimesIC));
-    if (Rem->isZero()) {
-      // Accept MaxFixedVF if we do not have a tail.
-      LLVM_DEBUG(dbgs() << "LV: No tail will remain for any chosen VF.\n");
-      return MaxFactors;
----------------
fhahn wrote:

Why change this to not exit early? No tail is needed but we still set the tail-folding style?

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


More information about the llvm-commits mailing list