import Data.Maybe
import Control.Monad
--- | The maximum number of build/spill cycles we'll allow.
+-- | The maximum number of build\/spill cycles we'll allow.
-- We should only need 3 or 4 cycles tops.
-- If we run for any longer than this we're probably in an infinite loop,
-- It's probably better just to bail out and report a bug at this stage.
-> UniqFM (UniqSet Reg) -- ^ the registers we can use for allocation
-> UniqSet Int -- ^ the set of available spill slots.
-> [LiveCmmTop] -- ^ code annotated with liveness information.
- -> UniqSM
- ( [NatCmmTop] -- ^ code with registers allocated.
- , [RegAllocStats] ) -- ^ stats for each stage of allocation
+ -> UniqSM ( [NatCmmTop], [RegAllocStats] )
+ -- ^ code with registers allocated and stats for each stage of
+ -- allocation
regAlloc dflags regsFree slotsFree code
= do