[GHC] #12877: Constant propagation with basic unboxed arithmetic instructions

GHC ghc-devs at haskell.org
Fri Dec 9 16:17:49 UTC 2016


#12877: Constant propagation with basic unboxed arithmetic instructions
-------------------------------------+-------------------------------------
        Reporter:  hsyl20            |                Owner:  hsyl20
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2762
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"d3b546b1a6058f26d5659c7f2000a7b25b7ea2ba/ghc" d3b546b/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="d3b546b1a6058f26d5659c7f2000a7b25b7ea2ba"
 Scrutinee Constant Folding

 This patch introduces new rules to perform constant folding through
 case-expressions.

 E.g.,
 ```
 case t -# 10# of _ {  ===> case t of _ {
          5#      -> e1              15#     -> e1
          8#      -> e2              18#     -> e2
          DEFAULT -> e               DEFAULT -> e
 ```

 The initial motivation is that it allows "Merge Nested Cases"
 optimization to kick in and to further simplify the code
 (see Trac #12877).

 Currently we recognize the following operations for Word# and Int#: Add,
 Sub, Xor, Not and Negate (for Int# only).

 Test Plan: validate

 Reviewers: simonpj, austin, bgamari

 Reviewed By: simonpj, bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D2762

 GHC Trac Issues: #12877
 }}}

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


More information about the ghc-tickets mailing list