patch applied (ghc): Transfer INLINE to specialised functions

Simon Peyton Jones simonpj at microsoft.com
Wed Jun 21 18:40:53 EDT 2006


Wed Jun 21 15:36:37 PDT 2006  simonpj at microsoft.com
  * Transfer INLINE to specialised functions
  
  When the Specialise pass generates a specialised copy of a function,
  it should transfer the INLINE information to the specialised function.
  Otherwise, whether or not the INLNE happens can depend on whether
  specialisation happens, which seems wrong.  See Note [Inline specialisation]
  in Specialise.lhs
  
  Here's the example Roman reported
  
      primWriteMU :: UAE e => MUArr e s -> Int -> e -> ST s ()
      {-# INLINE primWriteMU #-}
      primWriteMU = writeMBU . unMUAPrim
      ------
      
      The problem is that primWriteMU doesn't get inlined *sometimes*, which
      results in code like
      
      case Data.Array.Parallel.Unlifted.Flat.UArr.$sprimWriteMU
  	    @ s11_X1nJ
  	    marr_s25s
  	    (GHC.Base.I# sc_s27F)
  	    GHC.Base.False
  	    new_s_a1Db
  	    of wild3_a1Dd { (# new_s1_X1F9, r_a1Dc #) -> ...
  
  Note the fact that we have a call to the *specialised* $sprimWriteMU.
  

    M ./compiler/specialise/Specialise.lhs -22 +43


More information about the Cvs-ghc mailing list