-> BlockId -- ^ id of the current block
-> instr -- ^ branch instr on the end of the source block.
- -> RegM ([NatBasicBlock instr] -- fresh blocks of fixup code.
+ -> RegM FreeRegs ([NatBasicBlock instr] -- fresh blocks of fixup code.
, instr) -- the original branch instruction, but maybe patched to jump
-- to a fixup block first.
-> [BlockId] -- ^ branch destinations still to consider.
- -> RegM ( [NatBasicBlock instr]
+ -> RegM FreeRegs ( [NatBasicBlock instr]
, instr)
-- no more targets to consider. all done.
_ -> let instr' = patchJumpInstr instr
(\bid -> if bid == dest
then mkBlockId fixup_block_id
- else dest)
+ else bid) -- no change!
in joinToTargets' block_live (block : new_blocks) block_id instr' dests
--
handleComponent
:: Instruction instr
- => Int -> instr -> SCC (Unique, Loc, [Loc]) -> RegM [instr]
+ => Int -> instr -> SCC (Unique, Loc, [Loc]) -> RegM FreeRegs [instr]
-- If the graph is acyclic then we won't get the swapping problem below.
-- In this case we can just do the moves directly, and avoid having to
-> Unique -- ^ unique of the vreg that we're moving.
-> Loc -- ^ source location.
-> Loc -- ^ destination location.
- -> RegM instr -- ^ move instruction.
+ -> RegM FreeRegs instr -- ^ move instruction.
makeMove _ vreg (InReg src) (InReg dst)
= do recordSpill (SpillJoinRR vreg)