@@ -1167,7 +1167,7 @@ class BoUpSLP {
1167
1167
/// {{{i16, i16}, {i16, i16}}, {{i16, i16}, {i16, i16}}} and so on.
1168
1168
///
1169
1169
/// \returns number of elements in vector if isomorphism exists, 0 otherwise.
1170
- unsigned canMapToVector(Type *T, const DataLayout &DL ) const;
1170
+ unsigned canMapToVector(Type *T) const;
1171
1171
1172
1172
/// \returns True if the VectorizableTree is both tiny and not fully
1173
1173
/// vectorizable. We do not vectorize such trees.
@@ -6326,7 +6326,7 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
6326
6326
llvm_unreachable("Unexpected vectorization of the instructions.");
6327
6327
}
6328
6328
6329
- unsigned BoUpSLP::canMapToVector(Type *T, const DataLayout &DL ) const {
6329
+ unsigned BoUpSLP::canMapToVector(Type *T) const {
6330
6330
unsigned N = 1;
6331
6331
Type *EltTy = T;
6332
6332
@@ -6350,9 +6350,9 @@ unsigned BoUpSLP::canMapToVector(Type *T, const DataLayout &DL) const {
6350
6350
6351
6351
if (!isValidElementType(EltTy))
6352
6352
return 0;
6353
- uint64_t VTSize = DL. getTypeStoreSizeInBits(FixedVectorType::get(EltTy, N));
6353
+ uint64_t VTSize = DL-> getTypeStoreSizeInBits(FixedVectorType::get(EltTy, N));
6354
6354
if (VTSize < MinVecRegSize || VTSize > MaxVecRegSize ||
6355
- VTSize != DL. getTypeStoreSizeInBits(T))
6355
+ VTSize != DL-> getTypeStoreSizeInBits(T))
6356
6356
return 0;
6357
6357
return N;
6358
6358
}
@@ -6380,8 +6380,7 @@ bool BoUpSLP::canReuseExtract(ArrayRef<Value *> VL, Value *OpValue,
6380
6380
// We have to extract from a vector/aggregate with the same number of elements.
6381
6381
unsigned NElts;
6382
6382
if (E0->getOpcode() == Instruction::ExtractValue) {
6383
- const DataLayout &DL = E0->getModule()->getDataLayout();
6384
- NElts = canMapToVector(Vec->getType(), DL);
6383
+ NElts = canMapToVector(Vec->getType());
6385
6384
if (!NElts)
6386
6385
return false;
6387
6386
// Check if load can be rewritten as load of vector.
@@ -15569,8 +15568,7 @@ bool SLPVectorizerPass::tryToVectorize(ArrayRef<WeakTrackingVH> Insts,
15569
15568
15570
15569
bool SLPVectorizerPass::vectorizeInsertValueInst(InsertValueInst *IVI,
15571
15570
BasicBlock *BB, BoUpSLP &R) {
15572
- const DataLayout &DL = BB->getModule()->getDataLayout();
15573
- if (!R.canMapToVector(IVI->getType(), DL))
15571
+ if (!R.canMapToVector(IVI->getType()))
15574
15572
return false;
15575
15573
15576
15574
SmallVector<Value *, 16> BuildVectorOpds;
0 commit comments