X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FRegAlloc%2FGraph%2FSpill.hs;fp=compiler%2FnativeGen%2FRegAlloc%2FGraph%2FSpill.hs;h=10bd6690543ae36cefaccfd4b2e21f9eb00fd45c;hb=e17cf7ff32778f4e6b3622855f25426251e843d6;hp=f9a2586f5a8c5b83bea991996673ec918089c909;hpb=028c032b60567b8cd501e9d7248e4aa86088a19b;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegAlloc/Graph/Spill.hs b/compiler/nativeGen/RegAlloc/Graph/Spill.hs index f9a2586..10bd669 100644 --- a/compiler/nativeGen/RegAlloc/Graph/Spill.hs +++ b/compiler/nativeGen/RegAlloc/Graph/Spill.hs @@ -80,19 +80,11 @@ regSpill_instr => UniqFM Int -> LiveInstr instr -> SpillM [LiveInstr instr] --- | The thing we're spilling shouldn't already have spill or reloads in it -regSpill_instr _ SPILL{} - = panic "regSpill_instr: unexpected SPILL" - -regSpill_instr _ RELOAD{} - = panic "regSpill_instr: unexpected RELOAD" - - -regSpill_instr _ li@(Instr _ Nothing) +regSpill_instr _ li@(LiveInstr _ Nothing) = do return [li] regSpill_instr regSlotMap - (Instr instr (Just _)) + (LiveInstr instr (Just _)) = do -- work out which regs are read and written in this instr let RU rlRead rlWritten = regUsageOfInstr instr @@ -123,7 +115,7 @@ regSpill_instr regSlotMap -- final code let instrs' = prefixes - ++ [Instr instr3 Nothing] + ++ [LiveInstr instr3 Nothing] ++ postfixes return @@ -147,7 +139,7 @@ spillRead regSlotMap instr reg { stateSpillSL = addToUFM_C accSpillSL (stateSpillSL s) reg (reg, 0, 1) } return ( instr' - , ( [RELOAD slot nReg] + , ( [LiveInstr (RELOAD slot nReg) Nothing] , []) ) | otherwise = panic "RegSpill.spillRead: no slot defined for spilled reg" @@ -162,7 +154,7 @@ spillWrite regSlotMap instr reg return ( instr' , ( [] - , [SPILL nReg slot])) + , [LiveInstr (SPILL nReg slot) Nothing])) | otherwise = panic "RegSpill.spillWrite: no slot defined for spilled reg" @@ -175,8 +167,8 @@ spillModify regSlotMap instr reg { stateSpillSL = addToUFM_C accSpillSL (stateSpillSL s) reg (reg, 1, 1) } return ( instr' - , ( [RELOAD slot nReg] - , [SPILL nReg slot])) + , ( [LiveInstr (RELOAD slot nReg) Nothing] + , [LiveInstr (SPILL nReg slot) Nothing])) | otherwise = panic "RegSpill.spillModify: no slot defined for spilled reg"