]> granicus.if.org Git - llvm/commitdiff
[SLPVectorizer] Move out Entry->NeedToGather check and assert of inner loop as invari...
authorDinar Temirbulatov <dtemirbulatov@gmail.com>
Thu, 31 Aug 2017 14:10:07 +0000 (14:10 +0000)
committerDinar Temirbulatov <dtemirbulatov@gmail.com>
Thu, 31 Aug 2017 14:10:07 +0000 (14:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312242 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index 1f530cbb5d2d1fbcbb4a97044297ef6f2be77adc..147860db400d3557ba728ac3ba5f9fc029e2ab08 100644 (file)
@@ -3198,14 +3198,15 @@ BoUpSLP::vectorizeTree(ExtraValueToDebugLocsMap &ExternallyUsedValues) {
   for (TreeEntry &EIdx : VectorizableTree) {
     TreeEntry *Entry = &EIdx;
 
+    // No need to handle users of gathered values.
+    if (Entry->NeedToGather)
+      continue;
+
+    assert(Entry->VectorizedValue && "Can't find vectorizable value");
+    
     // For each lane:
     for (int Lane = 0, LE = Entry->Scalars.size(); Lane != LE; ++Lane) {
       Value *Scalar = Entry->Scalars[Lane];
-      // No need to handle users of gathered values.
-      if (Entry->NeedToGather)
-        continue;
-
-      assert(Entry->VectorizedValue && "Can't find vectorizable value");
 
       Type *Ty = Scalar->getType();
       if (!Ty->isVoidTy()) {