SLPVectorizer: Remove duplicated function.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 2 Nov 2013 14:46:27 +0000 (14:46 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 2 Nov 2013 14:46:27 +0000 (14:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193927 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index 2797a214212f58292bd6784e191001e2e13e65f8..9a2165329d948ded4726e2733a37142f68bb5974 100644 (file)
@@ -206,14 +206,6 @@ static bool CanReuseExtract(ArrayRef<Value *> VL) {
   return true;
 }
 
-static bool all_equal(SmallVectorImpl<Value *> &V) {
-  Value *First = V[0];
-  for (int i = 1, e = V.size(); i != e; ++i)
-    if (V[i] != First)
-      return false;
-  return true;
-}
-
 static void reorderInputsAccordingToOpcode(ArrayRef<Value *> VL,
                                            SmallVectorImpl<Value *> &Left,
                                            SmallVectorImpl<Value *> &Right) {
@@ -301,8 +293,8 @@ static void reorderInputsAccordingToOpcode(ArrayRef<Value *> VL,
     Right.push_back(V1);
   }
 
-  bool LeftBroadcast = all_equal(Left);
-  bool RightBroadcast = all_equal(Right);
+  bool LeftBroadcast = isSplat(Left);
+  bool RightBroadcast = isSplat(Right);
 
   // Don't reorder if the operands where good to begin with.
   if (!(LeftBroadcast || RightBroadcast) &&