]> granicus.if.org Git - llvm/commitdiff
[WarnMissedTransforms] Set default to 1.
authorAlina Sbirlea <asbirlea@google.com>
Fri, 25 Jan 2019 20:51:55 +0000 (20:51 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Fri, 25 Jan 2019 20:51:55 +0000 (20:51 +0000)
Summary:
Set default value for retrieved attributes to 1, since the check is against 1.
Eliminates the warning noise generated when the attributes are not present.

Reviewers: sanjoy

Subscribers: jlebar, llvm-commits

Differential Revision: https://reviews.llvm.org/D57253

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/WarnMissedTransforms.cpp

index 73687e1e5dfdc315eefd603daa1008efcb7732c1..b6b31cf68e5326f42aca89b2737dc33d0f588a88 100644 (file)
@@ -51,7 +51,7 @@ static void warnAboutLeftoverTransformations(Loop *L,
     Optional<int> InterleaveCount =
         getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count");
 
-    if (VectorizeWidth.getValueOr(0) != 1)
+    if (VectorizeWidth.getValueOr(1) != 1)
       ORE->emit(
           DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
                                             "FailedRequestedVectorization",
@@ -59,7 +59,7 @@ static void warnAboutLeftoverTransformations(Loop *L,
           << "loop not vectorized: the optimizer was unable to perform the "
              "requested transformation; the transformation might be disabled "
              "or specified as part of an unsupported transformation ordering");
-    else if (InterleaveCount.getValueOr(0) != 1)
+    else if (InterleaveCount.getValueOr(1) != 1)
       ORE->emit(
           DiagnosticInfoOptimizationFailure(DEBUG_TYPE,
                                             "FailedRequestedInterleaving",