[llvm] r270495 - Avoid including AlwaysInliner pass in opt-bisect search.
Andrew Kaylor via llvm-commits
llvm-commits at lists.llvm.org
Mon May 23 14:57:55 PDT 2016
Author: akaylor
Date: Mon May 23 16:57:54 2016
New Revision: 270495
URL: http://llvm.org/viewvc/llvm-project?rev=270495&view=rev
Log:
Avoid including AlwaysInliner pass in opt-bisect search.
Differential Revision: http://reviews.llvm.org/D19640
Modified:
llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
Modified: llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h?rev=270495&r1=270494&r2=270495&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h Mon May 23 16:57:54 2016
@@ -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;
Modified: llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp?rev=270495&r1=270494&r2=270495&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/InlineAlways.cpp Mon May 23 16:57:54 2016
@@ -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;
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=270495&r1=270494&r2=270495&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Mon May 23 16:57:54 2016
@@ -368,7 +368,10 @@ static bool InlineHistoryIncludes(Functi
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();
More information about the llvm-commits
mailing list