From 25807452ac1bca643bdc00f7555e9cad03097b0e Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 22 Apr 2020 22:21:54 -0700 Subject: [PATCH] [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. --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index e5b0125..05aa497 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -196,7 +196,7 @@ doPromotion(Function *F, SmallPtrSetImpl &ArgsToPromote, for (const auto &ArgIndex : ArgIndices) { // not allowed to dereference ->begin() if size() is 0 Params.push_back(GetElementPtrInst::getIndexedType( - cast(I->getType()->getScalarType())->getElementType(), + cast(I->getType())->getElementType(), ArgIndex.second)); ArgAttrVec.push_back(AttributeSet()); assert(Params.back()); -- 2.7.4