[llvm] 9c92276 - [ArgumentPromotion] Fix -Wunused-but-set-variable after #78735
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 22:55:42 PDT 2024
Author: Fangrui Song
Date: 2024-07-11T22:55:37-07:00
New Revision: 9c9227686bb052eec60ab95a4bd99c629cce22f6
URL: https://github.com/llvm/llvm-project/commit/9c9227686bb052eec60ab95a4bd99c629cce22f6
DIFF: https://github.com/llvm/llvm-project/commit/9c9227686bb052eec60ab95a4bd99c629cce22f6.diff
LOG: [ArgumentPromotion] Fix -Wunused-but-set-variable after #78735
Added:
Modified:
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index c5b909c533fb3..77dbf349df0df 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -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.
@@ -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
More information about the llvm-commits
mailing list