X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreUtils.lhs;h=da6367d737e1b7b85431f632ae073d395819a42f;hb=143f4381d242e4a1c3174e8a0732a1e48f00a1aa;hp=69f78fad8f1130fe788713b5a2872e4296f2e1a4;hpb=25ce05f745a40a57ff64f8ee3d59a31ba61400fc;p=ghc-hetmet.git diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs index 69f78fa..da6367d 100644 --- a/compiler/coreSyn/CoreUtils.lhs +++ b/compiler/coreSyn/CoreUtils.lhs @@ -476,7 +476,7 @@ exprIsCheap other_expr -- Applications and variables -- to bother to check the number of args -------------- - go_sel [arg] = exprIsTrivial arg -- I'm experimenting with making record selection + go_sel [arg] = exprIsCheap arg -- I'm experimenting with making record selection go_sel other = False -- look cheap, so we will substitute it inside a -- lambda. Particularly for dictionary field selection. -- BUT: Take care with (sel d x)! The (sel d) might be cheap, but @@ -496,6 +496,9 @@ It returns True iff soon, without raising an exception, without causing a side effect (e.g. writing a mutable variable) + +NB: if exprIsHNF e, then exprOkForSpecuation e + E.G. let x = case y# +# 1# of { r# -> I# r# } in E @@ -621,7 +624,7 @@ exprIsHNF other = False -- There is at least one value argument app_is_value (Var fun) args - | isDataConWorkId fun -- Constructor apps are values + | isDataConWorkId fun -- Constructor apps are values || idArity fun > valArgCount args -- Under-applied function = check_args (idType fun) args app_is_value (App f a) as = app_is_value f (a:as)