[ModuleInliner] Remove a redundaunt variable (NFC)
authorKazu Hirata <kazu@google.com>
Fri, 16 Sep 2022 16:32:02 +0000 (09:32 -0700)
committerKazu Hirata <kazu@google.com>
Fri, 16 Sep 2022 16:32:02 +0000 (09:32 -0700)
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

index 15d6687..8ae9bc3 100644 (file)
@@ -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;
   }