[project @ 2001-03-20 12:37:25 by simonpj]
authorsimonpj <unknown>
Tue, 20 Mar 2001 12:37:25 +0000 (12:37 +0000)
committersimonpj <unknown>
Tue, 20 Mar 2001 12:37:25 +0000 (12:37 +0000)
commitcd6d99c5f243b8c129fb2494bbd13b4bf98abda6
tree771c10a5f4658bab3eb0c893177f8ebb427eafbb
parent77057e6adbe729f65ab827dbe238d3ac8c25a13a
[project @ 2001-03-20 12:37:25 by simonpj]
-------------------------------------
Be less keen about inlining primops
-------------------------------------

Marcin pointed out that it's bad to take

let x = a +# (b *# c)
in
x + f x + g x

and inline x to get

(a +# (b *# c)) +
f (a +# (b *# c)) +
g (a +# (b *# c))

Yet that's just what we were doing.  The offending clause is
in PrimOp.primOpIsCheap, which regards some primop applications
as 'cheap' (and hence freely duplicable).

For now, I've made it return False.  Let's see what that does.
ghc/compiler/prelude/PrimOp.lhs