[commit: ghc] master: make the change to go_pap suggested in #4978. According to nofib, one (f43bede)
Simon Marlow
marlowsd at gmail.com
Tue May 24 15:13:16 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/f43bedeef3ecdf4d037a2484a0f0a3672ab60299
>---------------------------------------------------------------
commit f43bedeef3ecdf4d037a2484a0f0a3672ab60299
Author: Simon Marlow <marlowsd at gmail.com>
Date: Tue May 24 13:18:55 2011 +0100
make the change to go_pap suggested in #4978. According to nofib, one
program is improved quite dramatically (fft2 30% less allocation), and
everything else was unchanged.
>---------------------------------------------------------------
compiler/coreSyn/CoreUtils.lhs | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs
index a0a229f..4146b62 100644
--- a/compiler/coreSyn/CoreUtils.lhs
+++ b/compiler/coreSyn/CoreUtils.lhs
@@ -589,11 +589,9 @@ exprIsCheap' good_app other_expr -- Applications and variables
go _ _ = False
--------------
- go_pap args = all exprIsTrivial args
- -- For constructor applications and primops, check that all
- -- the args are trivial. We don't want to treat as cheap, say,
- -- (1:2:3:4:5:[])
- -- We'll put up with one constructor application, but not dozens
+ go_pap args = all (exprIsCheap' good_app) args
+ -- Used to be "all exprIsTrivial args" due to concerns about
+ -- duplicating nested constructor applications, but see #4978.
--------------
go_primop op args = primOpIsCheap op && all (exprIsCheap' good_app) args
More information about the Cvs-ghc
mailing list