[PATCH] D57253: [WarnMissedTransforms] Set default to 1.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 25 12:17:20 PST 2019


asbirlea created this revision.
asbirlea added a reviewer: sanjoy.
Herald added a subscriber: jlebar.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D57253

Files:
  lib/Transforms/Scalar/WarnMissedTransforms.cpp


Index: lib/Transforms/Scalar/WarnMissedTransforms.cpp
===================================================================
--- lib/Transforms/Scalar/WarnMissedTransforms.cpp
+++ lib/Transforms/Scalar/WarnMissedTransforms.cpp
@@ -51,7 +51,7 @@
     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 @@
           << "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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57253.183596.patch
Type: text/x-patch
Size: 1100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190125/dfade2c2/attachment.bin>


More information about the llvm-commits mailing list