summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Liveness.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-02 16:23:22 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-04 16:24:59 -0400
commit89ce7cdf977304cb7d0f325a013f822600c1bfbf (patch)
treebaa862e1bfc0f2dab23c70353a190cc6e67d7e9d /compiler/GHC/Cmm/Liveness.hs
parent1d6d648866da9e7754859c48235f8009b8c130fd (diff)
downloadhaskell-89ce7cdf977304cb7d0f325a013f822600c1bfbf.tar.gz
DynFlags: use Platform in foldRegs*
Diffstat (limited to 'compiler/GHC/Cmm/Liveness.hs')
-rw-r--r--compiler/GHC/Cmm/Liveness.hs34
1 files changed, 17 insertions, 17 deletions
diff --git a/compiler/GHC/Cmm/Liveness.hs b/compiler/GHC/Cmm/Liveness.hs
index c8b7993736..0ec38509ba 100644
--- a/compiler/GHC/Cmm/Liveness.hs
+++ b/compiler/GHC/Cmm/Liveness.hs
@@ -14,7 +14,7 @@ where
import GHC.Prelude
-import GHC.Driver.Session
+import GHC.Platform
import GHC.Cmm.BlockId
import GHC.Cmm
import GHC.Cmm.Ppr.Expr () -- For Outputable instances
@@ -52,17 +52,17 @@ type BlockEntryLiveness r = LabelMap (CmmLive r)
-- | Calculated liveness info for a CmmGraph
-----------------------------------------------------------------------------
-cmmLocalLiveness :: DynFlags -> CmmGraph -> BlockEntryLiveness LocalReg
-cmmLocalLiveness dflags graph =
- check $ analyzeCmmBwd liveLattice (xferLive dflags) graph mapEmpty
+cmmLocalLiveness :: Platform -> CmmGraph -> BlockEntryLiveness LocalReg
+cmmLocalLiveness platform graph =
+ check $ analyzeCmmBwd liveLattice (xferLive platform) graph mapEmpty
where
entry = g_entry graph
check facts =
noLiveOnEntry entry (expectJust "check" $ mapLookup entry facts) facts
-cmmGlobalLiveness :: DynFlags -> CmmGraph -> BlockEntryLiveness GlobalReg
-cmmGlobalLiveness dflags graph =
- analyzeCmmBwd liveLattice (xferLive dflags) graph mapEmpty
+cmmGlobalLiveness :: Platform -> CmmGraph -> BlockEntryLiveness GlobalReg
+cmmGlobalLiveness platform graph =
+ analyzeCmmBwd liveLattice (xferLive platform) graph mapEmpty
-- | On entry to the procedure, there had better not be any LocalReg's live-in.
noLiveOnEntry :: BlockId -> CmmLive LocalReg -> a -> a
@@ -72,10 +72,10 @@ noLiveOnEntry bid in_fact x =
gen_kill
:: (DefinerOfRegs r n, UserOfRegs r n)
- => DynFlags -> n -> CmmLive r -> CmmLive r
-gen_kill dflags node set =
- let !afterKill = foldRegsDefd dflags deleteFromRegSet set node
- in foldRegsUsed dflags extendRegSet afterKill node
+ => Platform -> n -> CmmLive r -> CmmLive r
+gen_kill platform node set =
+ let !afterKill = foldRegsDefd platform deleteFromRegSet set node
+ in foldRegsUsed platform extendRegSet afterKill node
{-# INLINE gen_kill #-}
xferLive
@@ -85,10 +85,10 @@ xferLive
, UserOfRegs r (CmmNode O C)
, DefinerOfRegs r (CmmNode O C)
)
- => DynFlags -> TransferFun (CmmLive r)
-xferLive dflags (BlockCC eNode middle xNode) fBase =
- let joined = gen_kill dflags xNode $! joinOutFacts liveLattice xNode fBase
- !result = foldNodesBwdOO (gen_kill dflags) middle joined
+ => Platform -> TransferFun (CmmLive r)
+xferLive platform (BlockCC eNode middle xNode) fBase =
+ let joined = gen_kill platform xNode $! joinOutFacts liveLattice xNode fBase
+ !result = foldNodesBwdOO (gen_kill platform) middle joined
in mapSingleton (entryLabel eNode) result
-{-# SPECIALIZE xferLive :: DynFlags -> TransferFun (CmmLive LocalReg) #-}
-{-# SPECIALIZE xferLive :: DynFlags -> TransferFun (CmmLive GlobalReg) #-}
+{-# SPECIALIZE xferLive :: Platform -> TransferFun (CmmLive LocalReg) #-}
+{-# SPECIALIZE xferLive :: Platform -> TransferFun (CmmLive GlobalReg) #-}