X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FRegLiveness.hs;h=039a5def31f366d349fb967b23bd46b43e8c86cf;hb=33770e2e376005ff14a1d16b89f32b0d474425e2;hp=9a23ef4129744823a0df27de23b797a453ee9507;hpb=e1ca482b971739838cb5aa46dbc5b17bdf5c97c4;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegLiveness.hs b/compiler/nativeGen/RegLiveness.hs index 9a23ef4..039a5de 100644 --- a/compiler/nativeGen/RegLiveness.hs +++ b/compiler/nativeGen/RegLiveness.hs @@ -30,6 +30,7 @@ module RegLiveness ( ) where +import BlockId import MachRegs import MachInstrs import PprMach @@ -204,7 +205,7 @@ slurpConflicts live = (consBag rsLiveEntry conflicts, moves) | otherwise - = error "RegLiveness.slurpBlock: bad block" + = panic "RegLiveness.slurpBlock: bad block" slurpLIs rsLive (conflicts, moves) [] = (consBag rsLive conflicts, moves) @@ -243,14 +244,14 @@ slurpConflicts live , moves) lis --- | For spill/reloads +-- | For spill\/reloads -- -- SPILL v1, slot1 -- ... -- RELOAD slot1, v2 -- -- If we can arrange that v1 and v2 are allocated to the same hreg it's more likely --- the spill/reload instrs can be cleaned and replaced by a nop reg-reg move. +-- the spill\/reload instrs can be cleaned and replaced by a nop reg-reg move. -- -- slurpReloadCoalesce :: LiveCmmTop -> Bag (Reg, Reg) @@ -501,7 +502,7 @@ regLiveness (CmmProc info lbl params (ListGraph blocks@(first : _))) sccBlocks :: [NatBasicBlock] -> [SCC NatBasicBlock] -sccBlocks blocks = stronglyConnComp graph +sccBlocks blocks = stronglyConnCompFromEdgedVertices graph where getOutEdges :: [Instr] -> [BlockId] getOutEdges instrs = foldl' (\a x -> jumpDests x a) [] instrs @@ -557,7 +558,7 @@ livenessSCCs blockmap done concatMap tail $ groupBy (\(a1, _) (a2, _) -> eq a1 a2) $ iterate (\(a, _) -> f a b) $ - (a, error "RegisterAlloc.livenessSCCs") + (a, panic "RegLiveness.livenessSCCs") linearLiveness :: BlockMap RegSet -> [NatBasicBlock]