Skip to content

Commit 2580745

Browse files
committed
[ArgumentPromotion] Remove unnecessary getScalarType() before casting to PointerType. NFC
I don't believe this pass deals with vectors of pointers. I think this getScalarType() was added during a mechanical opaque pointer change of the interface to GetElementPtrInst::getIndexedType.
1 parent 4330d78 commit 2580745

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/ArgumentPromotion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ doPromotion(Function *F, SmallPtrSetImpl<Argument *> &ArgsToPromote,
196196
for (const auto &ArgIndex : ArgIndices) {
197197
// not allowed to dereference ->begin() if size() is 0
198198
Params.push_back(GetElementPtrInst::getIndexedType(
199-
cast<PointerType>(I->getType()->getScalarType())->getElementType(),
199+
cast<PointerType>(I->getType())->getElementType(),
200200
ArgIndex.second));
201201
ArgAttrVec.push_back(AttributeSet());
202202
assert(Params.back());

0 commit comments

Comments
 (0)