Skip to content

Commit 94e8675

Browse files
author
Valery Dmitriev
authored
[NFC][SLP] Remove unnecessary DL argument (llvm#72674)
1 parent 573c4db commit 94e8675

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ class BoUpSLP {
11671167
/// {{{i16, i16}, {i16, i16}}, {{i16, i16}, {i16, i16}}} and so on.
11681168
///
11691169
/// \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;
11711171

11721172
/// \returns True if the VectorizableTree is both tiny and not fully
11731173
/// vectorizable. We do not vectorize such trees.
@@ -6326,7 +6326,7 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
63266326
llvm_unreachable("Unexpected vectorization of the instructions.");
63276327
}
63286328

6329-
unsigned BoUpSLP::canMapToVector(Type *T, const DataLayout &DL) const {
6329+
unsigned BoUpSLP::canMapToVector(Type *T) const {
63306330
unsigned N = 1;
63316331
Type *EltTy = T;
63326332

@@ -6350,9 +6350,9 @@ unsigned BoUpSLP::canMapToVector(Type *T, const DataLayout &DL) const {
63506350

63516351
if (!isValidElementType(EltTy))
63526352
return 0;
6353-
uint64_t VTSize = DL.getTypeStoreSizeInBits(FixedVectorType::get(EltTy, N));
6353+
uint64_t VTSize = DL->getTypeStoreSizeInBits(FixedVectorType::get(EltTy, N));
63546354
if (VTSize < MinVecRegSize || VTSize > MaxVecRegSize ||
6355-
VTSize != DL.getTypeStoreSizeInBits(T))
6355+
VTSize != DL->getTypeStoreSizeInBits(T))
63566356
return 0;
63576357
return N;
63586358
}
@@ -6380,8 +6380,7 @@ bool BoUpSLP::canReuseExtract(ArrayRef<Value *> VL, Value *OpValue,
63806380
// We have to extract from a vector/aggregate with the same number of elements.
63816381
unsigned NElts;
63826382
if (E0->getOpcode() == Instruction::ExtractValue) {
6383-
const DataLayout &DL = E0->getModule()->getDataLayout();
6384-
NElts = canMapToVector(Vec->getType(), DL);
6383+
NElts = canMapToVector(Vec->getType());
63856384
if (!NElts)
63866385
return false;
63876386
// Check if load can be rewritten as load of vector.
@@ -15569,8 +15568,7 @@ bool SLPVectorizerPass::tryToVectorize(ArrayRef<WeakTrackingVH> Insts,
1556915568

1557015569
bool SLPVectorizerPass::vectorizeInsertValueInst(InsertValueInst *IVI,
1557115570
BasicBlock *BB, BoUpSLP &R) {
15572-
const DataLayout &DL = BB->getModule()->getDataLayout();
15573-
if (!R.canMapToVector(IVI->getType(), DL))
15571+
if (!R.canMapToVector(IVI->getType()))
1557415572
return false;
1557515573

1557615574
SmallVector<Value *, 16> BuildVectorOpds;

0 commit comments

Comments
 (0)