[GHC] #4908: Easy SpecConstr opportunity that is nonetheless missed

GHC cvs-ghc at haskell.org
Tue Feb 1 16:07:01 CET 2011


#4908: Easy SpecConstr opportunity that is nonetheless missed
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:                                
        Type:  bug               |       Status:  merge                         
    Priority:  normal            |    Milestone:                                
   Component:  Compiler          |      Version:  7.0.1                         
    Keywords:                    |     Testcase:  simplCore/should_compile/T4908
   Blockedby:                    |   Difficulty:                                
          Os:  Unknown/Multiple  |     Blocking:                                
Architecture:  Unknown/Multiple  |      Failure:  Runtime performance bug       
---------------------------------+------------------------------------------
Changes (by simonpj):

  * status:  new => merge
  * testcase:  => simplCore/should_compile/T4908


Comment:

 Thanks for identifying this. It's a long-standing bug; and there was a
 corresponding one in the simplifier, so a good one to find.
 {{{
 Mon Jan 31 11:35:29 GMT 2011  simonpj at microsoft.com
   * Improve Simplifier and SpecConstr behaviour

   Trac #4908 identified a case where SpecConstr wasn't "seeing" a
   specialisation it should easily get.  The solution was simple: see
   Note [Add scrutinee to ValueEnv too] in SpecConstr.

   Then it turned out that there was an exactly analogous infelicity in
   the mighty Simplifer too; see Note [Add unfolding for scrutinee] in
   Simplify. This fix is good for Simplify even in the absence of the
   SpecConstr change.  (It arose when I moved the binder- swap stuff to
   OccAnall, not realising that it *remains* valuable to record info
   about the scrutinee of a case expression.  The Note says why.

   Together these two changes are unconditionally good.  Better
   simplification, better specialisation. Thank you Max.

     M ./compiler/simplCore/Simplify.lhs -38 +57
     M ./compiler/specialise/SpecConstr.lhs -18 +39
 }}}
 Please merge

 Simon

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



More information about the Glasgow-haskell-bugs mailing list