[commit: ghc] master: cmm/CmmLayoutStack: avoid generating unnecessary reloads (6a2264d)
git at git.haskell.org
git at git.haskell.org
Mon Jun 19 12:16:22 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/6a2264d2bd47e993c43a592bd614ab7917184e22/ghc
>---------------------------------------------------------------
commit 6a2264d2bd47e993c43a592bd614ab7917184e22
Author: Michal Terepeta <michal.terepeta at gmail.com>
Date: Sun Jun 18 16:51:08 2017 -0400
cmm/CmmLayoutStack: avoid generating unnecessary reloads
This tries to be more precise when generating reloads of local
registers in proc points. Previously we'd reload all local registers
that were live. But we used liveness information that assumed local
registers survive native calls. For the purpose of reloading registers
this is an overapproximation and might lead to generating huge amounts
of unnecessary reloads (in case there's another proc point before the
register is used).
This change takes the approach of moving the generation of reloads to
a second pass over the Cmm, which allows to recompute the liveness and
can use the knowledge that local registers do *not* survive calls.
This leads to generating only useful reloads. For an extreme example
where this helps a lot please see T3294. This should also fix #7198
Finally, this re-introduces the code to do Cmm rewriting using in
`Dataflow` module (with the difference that we know operate on a whole
block at a time).
Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>
Reviewers: austin, bgamari, simonmar
Reviewed By: simonmar
Subscribers: kavon, rwbarton, thomie
GHC Trac Issues: #7198
Differential Revision: https://phabricator.haskell.org/D3586
>---------------------------------------------------------------
6a2264d2bd47e993c43a592bd614ab7917184e22
compiler/cmm/CmmLayoutStack.hs | 157 +++++++++++++++++++++++++++++-------
compiler/cmm/Hoopl/Dataflow.hs | 115 +++++++++++++++++++++++++-
testsuite/tests/perf/compiler/all.T | 19 +++--
3 files changed, 253 insertions(+), 38 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 6a2264d2bd47e993c43a592bd614ab7917184e22
More information about the ghc-commits
mailing list