• Simon Peyton Jones's avatar
    Add -faggressive-primops · 745ec959
    Simon Peyton Jones authored
    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.
    745ec959
StaticFlags.hs 17.3 KB