X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FsimplCore%2FCSE.lhs;h=69b35be6c3abc8930247bd4654feb6f1658632af;hb=cbf5bb17365e9228f3f724b87f958982c4b66cba;hp=b2e124a52f2ce1d8df3c8a198801222196b5404c;hpb=9aa6d18bd696e8861fb8c3e065e49a989d2d67ac;p=ghc-hetmet.git diff --git a/ghc/compiler/simplCore/CSE.lhs b/ghc/compiler/simplCore/CSE.lhs index b2e124a..69b35be 100644 --- a/ghc/compiler/simplCore/CSE.lhs +++ b/ghc/compiler/simplCore/CSE.lhs @@ -14,12 +14,12 @@ import CmdLineOpts ( DynFlag(..), DynFlags, dopt ) import Id ( Id, idType ) import CoreUtils ( hashExpr, cheapEqExpr, exprIsBig, mkAltExpr ) import DataCon ( isUnboxedTupleCon ) -import Type ( splitTyConApp_maybe ) +import Type ( tyConAppArgs ) import Subst ( InScopeSet, uniqAway, emptyInScopeSet, extendInScopeSet, elemInScopeSet ) import CoreSyn import VarEnv -import CoreLint ( beginPass, endPass ) +import CoreLint ( showPass, endPass ) import Outputable import Util ( mapAccumL ) import UniqFM @@ -107,7 +107,7 @@ cseProgram :: DynFlags -> [CoreBind] -> IO [CoreBind] cseProgram dflags binds = do { - beginPass dflags "Common sub-expression"; + showPass dflags "Common sub-expression"; let { binds' = cseBinds emptyCSEnv binds }; endPass dflags "Common sub-expression" (dopt Opt_D_dump_cse dflags || dopt Opt_D_verbose_core2core dflags) @@ -170,9 +170,7 @@ cseAlts env scrut' bndr bndr' alts other -> (bndr', extendCSEnv env bndr' scrut') -- See "yet another wrinkle" -- map: scrut' -> bndr' - arg_tys = case splitTyConApp_maybe (idType bndr) of - Just (_, arg_tys) -> arg_tys - other -> pprPanic "cseAlts" (ppr bndr) + arg_tys = tyConAppArgs (idType bndr) cse_alt (DataAlt con, args, rhs) | not (null args || isUnboxedTupleCon con)