[llvm] [LoopVectorize] Use predicated version of getSmallConstantMaxTripCount (PR #109928)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 6 07:32:35 PDT 2024


================
@@ -3994,8 +3996,13 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
   }
 
   unsigned TC = PSE.getSE()->getSmallConstantTripCount(TheLoop);
-  unsigned MaxTC = PSE.getSE()->getSmallConstantMaxTripCount(TheLoop);
+
+  SmallVector<const SCEVPredicate *, 2> Predicates;
+  unsigned MaxTC =
+      PSE.getSE()->getSmallConstantMaxTripCount(TheLoop, &Predicates);
----------------
fhahn wrote:

Yes, PSE should take care to avoid adding duplicated predicates, thanks for adjusting!

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


More information about the llvm-commits mailing list