From 9c9227686bb052eec60ab95a4bd99c629cce22f6 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 11 Jul 2024 22:55:37 -0700 Subject: [PATCH] [ArgumentPromotion] Fix -Wunused-but-set-variable after #78735 --- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index c5b909c533fb39..77dbf349df0dfe 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -755,10 +755,6 @@ static bool areTypesABICompatible(ArrayRef 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