[project @ 2000-03-23 17:45:17 by simonpj]
[ghc-hetmet.git] / ghc / compiler / simplCore / SAT.lhs
index dbd4f54..ed76213 100644 (file)
@@ -1,5 +1,5 @@
 %
-% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
 %
 %************************************************************************
 %*                                                                     *
@@ -7,6 +7,8 @@
 %*                                                                     *
 %************************************************************************
 
+96/03: We aren't using the static-argument transformation right now.
+
 May be seen as removing invariants from loops:
 Arguments of recursive functions that do not change in recursive
 calls are removed from the recursion, which is done locally
@@ -36,24 +38,31 @@ Experimental Evidence: Heap: +/- 7%
                       Instrs: Always improves for 2 or more Static Args.
 
 \begin{code}
+module SAT ( doStaticArgs ) where
+
 #include "HsVersions.h"
 
-module SAT (
-       doStaticArgs
+import Panic   ( panic )
 
-       -- and to make the interface self-sufficient...
-    ) where
+doStaticArgs = panic "SAT.doStaticArgs (ToDo)"
+
+{- LATER: to end of file:
 
-import Maybes          ( Maybe(..) )
 import SATMonad
 import Util
 \end{code}
 
 \begin{code}
-doStaticArgs :: [CoreBinding] -> UniqSupply -> [CoreBinding]
+doStaticArgs :: [CoreBind] -> UniqSupply -> [CoreBind]
 
 doStaticArgs binds
-  = initSAT (mapSAT sat_bind binds)
+  = do {
+       beginPass "Static argument";
+       let { binds' = initSAT (mapSAT sat_bind binds) };
+       endPass "Static argument" 
+               False           -- No specific flag for dumping SAT
+               binds'
+    }
   where
     sat_bind (NonRec binder expr)
       = emptyEnvSAT  `thenSAT_`
@@ -67,7 +76,7 @@ doStaticArgs binds
     sat_bind (Rec pairs)
       = emptyEnvSAT            `thenSAT_`
        mapSAT satExpr rhss     `thenSAT` \ rhss' ->
-       returnSAT (Rec (binders `zip` rhss'))
+       returnSAT (Rec (zipEqual "doStaticArgs" binders rhss'))
       where
        (binders, rhss) = unzip pairs
 \end{code}
@@ -89,10 +98,6 @@ satExpr var@(Var v)
 
 satExpr lit@(Lit _) = returnSAT lit
 
-satExpr e@(Con con types args)
-  = mapSAT satAtom args            `thenSAT_`
-    returnSAT e
-
 satExpr e@(Prim prim ty args)
   = mapSAT satAtom args            `thenSAT_`
     returnSAT e
@@ -158,11 +163,11 @@ satExpr (Let (Rec binds) body)
     in
     satExpr body                   `thenSAT` \ body' ->
     mapSAT satExpr rhss                    `thenSAT` \ rhss' ->
-    returnSAT (Let (Rec (binders `zip` rhss')) body')
+    returnSAT (Let (Rec (zipEqual "satExpr:Rec" binders rhss')) body')
 
-satExpr (SCC cc expr)
+satExpr (Note note expr)
   = satExpr expr                   `thenSAT` \ expr2 ->
-    returnSAT (SCC cc expr2)
+    returnSAT (Note note expr2)
 \end{code}
 
 \begin{code}
@@ -205,5 +210,5 @@ getAppArgs app
     get e
       = satExpr e      `thenSAT` \ e2 ->
        returnSAT (e2, Nothing)
+-}
 \end{code}
-