#7360: Case-of-identical-alts optimisation fails abjectly
---------------------------------+------------------------------------------
    Reporter:  simonpj           |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.6.1           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------

Comment(by simonpj@…):

 commit bacf7ca075498aed745f68448f7e2b8d15c39541
 {{{
 Author: Simon Peyton Jones <simo...@microsoft.com>
 Date:   Mon Dec 24 13:25:12 2012 +0000

     Make combine-identical-alternatives work again (Trac #7360)

     Move the "combine indentical alternatives" transformation *before*
     simplifying the alternatives.  For example
          case x of y
             [] -> length y
             (_:_) -> length y }

     If we look *post* simplification, since 'y' is used in the
     alterantives, the case binders *might* be (see the keep_occ_info test
     in Simplify.simplAlt); and hence the combination of the two
     alteranatives does not happen.  But if we do it *pre* simplification
     there is no problem.

     This fixes Trac #7360.

  compiler/simplCore/SimplUtils.lhs |  127
 ++++++++++++++++++++-----------------
  1 files changed, 68 insertions(+), 59 deletions(-)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7360#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to