cvs commit: fptools/ghc/compiler/prelude PrimOp.lhs

Simon Peyton Jones simonpj@glass.cse.ogi.edu
Tue, 20 Mar 2001 04:37:26 -0800


simonpj     2001/03/20 04:37:26 PST

  Modified files:
    ghc/compiler/prelude PrimOp.lhs 
  Log:
  	-------------------------------------
  	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.
  
  Revision  Changes    Path
  1.90      +4 -3      fptools/ghc/compiler/prelude/PrimOp.lhs