X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmOpt.hs;h=0a6c193546e38c42c471e9c95d9bd14cd4aaa9ca;hb=8a2809c29de9f23eba7ca682b48390033a9d40f6;hp=aa0c82180905adc0971446f68d5f9e92a5139f01;hpb=207802589da0d23c3f16195f453b24a1e46e322d;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs index aa0c821..0a6c193 100644 --- a/compiler/cmm/CmmOpt.hs +++ b/compiler/cmm/CmmOpt.hs @@ -18,7 +18,6 @@ import Cmm import CmmUtils import CLabel import MachOp -import SMRep import StaticFlags import UniqFM @@ -140,7 +139,7 @@ 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 uses _ = emptyUFM @@ -161,8 +160,8 @@ 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) - = CmmCall (infn target) regs es' +inlineStmt u a (CmmCall target regs es srt) + = CmmCall (infn target) regs es' srt where infn (CmmForeignCall fn cconv) = CmmForeignCall fn cconv infn (CmmPrim p) = CmmPrim p es' = [ (inlineExpr u a e, hint) | (e,hint) <- es ] @@ -531,7 +530,7 @@ narrowS _ _ = panic "narrowTo" except factorial, but what the hell. -} -cmmLoopifyForC :: CmmTop -> CmmTop +cmmLoopifyForC :: RawCmmTop -> RawCmmTop cmmLoopifyForC p@(CmmProc info entry_lbl [] blocks@(BasicBlock top_id _ : _)) | null info = p -- only if there's an info table, ignore case alts | otherwise =