From: Matthijs Kooijman Date: Tue, 6 Apr 2010 17:44:57 +0000 (+0200) Subject: Make top level inlining handle non-representable results gracefully. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=commitdiff_plain;h=18fd422156a76abe065036b28a672f5e6077bde4 Make top level inlining handle non-representable results gracefully. Since it does not know (nor care) if the function result is representable, it now uses splitNormalizedNonRep and checks if the result is a Var afterwards. --- diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index 8e6926a..620482f 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -358,10 +358,10 @@ needsInline f = do case norm_maybe of -- Noth normalizeable Nothing -> return Nothing - Just norm -> case splitNormalized norm of + Just norm -> case splitNormalizedNonRep norm of -- The function has just a single binding, so that's simple -- enough to inline. - (args, [bind], res) -> return $ Just norm + (args, [bind], Var res) -> return $ Just norm -- More complicated function, don't inline _ -> return Nothing