import MachCode ( InstrBlock )
import MachMisc ( Instr(..) )
+import PprMach ( pprInstr ) -- Just for debugging
import MachRegs
import RegAllocInfo
--)
where
tryGeneral []
- = error "nativeGen: spilling failed. Workaround: compile with -fvia-C.\n"
+ = pprPanic "nativeGen: spilling failed. Workaround: compile with -fvia-C.\n"
+ ( (text "reserves = " <> ppr reserves)
+ $$
+ (text "code = ")
+ $$
+ (vcat (map pprInstr flatInstrs))
+ )
tryGeneral (resv:resvs)
= case generalAlloc resv of
Just success -> success
doGeneralAlloc all_regs reserve_regs instrs
-- succeeded without spilling
- | prespill_ok = Just prespill_insns
+ | prespill_ok
+ = Just prespill_insns
+
-- failed, and no spill regs avail, so pointless to attempt spilling
| null reserve_regs = Nothing
-- success after spilling