[PATCH] D19640: Update opt-bisect code to avoid skipping AlwaysInliner

Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 15:04:17 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL270495: Avoid including AlwaysInliner pass in opt-bisect search. (authored by akaylor).

Changed prior to commit:
  http://reviews.llvm.org/D19640?vs=58122&id=58159#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19640

Files:
  llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
  llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
  llvm/trunk/lib/Transforms/IPO/Inliner.cpp

Index: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
===================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
+++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
@@ -62,6 +62,12 @@
   /// deal with that subset of the functions.
   bool removeDeadFunctions(CallGraph &CG, bool AlwaysInlineOnly = false);
 
+  /// This function performs the main work of the pass.  The default
+  /// of Inlinter::runOnSCC() calls skipSCC() before calling this method, but
+  /// derived classes which cannot be skipped can override that method and
+  /// call this function unconditionally.
+  bool inlineCalls(CallGraphSCC &SCC);
+
 private:
   // InsertLifetime - Insert @llvm.lifetime intrinsics.
   bool InsertLifetime;
Index: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp
@@ -368,7 +368,10 @@
 bool Inliner::runOnSCC(CallGraphSCC &SCC) {
   if (skipSCC(SCC))
     return false;
+  return inlineCalls(SCC);
+}
 
+bool Inliner::inlineCalls(CallGraphSCC &SCC) {
   CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
   ACT = &getAnalysis<AssumptionCacheTracker>();
   auto &TLI = getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
Index: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
+++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
@@ -45,6 +45,9 @@
     initializeAlwaysInlinerPass(*PassRegistry::getPassRegistry());
   }
 
+  /// Main run interface method.  We override here to avoid calling skipSCC().
+  bool runOnSCC(CallGraphSCC &SCC) override { return inlineCalls(SCC); }
+
   static char ID; // Pass identification, replacement for typeid
 
   InlineCost getInlineCost(CallSite CS) override;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19640.58159.patch
Type: text/x-patch
Size: 1963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160523/53987b12/attachment.bin>


More information about the llvm-commits mailing list