diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-04-10 18:57:27 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-04-10 18:57:27 +0000 |
commit | 20cd5e68626ff1af698201fb34f86a59e15c2ff8 (patch) | |
tree | 641f78d06a9c9893f99c2d4bfae5730ef4565b91 | |
parent | b4d6a6574d3702e14e67be588b997f7dee68815a (diff) | |
download | external_llvm-20cd5e68626ff1af698201fb34f86a59e15c2ff8.zip external_llvm-20cd5e68626ff1af698201fb34f86a59e15c2ff8.tar.gz external_llvm-20cd5e68626ff1af698201fb34f86a59e15c2ff8.tar.bz2 |
We require DataLayout for analyzing the size of stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179206 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Vectorize/SLPVectorizer.cpp | 5 | ||||
-rw-r--r-- | lib/Transforms/Vectorize/VecUtils.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 4b61dc9..01b2b92 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/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/lib/Transforms/Vectorize/VecUtils.cpp b/lib/Transforms/Vectorize/VecUtils.cpp index 7e9f12d..3efaaf6 100644 --- a/lib/Transforms/Vectorize/VecUtils.cpp +++ b/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); } |