patch applied (ghc): Improve optimisation of cost centres
Simon Peyton Jones
simonpj at microsoft.com
Fri Sep 11 08:01:03 EDT 2009
Fri Sep 11 04:56:30 PDT 2009 simonpj at microsoft.com
* Improve optimisation of cost centres
Ignore-this: 9964cfe9d39b12eb10724cd1f3fee6b5
This patch fixes test failures for the profiling way for drv001.
The problem was that the arity of a function was decreasing during
"optimisation" because of interaction with SCC annotations.
In particular
f = /\a. scc "f" (h x) -- where h had arity 2
and h gets inlined, led to
f = /\a. scc "f" let v = scc "f" x in \y. <blah>
Two main changes:
1. exprIsTrivial now says True for (scc "f" x)
See Note [SCCs are trivial] in CoreUtils
2. The simplifier eliminates nested pushing of the same cost centre:
scc "f" (...(scc "f" e)...)
==> scc "f" (...e...)
M ./compiler/coreSyn/CoreUtils.lhs -7 +12
M ./compiler/profiling/CostCentre.lhs -1 +8
M ./compiler/simplCore/Simplify.lhs -1 +4
View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20090911115630-1287e-df6fb875ff122027b48d9c9cd3e0dab3d9fd85a5.gz
More information about the Cvs-ghc
mailing list