X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FNormalize.hs;h=6a4825d42406343c5b6eb94191fdaf5b4ed554e0;hb=7d60f355a116d10adef0a66370d8bfa6a859e8b2;hp=07ded20bbb8d387c38372f749c9c79789d38cdbf;hpb=78793ddabc41998c386589564d6c47411279b29f;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git "a/c\316\273ash/CLasH/Normalize.hs" "b/c\316\273ash/CLasH/Normalize.hs" index 07ded20..6a4825d 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -146,6 +146,9 @@ letderectop = everywhere ("letderec", letderec) -- let simplification -------------------------------- letsimpl, letsimpltop :: Transform +-- Don't simplify a let that evaluates to another let, since this is already +-- normal form (and would cause infinite loops with letflat below). +letsimpl expr@(Let _ (Let _ _)) = return expr -- Put the "in ..." value of a let in its own binding, but not when the -- expression is already a local variable, or not representable (to prevent loops with inlinenonrep). letsimpl expr@(Let binds res) = do