[llvm] r179206 - We require DataLayout for analyzing the size of stores.

Nadav Rotem nrotem at apple.com
Wed Apr 10 11:57:28 PDT 2013


Author: nadav
Date: Wed Apr 10 13:57:27 2013
New Revision: 179206

URL: http://llvm.org/viewvc/llvm-project?rev=179206&view=rev
Log:
We require DataLayout for analyzing the size of stores.

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

Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=179206&r1=179205&r2=179206&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Wed Apr 10 13:57:27 2013
@@ -107,6 +107,11 @@ struct SLPVectorizer : public BasicBlock
     AA = &getAnalysis<AliasAnalysis>();
     StoreRefs.clear();
 
+    // Must have DataLayout. We can't require it because some tests run w/o
+    // triple.
+    if (!DL)
+      return false;
+
     // Use the bollom up slp vectorizer to construct chains that start with
     // he store instructions.
     BoUpSLP R(&BB, SE, DL, TTI, AA);

Modified: llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp?rev=179206&r1=179205&r2=179206&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/VecUtils.cpp Wed Apr 10 13:57:27 2013
@@ -94,7 +94,7 @@ bool BoUpSLP::isConsecutiveAccess(Value
   Type *Ty = cast<PointerType>(PtrA->getType())->getElementType();
   // The Instructions are connsecutive if the size of the first load/store is
   // the same as the offset.
-  unsigned Sz = (DL ? DL->getTypeStoreSize(Ty) : Ty->getScalarSizeInBits()/8);
+  unsigned Sz = DL->getTypeStoreSize(Ty);
   return ((-Offset) == Sz);
 }
 





More information about the llvm-commits mailing list