We require DataLayout for analyzing the size of stores.

llvm-svn: 179206
This commit is contained in:
Nadav Rotem 2013-04-10 18:57:27 +00:00
parent 53eb7d7984
commit 88dd5f7a38
2 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -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);
}