State newtype has been moved to CLasH.HardwareTypes
[matthijs/master-project/cλash.git] / cλash / CLasH / Normalize.hs
index 647bd1902592c46db67c132a9ff744901a82b971..90cbbc70aad1b52730746facd4c7500e0ef3cba5 100644 (file)
@@ -170,7 +170,7 @@ letremoveunused expr@(Let (Rec binds) res) = do
       bound_exprs = map snd binds
       -- For each bind check if the bind is used by res or any of the bound
       -- expressions
-      dobind (bndr, _) = not $ any (expr_uses_binders [bndr]) (res:bound_exprs)
+      dobind (bndr, _) = any (expr_uses_binders [bndr]) (res:bound_exprs)
 -- Leave all other expressions unchanged
 letremoveunused expr = return expr
 letremoveunusedtop = everywhere ("letremoveunused", letremoveunused)
@@ -522,7 +522,7 @@ normalizeExpr what expr = do
       -- Normalize this expression
       trace ("Transforming " ++ what ++ "\nBefore:\n\n" ++ showSDoc ( ppr expr' ) ++ "\n") $ return ()
       expr'' <- dotransforms transforms expr'
-      trace ("\nAfter:\n\n" ++ showSDoc ( ppr expr')) $ return ()
+      trace ("\nAfter:\n\n" ++ showSDoc ( ppr expr'')) $ return ()
       return expr''
 
 -- | Get the value that is bound to the given binder at top level. Fails when