summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Graph
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Graph')
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Coalesce.hs10
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Spill.hs10
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/SpillClean.hs7
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/SpillCost.hs6
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/Stats.hs3
5 files changed, 18 insertions, 18 deletions
diff --git a/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs b/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
index 556f91c228..1eaf00f3a2 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Coalesce.hs
@@ -12,7 +12,7 @@ import RegAlloc.Liveness
import Instruction
import Reg
-import Cmm
+import OldCmm
import Bag
import Digraph
import UniqFM
@@ -67,11 +67,11 @@ slurpJoinMovs
slurpJoinMovs live
= slurpCmm emptyBag live
where
- slurpCmm rs CmmData{} = rs
- slurpCmm rs (CmmProc _ _ _ sccs) = foldl' slurpBlock rs (flattenSCCs sccs)
- slurpBlock rs (BasicBlock _ instrs) = foldl' slurpLI rs instrs
+ slurpCmm rs CmmData{} = rs
+ slurpCmm rs (CmmProc _ _ sccs) = foldl' slurpBlock rs (flattenSCCs sccs)
+ slurpBlock rs (BasicBlock _ instrs) = foldl' slurpLI rs instrs
- slurpLI rs (LiveInstr _ Nothing) = rs
+ slurpLI rs (LiveInstr _ Nothing) = rs
slurpLI rs (LiveInstr instr (Just live))
| Just (r1, r2) <- takeRegRegMoveInstr instr
, elementOfUniqSet r1 $ liveDieRead live
diff --git a/compiler/nativeGen/RegAlloc/Graph/Spill.hs b/compiler/nativeGen/RegAlloc/Graph/Spill.hs
index 7e744e6337..4eabb3b0b4 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Spill.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Spill.hs
@@ -12,7 +12,7 @@ where
import RegAlloc.Liveness
import Instruction
import Reg
-import Cmm hiding (RegSet)
+import OldCmm hiding (RegSet)
import BlockId
import State
@@ -89,12 +89,12 @@ regSpill_top regSlotMap cmm
CmmData{}
-> return cmm
- CmmProc info label params sccs
+ CmmProc info label sccs
| LiveInfo static firstId mLiveVRegsOnEntry liveSlotsOnEntry <- info
-> do
-- We should only passed Cmms with the liveness maps filled in, but we'll
-- create empty ones if they're not there just in case.
- let liveVRegsOnEntry = fromMaybe emptyBlockEnv mLiveVRegsOnEntry
+ let liveVRegsOnEntry = fromMaybe mapEmpty mLiveVRegsOnEntry
-- The liveVRegsOnEntry contains the set of vregs that are live on entry to
-- each basic block. If we spill one of those vregs we remove it from that
@@ -103,7 +103,7 @@ regSpill_top regSlotMap cmm
-- reload instructions after we've done a successful allocation.
let liveSlotsOnEntry' :: Map BlockId (Set Int)
liveSlotsOnEntry'
- = foldBlockEnv patchLiveSlot liveSlotsOnEntry liveVRegsOnEntry
+ = mapFoldWithKey patchLiveSlot liveSlotsOnEntry liveVRegsOnEntry
let info'
= LiveInfo static firstId
@@ -113,7 +113,7 @@ regSpill_top regSlotMap cmm
-- Apply the spiller to all the basic blocks in the CmmProc.
sccs' <- mapM (mapSCCM (regSpill_block regSlotMap)) sccs
- return $ CmmProc info' label params sccs'
+ return $ CmmProc info' label sccs'
where -- | Given a BlockId and the set of registers live in it,
-- if registers in this block are being spilled to stack slots,
diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs b/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
index ef4f0887d9..38c33b708a 100644
--- a/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
@@ -33,7 +33,7 @@ import Instruction
import Reg
import BlockId
-import Cmm
+import OldCmm
import UniqSet
import UniqFM
import Unique
@@ -47,7 +47,6 @@ import Data.Set (Set)
import qualified Data.Map as Map
import qualified Data.Set as Set
-
--
type Slot = Int
@@ -291,10 +290,10 @@ cleanTopBackward cmm
CmmData{}
-> return cmm
- CmmProc info label params sccs
+ CmmProc info label sccs
| LiveInfo _ _ _ liveSlotsOnEntry <- info
-> do sccs' <- mapM (mapSCCM (cleanBlockBackward liveSlotsOnEntry)) sccs
- return $ CmmProc info label params sccs'
+ return $ CmmProc info label sccs'
cleanBlockBackward
diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
index 0dc25f58d2..330a410312 100644
--- a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
@@ -24,7 +24,7 @@ import Reg
import GraphBase
import BlockId
-import Cmm
+import OldCmm
import UniqFM
import UniqSet
import Digraph (flattenSCCs)
@@ -71,7 +71,7 @@ slurpSpillCostInfo cmm
= execState (countCmm cmm) zeroSpillCostInfo
where
countCmm CmmData{} = return ()
- countCmm (CmmProc info _ _ sccs)
+ countCmm (CmmProc info _ sccs)
= mapM_ (countBlock info)
$ flattenSCCs sccs
@@ -79,7 +79,7 @@ slurpSpillCostInfo cmm
-- the info table from the CmmProc
countBlock info (BasicBlock blockId instrs)
| LiveInfo _ _ (Just blockLive) _ <- info
- , Just rsLiveEntry <- lookupBlockEnv blockLive blockId
+ , Just rsLiveEntry <- mapLookup blockId blockLive
, rsLiveEntry_virt <- takeVirtuals rsLiveEntry
= countLIs rsLiveEntry_virt instrs
diff --git a/compiler/nativeGen/RegAlloc/Graph/Stats.hs b/compiler/nativeGen/RegAlloc/Graph/Stats.hs
index 51554d6953..5ff7bff91a 100644
--- a/compiler/nativeGen/RegAlloc/Graph/Stats.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/Stats.hs
@@ -27,7 +27,8 @@ import RegClass
import Reg
import TargetReg
-import Cmm
+import OldCmm
+import OldPprCmm()
import Outputable
import UniqFM
import UniqSet