[GHC] #1498: Optimisation: eliminate unnecessary heap check in recursive function

GHC cvs-ghc at haskell.org
Tue Feb 21 14:49:28 CET 2012


#1498: Optimisation: eliminate unnecessary heap check in recursive function
-------------------------------------------+--------------------------------
    Reporter:  simonmar                    |       Owner:                         
        Type:  bug                         |      Status:  new                    
    Priority:  low                         |   Milestone:  7.6.1                  
   Component:  Compiler                    |     Version:  6.6.1                  
    Keywords:                              |          Os:  Unknown/Multiple       
Architecture:  Unknown/Multiple            |     Failure:  Runtime performance bug
  Difficulty:  Moderate (less than a day)  |    Testcase:                         
   Blockedby:  4258                        |    Blocking:                         
     Related:                              |  
-------------------------------------------+--------------------------------

Comment(by batterseapower):

 It's worth noting that the new codegen does put the heap check in the
 "correct" place for the example program:

 {{{
 foo as n = loop 0# 0.0##
   where
     loop i x
       | i >=# n = (# (), D# x #)
       | otherwise = loop (i +# 1#) (x *## indexDoubleArray# as i)
 }}}

 The old code generator still has the problem, of course.

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



More information about the Glasgow-haskell-bugs mailing list