%
-% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
%************************************************************************
%* *
%* *
%************************************************************************
+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
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_`
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}
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
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}
get e
= satExpr e `thenSAT` \ e2 ->
returnSAT (e2, Nothing)
+-}
\end{code}
-