• Simon Peyton Jones's avatar
    Avoid useless w/w split · c6faa42b
    Simon Peyton Jones authored
    This patch is just a tidy-up for the post-strictness-analysis
    worker wrapper split.  Consider
    
       f x = x
    
    Strictnesss analysis does not lead to a w/w split, so the
    obvious thing is to leave it 100% alone.  But actually, because
    the RHS is small, we ended up adding a StableUnfolding for it.
    
    There is some reason to do this if we choose /not/ do to w/w
    on the grounds that the function is small.  See
    Note [Don't w/w inline small non-loop-breaker things]
    
    But there is no reason if we would not have done w/w anyway.
    
    This patch just moves the conditional to later.  Easy.
    This does move some -ddump-simpl printouts around a bit.
    
    I also discovered that the previous code was overwritten an
    InlineCompulsory with InlineStable, which is utterly wrong.  That in
    turn meant that some default methods (marked InlineCompulsory)
    were getting their InlineCompulsory squashed. This patch fixes
    that bug --- but of course that does mean a bit more inlining!
    
    Metric Decrease:
        T9233
        T9675
    Metric Increase:
        T12707
        T11374
        T3064
        T4029
        T9872b
        T9872d
        haddock.Cabal
    c6faa42b
Code owners : Ben Gamari
Unfold.hs 63.2 KB