-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -w #-}
-- The above warning supression flag is a temporary kludge.
-- While working on this module you are encouraged to remove it and fix
-- any warnings in the module. See
--- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings
+-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
-- for details
module CmmLive (
CmmLive,
BlockEntryLiveness,
cmmLiveness,
- cmmHintFormalsToLiveLocals,
+ cmmFormalsToLiveLocals,
) where
#include "HsVersions.h"
+import BlockId
import Cmm
import Dataflow
--------------------------------
-- Liveness of a CmmStmt
--------------------------------
-cmmHintFormalsToLiveLocals :: CmmHintFormals -> [LocalReg]
-cmmHintFormalsToLiveLocals formals = map fst formals
+cmmFormalsToLiveLocals :: CmmFormals -> [LocalReg]
+cmmFormalsToLiveLocals formals = map kindlessCmm formals
cmmStmtLive :: BlockEntryLiveness -> CmmStmt -> CmmLivenessTransformer
cmmStmtLive _ (CmmNop) = id
cmmExprLive expr2 . cmmExprLive expr1
cmmStmtLive _ (CmmCall target results arguments _ _) =
target_liveness .
- foldr ((.) . cmmExprLive) id (map fst arguments) .
- addKilled (mkUniqSet $ cmmHintFormalsToLiveLocals results) where
+ foldr ((.) . cmmExprLive) id (map kindlessCmm arguments) .
+ addKilled (mkUniqSet $ cmmFormalsToLiveLocals results) where
target_liveness =
case target of
(CmmCallee target _) -> cmmExprLive target
id
(mapCatMaybes id targets))
cmmStmtLive _ (CmmJump expr params) =
- const (cmmExprLive expr $ foldr ((.) . cmmExprLive) id (map fst params) $ emptyUniqSet)
+ const (cmmExprLive expr $ foldr ((.) . cmmExprLive) id (map kindlessCmm params) $ emptyUniqSet)
cmmStmtLive _ (CmmReturn params) =
- const (foldr ((.) . cmmExprLive) id (map fst params) $ emptyUniqSet)
+ const (foldr ((.) . cmmExprLive) id (map kindlessCmm params) $ emptyUniqSet)
--------------------------------
-- Liveness of a CmmExpr