[GHC] #12982: Missed constant folding oportunities

GHC ghc-devs at haskell.org
Wed Apr 4 16:10:44 UTC 2018


#12982: Missed constant folding oportunities
-------------------------------------+-------------------------------------
        Reporter:  erikd             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/hoopl   |              Version:  8.0.1
      Resolution:                    |             Keywords:  newcomer
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Vyse007):

 I took a stab at this: thanks to Ben I was able to add a new {{{ PrimOp}}}
 for POW, along with some basic rules for folding in {{{ PrelRules.hs}}}. I
 eventually found myself stuck in {{{nativeGen/X86/CodeGen.hs}}} where we
 employ {{{getRegister}}} to find free registers for computation. I
 couldn't grok all of it so for I just copied the {{{triv_op}}} call for
 {{{MO_Mul}}} and it seemed to work fine; I understand that it's incorrect
 obviously, but I might need a little help in understanding what's the best
 solution.

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


More information about the ghc-tickets mailing list