Skip to content

Commit

Permalink
[ArgumentPromotion] Remove unnecessary getScalarType() before casting…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
topperc committed Apr 23, 2020
1 parent 4330d78 commit 2580745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Expand Up @@ -196,7 +196,7 @@ doPromotion(Function *F, SmallPtrSetImpl<Argument *> &ArgsToPromote,
for (const auto &ArgIndex : ArgIndices) {
// not allowed to dereference ->begin() if size() is 0
Params.push_back(GetElementPtrInst::getIndexedType(
cast<PointerType>(I->getType()->getScalarType())->getElementType(),
cast<PointerType>(I->getType())->getElementType(),
ArgIndex.second));
ArgAttrVec.push_back(AttributeSet());
assert(Params.back());
Expand Down

0 comments on commit 2580745

Please sign in to comment.