patch applied (ghc-6.8/ghc): MERGED: Inline implication constraints

Ian Lynagh igloo at earth.li
Sat Dec 15 15:52:01 EST 2007


Sat Dec 15 08:33:15 PST 2007  Ian Lynagh <igloo at earth.li>
  * MERGED: Inline implication constraints
  Mon Nov  5 22:08:07 GMT 2007  simonpj at microsoft.com
  
    This patch fixes Trac #1643, where Lennart found that GHC was generating
    code with unnecessary dictionaries.  The reason was that we were getting
    an implication constraint floated out of an INLINE (actually an instance
    decl), and the implication constraint therefore wasn't inlined even 
    though it was used only once (but inside the INLINE).  Thus we were 
    getting:
    
          ic = \d -> <stuff>
          foo = _inline_me_ (...ic...)
    
    Then 'foo' gets inlined in lots of places, but 'ic' now looks a bit 
    big.  
    
    But implication constraints should *always* be inlined; they are just
    artefacts of the constraint simplifier.
    
    This patch solves the problem, by adding a WpInline form to the HsWrap
    type. 

    M ./compiler/deSugar/DsBinds.lhs +2
    M ./compiler/hsSyn/HsBinds.lhs +2
    M ./compiler/typecheck/TcHsSyn.lhs -1 +2
    M ./compiler/typecheck/TcSimplify.lhs -3 +20



More information about the Cvs-ghc mailing list