From a225f53c9ac84f9c325d498867e92b302cbac83a Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 14 Aug 2009 14:12:50 +0200 Subject: [PATCH] No longer add a top level let before normalization. This was previously required to ensure there was always a let on top level. However, since we are using nonrecursive lets now and use a splitNormalized instead of hard matching a Let constructor, there is no need for an (empty) let at the top anymore. --- "c\316\273ash/CLasH/Normalize.hs" | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index 9fe4ed1..6eee47b 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -587,15 +587,11 @@ normalizeExpr :: -> TranslatorSession CoreSyn.CoreExpr -- ^ The normalized expression normalizeExpr what expr = do - -- Introduce an empty Let at the top level, so there will always be - -- a let in the expression (none of the transformations will remove - -- the last let). - let expr' = Let (Rec []) expr -- Normalize this expression - trace (what ++ " before normalization:\n\n" ++ showSDoc ( ppr expr' ) ++ "\n") $ return () - expr'' <- dotransforms transforms expr' - trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr'')) $ return () - return expr'' + trace (what ++ " before normalization:\n\n" ++ showSDoc ( ppr expr ) ++ "\n") $ return () + expr' <- dotransforms transforms expr + trace ("\n" ++ what ++ " after normalization:\n\n" ++ showSDoc ( ppr expr')) $ return () + return expr' -- | Get the value that is bound to the given binder at top level. Fails when -- there is no such binding. -- 2.30.2