[project @ 2001-02-27 17:15:53 by simonmar]
[ghc-hetmet.git] / ghc / compiler / simplCore / CSE.lhs
index c659230..66038f3 100644 (file)
@@ -14,7 +14,7 @@ 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
@@ -109,9 +109,7 @@ cseProgram dflags binds
   = do {
        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)
-               binds'  
+       endPass dflags "Common sub-expression"  Opt_D_dump_cse binds'   
     }
 
 cseBinds :: CSEnv -> [CoreBind] -> [CoreBind]
@@ -170,9 +168,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)