X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=c%CE%BBash%2FCLasH%2FNormalize.hs;h=38ee353ac4225fe49dc3b8e85c7c248de7f66f6e;hb=f570cf39514c5e691b8160f8cd80e60d964fe9e6;hp=ec7a66bf991ea5f5ff65fc5b3ac231ec7123ab82;hpb=c3fd4c4ef1372598fa715b6e9fc48f1eda57d4ce;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 ec7a66b..38ee353 100644 --- "a/c\316\273ash/CLasH/Normalize.hs" +++ "b/c\316\273ash/CLasH/Normalize.hs" @@ -427,7 +427,7 @@ casesimpl expr@(Case scrut b ty alts) = do -- binding containing a case expression. dobndr :: CoreBndr -> Int -> TransformMonad (CoreBndr, Maybe (CoreBndr, CoreExpr)) dobndr b i = do - repr <- isRepr (Var b) + repr <- isRepr b -- Is b wild (e.g., not a free var of expr. Since b is only in scope -- in expr, this means that b is unused if expr does not use it.) let wild = not (VarSet.elemVarSet b free_vars) @@ -651,7 +651,10 @@ simplrestop expr@(Lam _ _) = return expr simplrestop expr@(Let _ _) = return expr simplrestop expr = do local_var <- Trans.lift $ is_local_var expr - if local_var + -- Don't extract values that are not representable, to prevent loops with + -- inlinenonrep + repr <- isRepr expr + if local_var || not repr then return expr else do