diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-01 01:15:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-01 01:15:56 +0000 |
commit | 6da12e6767100d3f874c2e05aae74e4fe24357b1 (patch) | |
tree | a5f7bba2ef08d7b62b56272dd74ecdf0bf133fb7 /lib/Analysis/IPA/CallGraphSCCPass.cpp | |
parent | 159528702aed7222cb30c3e8b55287e4ca8068cf (diff) | |
download | external_llvm-6da12e6767100d3f874c2e05aae74e4fe24357b1.zip external_llvm-6da12e6767100d3f874c2e05aae74e4fe24357b1.tar.gz external_llvm-6da12e6767100d3f874c2e05aae74e4fe24357b1.tar.bz2 |
Implement rdar://6295824 and PR6724 with two tiny changes
that can have a big effect :). The first is to enable the
iterative SCC passmanager juice that kicks in when the
scc passmgr detects that a function pass has devirtualized
a call. In this case, it will rerun all the passes it
manages on the SCC, up to the iteration count limit (4). This
is useful because a function pass may devirualize a call, and
we want the inliner to inline it, or pruneeh to infer stuff
about it, etc.
The second patch is to add *all* call sites to the
DevirtualizedCalls list the inliner uses. This list is
about to get renamed, but the jist of this is that the
inliner now reconsiders *all* inlined call sites as candidates
for further inlining. The intuition is this that in cases
like this:
f() { g(1); } g(int x) { h(x); }
We analyze this bottom up, and may decide that it isn't
profitable to inline H into G. Next step, we decide that it is
profitable to inline G into F, and do so, which means that F
now calls H. Even though the call from G -> H may not have been
profitable to inline, the call from F -> H may be (in this case
because a constant allows folding etc).
In my spot checks, this doesn't have a big impact on code. For
example, the LLC output for 252.eon grew from 0.02% (from
317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612
to 1520964 bytes). 252.eon never iterated in the SCC Passmgr,
176.gcc iterated at most 1 time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r-- | lib/Analysis/IPA/CallGraphSCCPass.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index 917aa99..288a7ef 100644 --- a/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -30,7 +30,7 @@ using namespace llvm; static cl::opt<unsigned> -MaxIterations("max-cg-scc-iterations", cl::ReallyHidden, cl::init(0)); +MaxIterations("max-cg-scc-iterations", cl::ReallyHidden, cl::init(4)); STATISTIC(MaxSCCIterations, "Maximum CGSCCPassMgr iterations on one SCC"); |