[llvm] [LV][NFC]Introduce isScalableVectorizationAllowed() to refactor getMaxLegalScalableVF(). (PR #98916)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 13:24:06 PDT 2024


================
@@ -4184,17 +4194,36 @@ LoopVectorizationCostModel::getMaxLegalScalableVF(unsigned MaxSafeElements) {
     reportVectorizationInfo("Scalable vectorization is not supported "
                             "for all element types found in this loop.",
                             "ScalableVFUnfeasible", ORE, TheLoop);
-    return ElementCount::getScalable(0);
+    return false;
+  }
+
+  if (!Legal->isSafeForAnyVectorWidth()) {
----------------
ayalz wrote:

ok, so be it. The error message could perhaps be more accurate then, as lack of maximum vscale alone may not imply that scalable VF is unfeasible. And perhaps suffice to check if (!Legal->isSafeForAnyVectorWidth() && !getMaxVScale()).

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


More information about the llvm-commits mailing list