[GHC] #10677: slightly silly assembly for testing whether a Word# is 0##

GHC ghc-devs at haskell.org
Fri Aug 7 18:18:43 UTC 2015


#10677: slightly silly assembly for testing whether a Word# is 0##
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                   Owner:
            Type:  bug               |                  Status:  patch
        Priority:  low               |               Milestone:
       Component:  Compiler          |                 Version:  7.11
  (CodeGen)                          |
      Resolution:                    |                Keywords:  newcomer
Operating System:  Unknown/Multiple  |            Architecture:  x86_64
 Type of failure:  Runtime           |  (amd64)
  performance bug                    |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #10750            |  Differential Revisions:  Phab:D1137
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Replying to [comment:3 nomeata]:
 > Is there a good way to have test cases for these issues?

 Maybe grep `-ddump-opt-cmm` output for the condition `if
 (%MO_F_Gt_W64(...` and check that it compares something to 0, not 1?

 Replying to [comment:4 nomeata]:
 > I tried to fix this, but now (presumably due to a later optimization) it
 produces
 >
 > {{{
 >       testq %r14,%r14
 >       jne _cQl
 > }}}
 >
 > I hope that is ok as well.

 Yes, that's just as good (generally speaking, in any particular case one
 may be better than the other because they imply different basic block
 layouts, but understanding that is a whole separate issue).

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


More information about the ghc-tickets mailing list