Skip to content

Commit

Permalink
[ArgumentPromotion] Fix -Wunused-but-set-variable after #78735
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jul 12, 2024
1 parent a00754b commit 9c92276
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,6 @@ static bool areTypesABICompatible(ArrayRef<Type *> Types, const Function &F,
/// calls the DoPromotion method.
static Function *promoteArguments(Function *F, FunctionAnalysisManager &FAM,
unsigned MaxElements, bool IsRecursive) {
// Due to complexity of handling cases where the SCC has more than one
// component. We want to limit argument promotion of recursive calls to
// just functions that directly call themselves.
bool IsSelfRecursive = false;
// Don't perform argument promotion for naked functions; otherwise we can end
// up removing parameters that are seemingly 'not used' as they are referred
// to in the assembly.
Expand Down Expand Up @@ -804,10 +800,8 @@ static Function *promoteArguments(Function *F, FunctionAnalysisManager &FAM,
if (CB->isMustTailCall())
return nullptr;

if (CB->getFunction() == F) {
if (CB->getFunction() == F)
IsRecursive = true;
IsSelfRecursive = true;
}
}

// Can't change signature of musttail caller
Expand Down

0 comments on commit 9c92276

Please sign in to comment.