[llvm] 42a90e6 - [ModuleInliner] Remove a redundaunt variable (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 16 09:32:12 PDT 2022


Author: Kazu Hirata
Date: 2022-09-16T09:32:02-07:00
New Revision: 42a90e6017b04f218a398b46c331fb5a8336433d

URL: https://github.com/llvm/llvm-project/commit/42a90e6017b04f218a398b46c331fb5a8336433d
DIFF: https://github.com/llvm/llvm-project/commit/42a90e6017b04f218a398b46c331fb5a8336433d.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/ModuleInliner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/ModuleInliner.cpp b/llvm/lib/Transforms/IPO/ModuleInliner.cpp
index 15d6687a2f43..8ae9bc3aa1de 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;
   }
 


        


More information about the llvm-commits mailing list