X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcoreSyn%2FCoreUtils.lhs;fp=compiler%2FcoreSyn%2FCoreUtils.lhs;h=19ac62ff8a1b93753be558085d8dbb21d6c67c8b;hp=4146b621e158df90d53bcb01ad7346e0a3203726;hb=7e95df790b34e11d7308e43dab0a7175b69b70fc;hpb=c0687066474aa4ce4912f31a5c09c1bcd673fb06 diff --git a/compiler/coreSyn/CoreUtils.lhs b/compiler/coreSyn/CoreUtils.lhs index 4146b62..19ac62f 100644 --- a/compiler/coreSyn/CoreUtils.lhs +++ b/compiler/coreSyn/CoreUtils.lhs @@ -592,6 +592,12 @@ exprIsCheap' good_app other_expr -- Applications and variables go_pap args = all (exprIsCheap' good_app) args -- Used to be "all exprIsTrivial args" due to concerns about -- duplicating nested constructor applications, but see #4978. + -- The principle here is that + -- let x = a +# b in c *# x + -- should behave equivalently to + -- c *# (a +# b) + -- Since lets with cheap RHSs are accepted, + -- so should paps with cheap arguments -------------- go_primop op args = primOpIsCheap op && all (exprIsCheap' good_app) args