[GHC] #10137: Rewrite switch code generation

GHC ghc-devs at haskell.org
Tue Mar 17 12:16:52 UTC 2015


#10137: Rewrite switch code generation
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                   Owner:  nomeata
            Type:  task              |                  Status:  patch
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.9
  (CodeGen)                          |                Keywords:
      Resolution:                    |            Architecture:
Operating System:  Unknown/Multiple  |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #9157, #8326,     |  Differential Revisions:
  #8317, #9159                       |
-------------------------------------+-------------------------------------
Changes (by nomeata):

 * status:  new => patch


Comment:

 Ok, I think the code is ready for some review; see Phab:D720. I’d like to
 land this before adding some of the extra bells and whistles, such as
 branches code in situations where this is possible.

 Note that although #10124 and the story about branchless codes made me
 look at this, the rewrite of code generation for switches stands on its
 own, as it improves upon the previous situations. In particular, we
 currently never generate jump tables for case expressions on `Int#` and
 `Word#`, which is quite a waste (previously reported as #9159 as well),
 and we were building the if-then-else tree before creating jump tables,
 thus possibly splitting them in the middle.

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


More information about the ghc-tickets mailing list