diff options
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 19b65e8e1f..1de7b0753d 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -383,11 +383,17 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) { if (!shouldInline(CS)) continue; - // Attempt to inline the function... + // Attempt to inline the function. if (!InlineCallIfPossible(CS, InlineInfo, InlinedArrayAllocas)) continue; ++NumInlined; + // If inlining this function devirtualized any call sites, throw them + // onto our worklist to process. They are useful inline candidates. + for (unsigned i = 0, e = InlineInfo.DevirtualizedCalls.size(); + i != e; ++i) + CallSites.push_back(CallSite(InlineInfo.DevirtualizedCalls[i])); + // Update the cached cost info with the inlined call. growCachedCostInfo(Caller, Callee); } |