projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Keep (and show) a count of applied transformations.
[matthijs/master-project/cλash.git]
/
cλash
/
CLasH
/
Normalize
/
NormalizeTools.hs
diff --git
a/cλash/CLasH/Normalize/NormalizeTools.hs
b/cλash/CLasH/Normalize/NormalizeTools.hs
index 09ae3f579485c946f311e020ccb55b514a5641ad..803fd958cec82637d8177194da570e89ecf40f2b 100644
(file)
--- a/
cλash/CLasH/Normalize/NormalizeTools.hs
+++ b/
cλash/CLasH/Normalize/NormalizeTools.hs
@@
-45,9
+45,11
@@
applyboth first (name, second) context expr = do
if Monoid.getAny $
-- trace ("Trying to apply transform " ++ name ++ " to:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n")
changed
if Monoid.getAny $
-- trace ("Trying to apply transform " ++ name ++ " to:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n")
changed
- then
+ then
do
-- trace ("Applying transform " ++ name ++ " to:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n"
-- trace ("Applying transform " ++ name ++ " to:\n" ++ showSDoc (nest 4 $ ppr expr') ++ "\nType: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr') ++ "\n"
+ -- ++ "Context: " ++ show context ++ "\n"
-- ++ "Result of applying " ++ name ++ ":\n" ++ showSDoc (nest 4 $ ppr expr'') ++ "\n" ++ "Type: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr'') ++ "\n" ) $
-- ++ "Result of applying " ++ name ++ ":\n" ++ showSDoc (nest 4 $ ppr expr'') ++ "\n" ++ "Type: \n" ++ (showSDoc $ nest 4 $ ppr $ CoreUtils.exprType expr'') ++ "\n" ) $
+ Trans.lift $ MonadState.modify tsTransformCounter (+1)
applyboth first (name, second) context expr''
else
-- trace ("No changes") $
applyboth first (name, second) context expr''
else
-- trace ("No changes") $
@@
-77,7
+79,7
@@
subeverywhere trans c (Let (Rec binds) expr) = do
return (b, e')
subeverywhere trans c (Lam x expr) = do
return (b, e')
subeverywhere trans c (Lam x expr) = do
- expr' <- trans (
Other
:c) expr
+ expr' <- trans (
LambdaBody
:c) expr
return $ Lam x expr'
subeverywhere trans c (Case scrut b t alts) = do
return $ Lam x expr'
subeverywhere trans c (Case scrut b t alts) = do