Skip to content
  • Michal Terepeta's avatar
    Minor cleanup of foldRegs{Used,Defd} · da5a61eb
    Michal Terepeta authored and Ben Gamari's avatar Ben Gamari committed
    
    
    This makes the two functions strict in the accumulator - it seems that
    there are only two users of those functions: `CmmLive` and `CmmSink`
    and in both cases the strict fold fits better.
    
    The commit also removes a few unused functions (`filterRegsUsed`),
    instances (for `Maybe` and `RegSet`) and gets rid of unnecessary
    inculde of `HsVersions.h`.
    
    The performance effect of avoiding unnecessary thunks is mostly
    negligible, although we do allocate a tiny bit less (nofib's section
    on compile allocations):
    ```
    -1 s.d.                -----            -0.2%
    +1 s.d.                -----            -0.1%
    Average                -----            -0.2%
    ```
    
    Signed-off-by: default avatarMichal Terepeta <michal.terepeta@gmail.com>
    
    Test Plan: validate
    
    Reviewers: simonmar, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2723
    da5a61eb