summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-05-31 16:49:21 +0100
committerIan Lynagh <igloo@earth.li>2011-05-31 16:49:21 +0100
commitf705fdb20935feee6a9ee86f5c9ffac2ab262a34 (patch)
treee1e51cbd9e3941008f5c962dbb2e7ea5b5b23a95 /compiler/nativeGen/RegAlloc
parent0af06ed99ed56341adfdda4a92a0a36678780109 (diff)
downloadhaskell-f705fdb20935feee6a9ee86f5c9ffac2ab262a34.tar.gz
Add missing type sigs in nativeGen/RegAlloc/Linear/Main.hs
Diffstat (limited to 'compiler/nativeGen/RegAlloc')
-rw-r--r--compiler/nativeGen/RegAlloc/Linear/Main.hs37
1 files changed, 35 insertions, 2 deletions
diff --git a/compiler/nativeGen/RegAlloc/Linear/Main.hs b/compiler/nativeGen/RegAlloc/Linear/Main.hs
index 1e904aed22..8a8280eed5 100644
--- a/compiler/nativeGen/RegAlloc/Linear/Main.hs
+++ b/compiler/nativeGen/RegAlloc/Linear/Main.hs
@@ -1,4 +1,3 @@
-{-# OPTIONS -fno-warn-missing-signatures #-}
-----------------------------------------------------------------------------
--
-- The register allocator
@@ -179,6 +178,13 @@ linearRegAlloc first_id block_live sccs
return (blocks, stats)
+linearRA_SCCs :: (Instruction instr, Outputable instr)
+ => BlockId
+ -> BlockMap RegSet
+ -> [NatBasicBlock instr]
+ -> [SCC (LiveBasicBlock instr)]
+ -> RegM [NatBasicBlock instr]
+
linearRA_SCCs _ _ blocksAcc []
= return $ reverse blocksAcc
@@ -207,6 +213,15 @@ linearRA_SCCs first_id block_live blocksAcc (CyclicSCC blocks : sccs)
more sanity checking to guard against this eventuality.
-}
+process :: (Instruction instr, Outputable instr)
+ => BlockId
+ -> BlockMap RegSet
+ -> [GenBasicBlock (LiveInstr instr)]
+ -> [GenBasicBlock (LiveInstr instr)]
+ -> [[NatBasicBlock instr]]
+ -> Bool
+ -> RegM [[NatBasicBlock instr]]
+
process _ _ [] [] accum _
= return $ reverse accum
@@ -366,7 +381,14 @@ raInsn _ _ _ instr
= pprPanic "raInsn" (text "no match for:" <> ppr instr)
-
+genRaInsn :: (Instruction instr, Outputable instr)
+ => BlockMap RegSet
+ -> [instr]
+ -> BlockId
+ -> instr
+ -> [Reg]
+ -> [Reg]
+ -> RegM ([instr], [NatBasicBlock instr])
genRaInsn block_live new_instrs block_id instr r_dying w_dying =
case regUsageOfInstr instr of { RU read written ->
@@ -463,6 +485,7 @@ genRaInsn block_live new_instrs block_id instr r_dying w_dying =
-- -----------------------------------------------------------------------------
-- releaseRegs
+releaseRegs :: [Reg] -> RegM ()
releaseRegs regs = do
assig <- getAssigR
free <- getFreeRegsR
@@ -634,6 +657,16 @@ allocateRegsAndSpill reading keep spills alloc (r:rs)
-- reading is redundant with reason, but we keep it around because it's
-- convenient and it maintains the recursive structure of the allocator. -- EZY
+allocRegsAndSpill_spill :: (Instruction instr, Outputable instr)
+ => Bool
+ -> [VirtualReg]
+ -> [instr]
+ -> [RealReg]
+ -> VirtualReg
+ -> [VirtualReg]
+ -> UniqFM Loc
+ -> SpillLoc
+ -> RegM ([instr], [RealReg])
allocRegsAndSpill_spill reading keep spills alloc r rs assig spill_loc
= do
freeRegs <- getFreeRegsR