[GHC] #16052: Core optimizations for memset on a small range

GHC ghc-devs at haskell.org
Sun Dec 16 19:59:39 UTC 2018


#16052: Core optimizations for memset on a small range
-------------------------------------+-------------------------------------
        Reporter:  andrewthad        |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.9
       Component:  Compiler          |              Version:  8.6.3
      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 andrewthad):

 I’m going to try to fix this. You’ve listed two problems:

 1. Condition too strong
 2. Weak alignment claim

 I don’t understand problem the first one. As far as I can tell, the
 condition is that the length of the region is less than 128 and that the
 memory is four-byte aligned. If anything, this condition seems too weak on
 64-bit platforms (but correct on 32-bit platforms). I don’t know how the
 NCG normally deals with the 32 bit vs 64 bit distinction in other places.
 But the second problem, I agree that that seems like a problem.

 It’s probably difficult to add a better test for this once it’s fixed. It
 would need to compile starting with STG, not Cmm (which is what the
 current test does), and go all the way down to asm. But it might be
 brittle.

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


More information about the ghc-tickets mailing list