#4941: SpecConstr generates functions that do not use their arguments
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:                         
        Type:  task              |       Status:  new                    
    Priority:  normal            |    Milestone:  _|_                    
   Component:  Compiler          |      Version:  7.0.1                  
    Keywords:                    |     Testcase:                         
   Blockedby:                    |   Difficulty:                         
          Os:  Unknown/Multiple  |     Blocking:                         
Architecture:  Unknown/Multiple  |      Failure:  Runtime performance bug
---------------------------------+------------------------------------------

Comment(by batterseapower):

 Indeed. I found that you need to have a fixed point between SAT and
 SpecConstr to deal with the output of stream fusion. Similarly there is an
 argument for having a fixed point between SAT and strictness analysis
 because it is possible that strictness analysis (in particular CPR-
 optimisation) would give rise to further opportunities for SpecConstr.
 Consider:

 {{{
 f b x = case b of A -> I# y; B -> x; C -> f A (x + 1)
 }}}

 After SpecConstr, the (f A z) specialisation has the CPR property, as
 worker-wrapper will reveal. So if there was some other call:

 {{{
 g x = g (f A x)
 }}}

 After inlining the wrapper we now have a SpecConstr opportunity for (g (I#
 z)). I wonder how often this would actually occur in practice..

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4941#comment:3>
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