Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/601c983dd0bada6b49bdadd8f172fd4eacac4b0c

>---------------------------------------------------------------

commit 601c983dd0bada6b49bdadd8f172fd4eacac4b0c
Author: Simon Peyton Jones <[email protected]>
Date:   Fri Jan 13 17:50:00 2012 +0000

    Add -faggressive-primops plus refactoring in CoreUtils
    
    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]
    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.
    
    So I wanted a new function CoreUtils.exprCertainlyTerminates.
    In doing this I ended up with a significant refactoring in
    CoreUtils.  The new structure has quite a lot of nice sharing:
    
        exprIsCheap             = exprIsCheap' isHNFApp
        exprIsExpandable        = exprIsCheap' isConLikeApp
    
        exprIsHNF               = exprIsHNFlike isHNFApp
        exprIsConLike           = exprIsHNFlike isConLikeApp
        exprCertainlyTerminates = exprIsHNFlike isTerminatingApp

 compiler/coreSyn/CoreArity.lhs    |    4 +-
 compiler/coreSyn/CoreUtils.lhs    |  237 ++++++++++++++++++++----------------
 compiler/main/StaticFlagParser.hs |    1 +
 compiler/main/StaticFlags.hs      |    6 +
 compiler/prelude/PrimOp.lhs       |   59 +++++++--
 compiler/simplCore/FloatIn.lhs    |   10 ++-
 compiler/simplCore/OccurAnal.lhs  |    4 +-
 compiler/simplCore/SimplUtils.lhs |   10 +-
 compiler/simplCore/Simplify.lhs   |   20 ++--
 9 files changed, 214 insertions(+), 137 deletions(-)


Diff suppressed because of size. To see it, use:

    git show 601c983dd0bada6b49bdadd8f172fd4eacac4b0c

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to