From 7eed9f7f33ef0a7b8ac307af9249a379692dd21d Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 5 Mar 2010 18:14:45 +0100 Subject: [PATCH] Add variant of isNormalizeable that operates in the TranslatorSession. --- "c\316\273ash/CLasH/Normalize/NormalizeTools.hs" | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.30.2