nativeGen: Use `foldl'` instead of `foldr` in free register accumulation
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 24 Jan 2017 17:51:26 +0000 (12:51 -0500)
committerBen Gamari <ben@smart-cactus.org>
Tue, 24 Jan 2017 21:07:34 +0000 (16:07 -0500)
commitefc8e3b17bd374c5860081bd7350a1ce7c7cb92f
tree57c3b57fe2f649d7be466b249579c4391ac09a59
parentdeb75cbf6741d84859eb256f1773807b099ca12f
nativeGen: Use `foldl'` instead of `foldr` in free register accumulation

Manipulations of `FreeRegs` values are all just bit-operations on a
word. Turning these `foldr`s into `foldl'`s has a very small but consistent
effect on compiler allocations,
```
        -1 s.d.                -----          -0.065%
        +1 s.d.                -----          -0.018%
        Average                -----          -0.042%
```

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2966
compiler/nativeGen/RegAlloc/Linear/JoinToTargets.hs
compiler/nativeGen/RegAlloc/Linear/Main.hs
compiler/nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs
compiler/nativeGen/RegAlloc/Linear/SPARC/FreeRegs.hs
compiler/nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
compiler/nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs