From 42a90e6017b04f218a398b46c331fb5a8336433d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 16 Sep 2022 09:32:02 -0700 Subject: [PATCH] [ModuleInliner] Remove a redundaunt variable (NFC) In the CGSCC inliner, DidInline was used as an indicator to update the call graph. In the module inliner, DidInline is always true at the end of the "while" loop, so can just drop it. --- llvm/lib/Transforms/IPO/ModuleInliner.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/llvm/lib/Transforms/IPO/ModuleInliner.cpp b/llvm/lib/Transforms/IPO/ModuleInliner.cpp index 15d6687..8ae9bc3 100644 --- a/llvm/lib/Transforms/IPO/ModuleInliner.cpp +++ b/llvm/lib/Transforms/IPO/ModuleInliner.cpp @@ -212,7 +212,6 @@ PreservedAnalyses ModuleInlinerPass::run(Module &M, // Now process as many calls as we have within this caller in the sequence. // We bail out as soon as the caller has to change so we can // prepare the context of that new caller. - bool DidInline = false; auto P = Calls->pop(); CallBase *CB = P.first; const int InlineHistoryID = P.second; @@ -245,7 +244,6 @@ PreservedAnalyses ModuleInlinerPass::run(Module &M, continue; } - DidInline = true; ++NumInlined; LLVM_DEBUG(dbgs() << " Size after inlining: " << F.getInstructionCount() @@ -305,8 +303,6 @@ PreservedAnalyses ModuleInlinerPass::run(Module &M, else Advice->recordInlining(); - if (!DidInline) - continue; Changed = true; } -- 2.7.4