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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 13:13:02 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:

Should this use PSE.getSmallConstantMaxTripCount() to ensure the predicates are added to PSE?

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


More information about the llvm-commits mailing list