[project @ 2001-10-17 16:08:35 by simonpj]
[ghc-hetmet.git] / ghc / compiler / simplCore / CSE.lhs
index 69b35be..310e36e 100644 (file)
@@ -10,7 +10,7 @@ module CSE (
 
 #include "HsVersions.h"
 
-import CmdLineOpts     ( DynFlag(..), DynFlags, dopt )
+import CmdLineOpts     ( DynFlag(..), DynFlags )
 import Id              ( Id, idType )
 import CoreUtils       ( hashExpr, cheapEqExpr, exprIsBig, mkAltExpr )
 import DataCon         ( isUnboxedTupleCon )
@@ -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]
@@ -222,6 +220,8 @@ lookup_list ((x,e):es) expr | cheapEqExpr e expr = Just x
 
 addCSEnvItem env id expr | exprIsBig expr = env
                         | otherwise      = extendCSEnv env id expr
+   -- We don't try to CSE big expressions, because they are expensive to compare
+   -- (and are unlikely to be the same anyway)
 
 extendCSEnv (CS cs in_scope sub) id expr
   = CS (addToUFM_C combine cs hash [(id, expr)]) in_scope sub