[commit: ghc] master: Major Call Arity rework (cb8a63c)
git at git.haskell.org
git at git.haskell.org
Wed Mar 5 15:04:54 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/cb8a63cb61af3cbc871b73071c6b894780f04cc5/ghc
>---------------------------------------------------------------
commit cb8a63cb61af3cbc871b73071c6b894780f04cc5
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Fri Feb 21 10:57:34 2014 +0100
Major Call Arity rework
This patch improves the call arity analysis in various ways.
Most importantly, it enriches the analysis result information so that
when looking at a call, we do not have to make a random choice about
what side we want to take the information from. Instead we can combine
the results in a way that does not lose valuable information.
To do so, besides the incoming arities, we store remember "what can be
called with what", i.e. an undirected graph between the (interesting)
free variables of an expression. Of course it makes combining the
results a bit more tricky (especially mutual recursion), but still
doable.
The actually implemation of the graph structure is abstractly put away
in a module of its own (UnVarGraph.hs)
The implementation is geared towards efficiently representing the graphs
that we need (which can contain large complete and large complete
bipartite graphs, which would be huge in other representations). If
someone feels like designing data structures: There is surely some
speed-up to be obtained by improving that data structure.
Additionally, the analysis now takes into account that if a RHS stays a
thunk, then its calls happen only once, even if the variables the RHS is
bound to is evaluated multiple times, or is part of a recursive group.
>---------------------------------------------------------------
cb8a63cb61af3cbc871b73071c6b894780f04cc5
compiler/ghc.cabal.in | 1 +
compiler/simplCore/CallArity.hs | 697 +++++++++++---------
compiler/utils/UnVarGraph.hs | 136 ++++
compiler/utils/UniqFM.lhs | 4 +
testsuite/tests/callarity/unittest/CallArity1.hs | 34 +-
.../tests/callarity/unittest/CallArity1.stderr | 27 +-
testsuite/tests/perf/compiler/all.T | 3 +-
7 files changed, 593 insertions(+), 309 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cb8a63cb61af3cbc871b73071c6b894780f04cc5
More information about the ghc-commits
mailing list