summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Opt.hs
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-11-27 22:53:25 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-12-08 22:43:21 -0500
commitaef44d7fbef92159960daf73c53dbc3c8d21ecbf (patch)
tree5233aa9a324585e53c5fbe4cfa3ed1128d91fcf1 /compiler/GHC/Cmm/Opt.hs
parent6e3da80055dd7b3fc3bdc576088fdd16129bdac7 (diff)
downloadhaskell-aef44d7fbef92159960daf73c53dbc3c8d21ecbf.tar.gz
Cmm.Sink: Optimize retaining of assignments, live sets.
Sinking requires us to track live local regs after each cmm statement. We used to do this via "Set LocalReg". However we can replace this with a solution based on IntSet which is overall more efficient without losing much. The thing we lose is width of the variables, which isn't used by the sinking pass anyway. I also reworked how we keep assignments to regs mentioned in skipped assignments. I put the details into Note [Keeping assignemnts mentioned in skipped RHSs]. The gist of it is instead of keeping track of it via the use count which is a `IntMap Int` we now use the live regs set (IntSet) which is quite a bit faster. I think it also matches the semantics a lot better. The skipped (not discarded) assignment does in fact keep the regs on it's rhs alive so keeping track of this in the live set seems like the clearer solution as well. Improves allocations for T3294 by yet another 1%.
Diffstat (limited to 'compiler/GHC/Cmm/Opt.hs')
0 files changed, 0 insertions, 0 deletions