diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2016-05-23 21:57:54 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2016-05-23 21:57:54 +0000 |
commit | 312768009eb545e2f4c760b2426311cd3959f7b4 (patch) | |
tree | 8d2328537a7b36e3cfebe20113abc1301b9b6d91 | |
parent | 6c0183644255737ac16e13649b40afc0db718cd0 (diff) |
Avoid including AlwaysInliner pass in opt-bisect search.
Differential Revision: http://reviews.llvm.org/D19640
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270495 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Transforms/IPO/InlinerPass.h | 6 | ||||
-rw-r--r-- | lib/Transforms/IPO/InlineAlways.cpp | 3 | ||||
-rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Transforms/IPO/InlinerPass.h b/include/llvm/Transforms/IPO/InlinerPass.h index 9fc702646b4..e911f2e34a3 100644 --- a/include/llvm/Transforms/IPO/InlinerPass.h +++ b/include/llvm/Transforms/IPO/InlinerPass.h @@ -62,6 +62,12 @@ struct Inliner : public CallGraphSCCPass { /// 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; diff --git a/lib/Transforms/IPO/InlineAlways.cpp b/lib/Transforms/IPO/InlineAlways.cpp index e7623a96300..c403bbf8ecc 100644 --- a/lib/Transforms/IPO/InlineAlways.cpp +++ b/lib/Transforms/IPO/InlineAlways.cpp @@ -45,6 +45,9 @@ public: 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; diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 03d996a4d5d..a3956ad296f 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -368,7 +368,10 @@ static bool InlineHistoryIncludes(Function *F, int InlineHistoryID, 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(); |