[llvm] r312242 - [SLPVectorizer] Move out Entry->NeedToGather check and assert of inner loop as invariant, NFCI.

Dinar Temirbulatov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 07:10:07 PDT 2017


Author: dinar
Date: Thu Aug 31 07:10:07 2017
New Revision: 312242

URL: http://llvm.org/viewvc/llvm-project?rev=312242&view=rev
Log:
[SLPVectorizer] Move out Entry->NeedToGather check and assert of inner loop as invariant, NFCI.

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

Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=312242&r1=312241&r2=312242&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Thu Aug 31 07:10:07 2017
@@ -3198,14 +3198,15 @@ BoUpSLP::vectorizeTree(ExtraValueToDebug
   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()) {




More information about the llvm-commits mailing list