[llvm] 0cee1bf - [SLP] remove redundant size check; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 05:27:26 PDT 2020


Author: Sanjay Patel
Date: 2020-09-16T08:11:19-04:00
New Revision: 0cee1bf5d17dd424c569df7e2604be10906bd515

URL: https://github.com/llvm/llvm-project/commit/0cee1bf5d17dd424c569df7e2604be10906bd515
DIFF: https://github.com/llvm/llvm-project/commit/0cee1bf5d17dd424c569df7e2604be10906bd515.diff

LOG: [SLP] remove redundant size check; NFC

We bail out on small array size anyway.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 62269d2e7b9e7..0fc5d1a810b50 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6796,14 +6796,10 @@ class HorizontalReduction {
     return true;
   }
 
-  /// Attempt to vectorize the tree found by
-  /// matchAssociativeReduction.
+  /// Attempt to vectorize the tree found by matchAssociativeReduction.
   bool tryToReduce(BoUpSLP &V, TargetTransformInfo *TTI) {
-    if (ReducedVals.empty())
-      return false;
-
-    // If there is a sufficient number of reduction values, reduce
-    // to a nearby power-of-2. Can safely generate oversized
+    // If there are a sufficient number of reduction values, reduce
+    // to a nearby power-of-2. We can safely generate oversized
     // vectors and rely on the backend to split them to legal sizes.
     unsigned NumReducedVals = ReducedVals.size();
     if (NumReducedVals < 4)


        


More information about the llvm-commits mailing list