[llvm-branch-commits] [llvm-branch] r353167 - Merging r352555:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 5 04:55:45 PST 2019


Author: hans
Date: Tue Feb  5 04:55:45 2019
New Revision: 353167

URL: http://llvm.org/viewvc/llvm-project?rev=353167&view=rev
Log:
Merging r352555:
------------------------------------------------------------------------
r352555 | asbirlea | 2019-01-29 23:33:20 +0100 (Tue, 29 Jan 2019) | 12 lines

Check bool attribute value in getOptionalBoolLoopAttribute.

Summary:
Check the bool value of the attribute in getOptionalBoolLoopAttribute
not just its existance.
Eliminates the warning noise generated when vectorization is explicitly disabled.

Reviewers: Meinersbur, hfinkel, dmgreen

Subscribers: jlebar, sanjoy, llvm-commits

Differential Revision: https://reviews.llvm.org/D57260
------------------------------------------------------------------------

Added:
    llvm/branches/release_80/test/Transforms/LoopVectorize/no_switch_disable_vectorization.ll
      - copied unchanged from r352555, llvm/trunk/test/Transforms/LoopVectorize/no_switch_disable_vectorization.ll
Modified:
    llvm/branches/release_80/   (props changed)
    llvm/branches/release_80/lib/Transforms/Utils/LoopUtils.cpp

Propchange: llvm/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb  5 04:55:45 2019
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352246,352374,352770,352889,352945,353082
+/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352246,352374,352555,352770,352889,352945,353082

Modified: llvm/branches/release_80/lib/Transforms/Utils/LoopUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/Transforms/Utils/LoopUtils.cpp?rev=353167&r1=353166&r2=353167&view=diff
==============================================================================
--- llvm/branches/release_80/lib/Transforms/Utils/LoopUtils.cpp (original)
+++ llvm/branches/release_80/lib/Transforms/Utils/LoopUtils.cpp Tue Feb  5 04:55:45 2019
@@ -217,7 +217,10 @@ static Optional<bool> getOptionalBoolLoo
     // When the value is absent it is interpreted as 'attribute set'.
     return true;
   case 2:
-    return mdconst::extract_or_null<ConstantInt>(MD->getOperand(1).get());
+    if (ConstantInt *IntMD =
+            mdconst::extract_or_null<ConstantInt>(MD->getOperand(1).get()))
+      return IntMD->getZExtValue();
+    return true;
   }
   llvm_unreachable("unexpected number of options");
 }




More information about the llvm-branch-commits mailing list