summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-04-10 18:57:27 +0000
committerNadav Rotem <nrotem@apple.com>2013-04-10 18:57:27 +0000
commit88dd5f7a3804d7022efb1c61bf2c25b89a8816a4 (patch)
tree90b5102ac4cd07e06dc1a0d01d91286be603e84a /llvm/lib/Transforms
parent53eb7d798481935ae1176a57012ba09de4b37ca7 (diff)
downloadbcm5719-llvm-88dd5f7a3804d7022efb1c61bf2c25b89a8816a4.tar.gz
bcm5719-llvm-88dd5f7a3804d7022efb1c61bf2c25b89a8816a4.zip
We require DataLayout for analyzing the size of stores.
llvm-svn: 179206
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp5
-rw-r--r--llvm/lib/Transforms/Vectorize/VecUtils.cpp2
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 4b61dc91202..01b2b92870e 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -107,6 +107,11 @@ struct SLPVectorizer : public BasicBlockPass {
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);
diff --git a/llvm/lib/Transforms/Vectorize/VecUtils.cpp b/llvm/lib/Transforms/Vectorize/VecUtils.cpp
index 7e9f12d43c7..3efaaf6edd1 100644
--- a/llvm/lib/Transforms/Vectorize/VecUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VecUtils.cpp
@@ -94,7 +94,7 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) {
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);
}
OpenPOWER on IntegriCloud