Minor cleanup of foldRegs{Used,Defd}
authorMichal Terepeta <michal.terepeta@gmail.com>
Tue, 29 Nov 2016 18:31:28 +0000 (13:31 -0500)
committerBen Gamari <ben@smart-cactus.org>
Tue, 29 Nov 2016 19:39:55 +0000 (14:39 -0500)
commitda5a61eb15237d406e4d1fb4390d47602ee4c34c
tree9eae546b42ac12561da9fc67f066814977dc55ac
parent52222f9bf705ad64bc4a212088d153d8918b6173
Minor cleanup of foldRegs{Used,Defd}

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: Michal Terepeta <michal.terepeta@gmail.com>
Test Plan: validate

Reviewers: simonmar, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2723
compiler/cmm/CmmExpr.hs
compiler/cmm/CmmNode.hs