patch applied (ghc): Don't expose the unfolding of dictionary selectors without -O

Simon Peyton Jones simonpj at microsoft.com
Fri Mar 7 07:34:07 EST 2008


Thu Mar  6 05:50:26 PST 2008  simonpj at microsoft.com
  * Don't expose the unfolding of dictionary selectors without -O
  
  When compiling without -O we were getting code like this
  
  	f x = case GHC.Base.$f20 of
  		  :DEq eq neq -> eq x x
  
  But because of the -O the $f20 dictionary is not available, so exposing
  the dictionary selector was useless.  Yet it makes the code bigger!
  Better to get
  	f x = GHC.Base.== GHC.Bsae.$f20 x x
  
  This patch suppresses the implicit unfolding for dictionary selectors
  when compiling without -O.  We could do the same for other implicit
  Ids, but this will do for now.
  
  There should be no effect when compiling with -O.  Programs should
  be smaller without -O and may run a tiny bit slower.
  
  

    M ./compiler/basicTypes/MkId.lhs -3 +7
    M ./compiler/iface/BuildTyCl.lhs -4 +7
    M ./compiler/iface/TcIface.lhs -1 +1
    M ./compiler/typecheck/TcTyClsDecls.lhs -1 +2



More information about the Cvs-ghc mailing list