summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-20 00:47:08 +0000
committerChris Lattner <sabre@nondot.org>2010-04-20 00:47:08 +0000
commit4471136e4db67f5b6cf064cb3b0a7668f15bfe6c (patch)
tree880242a4c56c1a49bf63eaa1536527db442bf942 /lib/Transforms/IPO/Inliner.cpp
parenteae220259fca393adc874ed41e3930011047beb7 (diff)
downloadllvm-4471136e4db67f5b6cf064cb3b0a7668f15bfe6c.tar.gz
llvm-4471136e4db67f5b6cf064cb3b0a7668f15bfe6c.tar.bz2
llvm-4471136e4db67f5b6cf064cb3b0a7668f15bfe6c.tar.xz
make the inliner do less work for leaf functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101846 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 07918543d4..6c732d21f2 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -333,6 +333,10 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
DEBUG(dbgs() << ": " << CallSites.size() << " call sites.\n");
+ // If there are no calls in this function, exit early.
+ if (CallSites.empty())
+ return false;
+
// Now that we have all of the call sites, move the ones to functions in the
// current SCC to the end of the list.
unsigned FirstCallInSCC = CallSites.size();