[commit: ghc] master: Add -faggressive-primops (745ec95)
Simon Peyton Jones
simonpj at microsoft.com
Fri Apr 27 18:32:47 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/745ec959ff647c3a455767d20f6f37e9a0cc65aa
>---------------------------------------------------------------
commit 745ec959ff647c3a455767d20f6f37e9a0cc65aa
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Apr 27 16:25:12 2012 +0100
Add -faggressive-primops
I'm experimenting with making GHC a bit more aggressive about
a) dropping case expressions if the result is unused
Simplify.rebuildCase, CaseElim equation
b) floating case expressions inwards
FloatIn.fiExpr, AnnCase
In both cases the new behaviour is gotten with a static (debug)
flag -faggressive-primops. The extra "aggression" is to allow
discarding and floating in for side-effecting operations. See
the new, extensive Note [PrimOp can_fail and has_side_effects]
and Note [Aggressive PrimOps] in PrimoOp.
When discarding a case with unused binders, in the lifted-type
case it's definitely ok if the scrutinee terminates; previously
we were checking exprOkForSpeculation, which is significantly
worse.
There's a related change to CoreUtils/CoreArity, but I'll put that
in the next commit.
compiler/main/StaticFlagParser.hs | 1 +
compiler/main/StaticFlags.hs | 6 ++++
compiler/prelude/PrimOp.lhs | 61 ++++++++++++++++++++++++++++--------
compiler/simplCore/FloatIn.lhs | 10 +++++-
compiler/simplCore/Simplify.lhs | 17 ++++++----
5 files changed, 73 insertions(+), 22 deletions(-)
Diff suppressed because of size. To see it, use:
git show 745ec959ff647c3a455767d20f6f37e9a0cc65aa
More information about the Cvs-ghc
mailing list