From c86f74b8af5fb3ca467c7a22fa2d14498b46fb1a Mon Sep 17 00:00:00 2001 From: christiaanb Date: Tue, 8 Jun 2010 15:45:14 +0200 Subject: [PATCH] Do not be overzealous with inlining results of polymorphic functions --- clash/CLasH/Normalize.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clash/CLasH/Normalize.hs b/clash/CLasH/Normalize.hs index 4ce4ffa..a70829a 100644 --- a/clash/CLasH/Normalize.hs +++ b/clash/CLasH/Normalize.hs @@ -753,7 +753,7 @@ inlinenonrepresult :: Transform -- that is fully applied (i.e., dos not have a function type) but is not -- representable. We apply in any context, since non-representable -- expressions are generally left alone and can occur anywhere. -inlinenonrepresult context expr | not (is_fun expr) = +inlinenonrepresult context expr | not (is_applicable expr) && not (has_free_tyvars expr) = case collectArgs expr of (Var f, args) | not (Id.isDictId f) -> do repr <- isRepr expr @@ -952,7 +952,7 @@ letmerge c expr = return expr -- What transforms to run? transforms = [ ("inlinedict", inlinedict) , ("inlinetoplevel", inlinetoplevel) - -- , ("inlinenonrepresult", inlinenonrepresult) + , ("inlinenonrepresult", inlinenonrepresult) , ("knowncase", knowncase) , ("classopresolution", classopresolution) , ("argprop", argprop) -- 2.30.2