X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmLive.hs;h=078fcd36034709dbf7cf8eb44ec4aeae78329e85;hb=044ba2360d602a5d4e3dc709b91b21d184a37f64;hp=4fb4a29285c41e9ef46c6e19847ae971cee252ab;hpb=a6af1f12c4b83745dacf955ac2920897ec7ae145;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmLive.hs b/compiler/cmm/CmmLive.hs index 4fb4a29..078fcd3 100644 --- a/compiler/cmm/CmmLive.hs +++ b/compiler/cmm/CmmLive.hs @@ -1,3 +1,10 @@ +{-# 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/Commentary/CodingStyle#Warnings +-- for details + module CmmLive ( CmmLive, BlockEntryLiveness, @@ -7,6 +14,7 @@ module CmmLive ( #include "HsVersions.h" +import BlockId import Cmm import Dataflow @@ -129,6 +137,7 @@ cmmBlockUpdate blocks node _ state = ----------------------------------------------------------------------------- -- Section: ----------------------------------------------------------------------------- +----------------------------------------------------------------------------- -- CmmBlockLive, cmmStmtListLive and helpers ----------------------------------------------------------------------------- @@ -156,9 +165,7 @@ addKilled new_killed live = live `minusUniqSet` new_killed -- Liveness of a CmmStmt -------------------------------- cmmFormalsToLiveLocals :: CmmFormals -> [LocalReg] -cmmFormalsToLiveLocals [] = [] -cmmFormalsToLiveLocals ((CmmGlobal _,_):args) = cmmFormalsToLiveLocals args -cmmFormalsToLiveLocals ((CmmLocal r,_):args) = r:cmmFormalsToLiveLocals args +cmmFormalsToLiveLocals formals = map kindlessCmm formals cmmStmtLive :: BlockEntryLiveness -> CmmStmt -> CmmLivenessTransformer cmmStmtLive _ (CmmNop) = id @@ -171,13 +178,13 @@ cmmStmtLive _ (CmmAssign reg expr) = (CmmGlobal _) -> id cmmStmtLive _ (CmmStore expr1 expr2) = cmmExprLive expr2 . cmmExprLive expr1 -cmmStmtLive _ (CmmCall target results arguments) = +cmmStmtLive _ (CmmCall target results arguments _ _) = target_liveness . - foldr ((.) . cmmExprLive) id (map fst arguments) . + foldr ((.) . cmmExprLive) id (map kindlessCmm arguments) . addKilled (mkUniqSet $ cmmFormalsToLiveLocals results) where target_liveness = case target of - (CmmForeignCall target _) -> cmmExprLive target + (CmmCallee target _) -> cmmExprLive target (CmmPrim _) -> id cmmStmtLive other_live (CmmBranch target) = addLive (lookupWithDefaultUFM other_live emptyUniqSet target) @@ -191,9 +198,9 @@ cmmStmtLive other_live (CmmSwitch expr targets) = 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