From 18c4c888d33dd374b82cc46b3ef568697022c64b Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 14 Aug 2009 14:10:40 +0200 Subject: [PATCH] Make some normalizations generate nonrecursive lets. --- "c\316\273ash/CLasH/Normalize.hs" | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index 9828d5c..9fe4ed1 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -107,7 +107,7 @@ castsimpl expr@(Cast val ty) = do -- Generate a binder for the expression id <- Trans.lift $ mkBinderFor val "castval" -- Extract the expression - change $ Let (Rec [(id, val)]) (Cast (Var id) ty) + change $ Let (NonRec id val) (Cast (Var id) ty) else return expr -- Leave all other expressions unchanged @@ -280,7 +280,7 @@ scrutsimpl expr@(Case scrut b ty alts) = do if repr then do id <- Trans.lift $ mkBinderFor scrut "scrut" - change $ Let (Rec [(id, scrut)]) (Case (Var id) b ty alts) + change $ Let (NonRec id scrut) (Case (Var id) b ty alts) else return expr -- Leave all other expressions unchanged @@ -414,7 +414,7 @@ appsimpl expr@(App f arg) = do if repr && not local_var then do -- Extract representable arguments id <- Trans.lift $ mkBinderFor arg "arg" - change $ Let (Rec [(id, arg)]) (App f (Var id)) + change $ Let (NonRec id arg) (App f (Var id)) else -- Leave non-representable arguments unchanged return expr -- Leave all other expressions unchanged -- 2.30.2