From: Matthijs Kooijman Date: Fri, 5 Mar 2010 17:14:45 +0000 (+0100) Subject: Add variant of isNormalizeable that operates in the TranslatorSession. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=7eed9f7f33ef0a7b8ac307af9249a379692dd21d;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git Add variant of isNormalizeable that operates in the TranslatorSession. --- diff --git "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" index 3da2728..7a187f8 100644 --- "a/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" +++ "b/c\316\273ash/CLasH/Normalize/NormalizeTools.hs" @@ -209,9 +209,12 @@ isUserDefined bndr = str `notElem` compiler_names -- into hardware. Note that if a binder is not normalizable, it might become -- so using argument propagation. isNormalizeable :: CoreBndr -> TransformMonad Bool -isNormalizeable bndr = do +isNormalizeable bndr = Trans.lift (isNormalizeable' bndr) + +isNormalizeable' :: CoreBndr -> TranslatorSession Bool +isNormalizeable' bndr = do let ty = Id.idType bndr let (arg_tys, res_ty) = Type.splitFunTys ty -- This function is normalizable if all its arguments and return value are -- representable. - andM $ mapM isRepr (res_ty:arg_tys) + andM $ mapM isRepr' (res_ty:arg_tys)