[llvm] [VPlan] Add VPlan-based addMinIterCheck, replace ILV for non-epilogue. (PR #153643)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 10:40:02 PDT 2025


================
@@ -501,10 +501,11 @@ const SCEV *ScalarEvolution::getVScale(Type *Ty) {
   return S;
 }
 
-const SCEV *ScalarEvolution::getElementCount(Type *Ty, ElementCount EC) {
+const SCEV *ScalarEvolution::getElementCount(Type *Ty, ElementCount EC,
+                                             SCEV::NoWrapFlags Flags) {
   const SCEV *Res = getConstant(Ty, EC.getKnownMinValue());
   if (EC.isScalable())
-    Res = getMulExpr(Res, getVScale(Ty));
+    Res = getMulExpr(Res, getVScale(Ty), Flags);
----------------
fhahn wrote:

We are in a bit of an odd situation here at the moment, for the element counts generated by LV, it is assumed that they won't wrap, but in general they could wrap, hence adding the flag as optional. This is needed to avoid regressions w.r.t to legacy code

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


More information about the llvm-commits mailing list