#609: Useful optimisation for set-cost-centre
----------------------+-----------------------------------------------------
 Reporter:  simonpj   |          Owner:                  
     Type:  task      |         Status:  new             
 Priority:  normal    |      Milestone:  _|_             
Component:  Compiler  |        Version:  None            
 Severity:  normal    |     Resolution:  None            
 Keywords:            |     Difficulty:  Moderate (1 day)
 Testcase:            |   Architecture:  Unknown         
       Os:  Unknown   |  
----------------------+-----------------------------------------------------
Changes (by simonpj):

  * milestone:  6.8 branch => _|_

Old description:

> {{{
> If you compile, for example, drvrun014 with -prof -auto-all, you'll see
> stuff like
>
>     (scc "c" (dataToTag#)) y
>
> This generates bad code, because we end up eta-expaning dataToTag, which
> allocates an extra function closure.
>
> We think that in general
>
>    (scc "c" e) y  = scc "c" (e y)
>
> to within a small constant factor.  So maybe the simplifier, or CorePrep,
> or both, should do this transformation.
> }}}

New description:

 If you compile, for example, drvrun014 with -prof -auto-all, you'll see
 stuff like
 {{{
     (scc "c" (dataToTag#)) y
 }}}
 This generates bad code, because we end up eta-expaning dataToTag, which
 allocates an extra function closure.

 We think that in general
 {{{
    (scc "c" e) y  = scc "c" (e y)
 }}}
 to within a small constant factor.  So maybe the simplifier, or
 `CorePrep`, or both, should do this transformation.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/609#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to