Just loc ->
setAssigR (addToUFM (delFromUFM assig src) dst loc)
- -- we have elimianted this instruction
- freeregs <- getFreeRegsR
- assig <- getAssigR
+ -- we have eliminated this instruction
{-
+ freeregs <- getFreeRegsR
+ assig <- getAssigR
pprTrace "raInsn" (text "ELIMINATED: " <> docToSDoc (pprInstr instr) $$ ppr r_dying <+> ppr w_dying $$ text (show freeregs) $$ ppr assig) $ do
-}
return (new_instrs, [])
-- to spill. We just pick the first one that isn't used in
-- the current instruction for now.
- let (temp_to_push_out, my_reg) = myHead "regalloc" candidates2
-
+ let (temp_to_push_out, my_reg)
+ = case candidates2 of
+ [] -> panic "RegAllocLinear.allocRegsAndSpill: no spill candidates"
+ (x:_) -> x
+
(spill_insn, slot) <- spillR (RealReg my_reg) temp_to_push_out
let spill_store = (if reading then id else reverse)
[ COMMENT (fsLit "spill alloc")
return spills
-myHead s [] = panic s
-myHead _ (x:_) = x
-
-- -----------------------------------------------------------------------------
-- Joining a jump instruction to its targets