[llvm] [LoopVectorize] In LoopVectorize.cpp start using getSymbolicMaxBackedgeTakenCount (PR #108833)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 05:15:39 PDT 2024


================
@@ -4075,7 +4075,12 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
     unsigned MaxVFtimesIC =
         UserIC ? *MaxPowerOf2RuntimeVF * UserIC : *MaxPowerOf2RuntimeVF;
     ScalarEvolution *SE = PSE.getSE();
-    const SCEV *BackedgeTakenCount = PSE.getBackedgeTakenCount();
+    // Currently only loops with countable exits are vectorized so it's safe to
+    // use getSymbolicMaxBackedgeTakenCount as it should give the same result
+    // as getBackedgeTakenCount.
----------------
david-arm wrote:

Seems like a good suggestion! I've rebased the patch to see if the libc++ tests start passing now, and updated the comment. Two for the price of one. :)

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


More information about the llvm-commits mailing list