summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-01-12 22:11:50 +0000
committerDale Johannesen <dalej@apple.com>2009-01-12 22:11:50 +0000
commit433a9086c0327fc87281b5c9de4960ea05b7a177 (patch)
treeb857db93915622497856df7b4c9e47a1ecdeb0c6 /llvm/lib/Transforms/IPO
parent7e90422e951563092561db564cf11e7fd179d660 (diff)
downloadbcm5719-llvm-433a9086c0327fc87281b5c9de4960ea05b7a177.tar.gz
bcm5719-llvm-433a9086c0327fc87281b5c9de4960ea05b7a177.zip
Enable recursive inlining. Reduce inlining threshold
back to 200; 400 seems to be too high, loses more than it gains. llvm-svn: 62107
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 65c0ace6063..8d40c9beef4 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -31,8 +31,8 @@ STATISTIC(NumInlined, "Number of functions inlined");
STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
static cl::opt<int>
-InlineLimit("inline-threshold", cl::Hidden, cl::init(400),
- cl::desc("Control the amount of inlining to perform (default = 400)"));
+InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
+ cl::desc("Control the amount of inlining to perform (default = 200)"));
Inliner::Inliner(void *ID)
: CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {}
@@ -168,8 +168,7 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
for (unsigned CSi = 0; CSi != CallSites.size(); ++CSi)
if (Function *Callee = CallSites[CSi].getCalledFunction()) {
// Calls to external functions are never inlinable.
- if (Callee->isDeclaration() ||
- CallSites[CSi].getInstruction()->getParent()->getParent() ==Callee){
+ if (Callee->isDeclaration()) {
if (SCC.size() == 1) {
std::swap(CallSites[CSi], CallSites.back());
CallSites.pop_back();
@@ -190,7 +189,8 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
if (InlineCallIfPossible(CS, CG, SCCFunctions,
getAnalysis<TargetData>())) {
// Remove any cached cost info for this caller, as inlining the callee
- // has increased the size of the caller.
+ // has increased the size of the caller (which may be the same as the
+ // callee).
resetCachedCostInfo(Caller);
// Remove this call site from the list. If possible, use
OpenPOWER on IntegriCloud