From: christiaanb Date: Tue, 8 Jun 2010 13:45:14 +0000 (+0200) Subject: Do not be overzealous with inlining results of polymorphic functions X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=c86f74b8af5fb3ca467c7a22fa2d14498b46fb1a;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Do not be overzealous with inlining results of polymorphic functions --- 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)