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

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 12:23:36 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()) {
----------------
alexey-bataev wrote:

It affects the vectorizations. Need to check the scale limit only if !Legal->isSafeForAnyVectorWidth()

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


More information about the llvm-commits mailing list