X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmOpt.hs;h=9664b9bece3c00fd91427e84b8084f7fbb130f71;hb=022fc24719ba4b98b8d9f19bfe7f75dd0f19d585;hp=0a6c193546e38c42c471e9c95d9bd14cd4aaa9ca;hpb=33918805ffc2e2a6fc9ff74ae4ce55052151ba90;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs index 0a6c193..9664b9b 100644 --- a/compiler/cmm/CmmOpt.hs +++ b/compiler/cmm/CmmOpt.hs @@ -139,9 +139,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 @@ -160,9 +160,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