RegAlloc.Graph.Spill

ghc-7.0.4: The GHC API

RegAlloc.Graph.Spill

Description

When there aren't enough registers to hold all the vregs we have to spill some of those vregs to slots on the stack. This module is used modify the code to use those slots.

Synopsis

- regSpill :: Instruction instr => [LiveCmmTop instr] -> UniqSet Int -> UniqSet VirtualReg -> UniqSM ([LiveCmmTop instr], UniqSet Int, SpillStats)
- data SpillStats = SpillStats {
  - spillStoreLoad :: UniqFM (Reg, Int, Int)
  }
- accSpillSL :: (Num t3, Num t2) => (t1, t2, t3) -> (t, t2, t3) -> (t1, t2, t3)

# Documentation

regSpill

Arguments

:: Instruction instr |
=> [LiveCmmTop instr] | the code
-> UniqSet Int | available stack slots
-> UniqSet VirtualReg | the regs to spill
-> UniqSM ([LiveCmmTop instr], UniqSet Int, SpillStats) |

Spill all these virtual regs to stack slots.

TODO: See if we can split some of the live ranges instead of just globally spilling the virtual reg. This might make the spill cleaner's job easier.

TODO: On CISCy x86 and x86_64 we don't nessesarally have to add a mov instruction when making spills. If an instr is using a spilled virtual we may be able to address the spill slot directly.

data SpillStats

Constructors

SpillStats |
Fields spillStoreLoad :: UniqFM (Reg, Int, Int)

Instances

Outputable SpillStats |

accSpillSL :: (Num t3, Num t2) => (t1, t2, t3) -> (t, t2, t3) -> (t1, t2, t3)