[GHC] #14672: Make likelyhood of branches/conditions available throughout the compiler.

GHC ghc-devs at haskell.org
Mon Jan 15 22:20:42 UTC 2018


#14672: Make likelyhood of branches/conditions available throughout the compiler.
-------------------------------------+-------------------------------------
           Reporter:  AndreasK       |             Owner:  (none)
               Type:  task           |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 For simple code such as `if a > 10 then foo else bar` it can make a big
 difference if we jump on `a > 10` or `a <= 10`.

 We already tracked the likelyhood of such conditionals for stack/heap
 checks in Cmm. I recently updated the native codegen on X86 to take this
 information into account where available and in one edge case this
 improved execution time from 1.7s to 1.5s!

 Having this info available for other cases like bound checking (assume
 valid) or partial pattern matches (assume no match failure) should be a
 small win for most programs and hopefully a big one for a few of them.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14672>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list