X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fcmm%2FCmmOpt.hs;h=37fc485991f0ff27ba56aaddd2fc5c1f7b1591e5;hb=ad94d40948668032189ad22a0ad741ac1f645f50;hp=4b2a488897ecc3b0858194cd49ea72226ac85381;hpb=f96e9aa0444de0e673b3c4055c6e43299639bc5b;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs index 4b2a488..37fc485 100644 --- a/compiler/cmm/CmmOpt.hs +++ b/compiler/cmm/CmmOpt.hs @@ -6,6 +6,13 @@ -- ----------------------------------------------------------------------------- +{-# 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/CodingStyle#Warnings +-- for details + module CmmOpt ( cmmMiniInline, cmmMachOpFold, @@ -18,7 +25,6 @@ import Cmm import CmmUtils import CLabel import MachOp -import SMRep import StaticFlags import UniqFM @@ -140,9 +146,9 @@ lookForInline u expr (stmt:stmts) getStmtUses :: CmmStmt -> UniqFM Int getStmtUses (CmmAssign _ e) = getExprUses e getStmtUses (CmmStore e1 e2) = plusUFM_C (+) (getExprUses e1) (getExprUses e2) -getStmtUses (CmmCall target _ es _) +getStmtUses (CmmCall target _ es _ _) = plusUFM_C (+) (uses target) (getExprsUses (map fst es)) - where uses (CmmForeignCall e _) = getExprUses e + where uses (CmmCallee e _) = getExprUses e uses _ = emptyUFM getStmtUses (CmmCondBranch e _) = getExprUses e getStmtUses (CmmSwitch e _) = getExprUses e @@ -161,9 +167,9 @@ getExprsUses es = foldr (plusUFM_C (+)) emptyUFM (map getExprUses es) inlineStmt :: Unique -> CmmExpr -> CmmStmt -> CmmStmt inlineStmt u a (CmmAssign r e) = CmmAssign r (inlineExpr u a e) inlineStmt u a (CmmStore e1 e2) = CmmStore (inlineExpr u a e1) (inlineExpr u a e2) -inlineStmt u a (CmmCall target regs es srt) - = CmmCall (infn target) regs es' srt - where infn (CmmForeignCall fn cconv) = CmmForeignCall fn cconv +inlineStmt u a (CmmCall target regs es srt ret) + = CmmCall (infn target) regs es' srt ret + where infn (CmmCallee fn cconv) = CmmCallee fn cconv infn (CmmPrim p) = CmmPrim p es' = [ (inlineExpr u a e, hint) | (e,hint) <- es ] inlineStmt u a (CmmCondBranch e d) = CmmCondBranch (inlineExpr u a e) d