[GHC] #14375: Implement with# primop

GHC ghc-devs at haskell.org
Mon Jul 30 22:00:03 UTC 2018


#14375: Implement with# primop
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  JoinPoints
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14346            |  Differential Rev(s):  ​Phab:D4110,
       Wiki Page:                    |  Phab:D4189
-------------------------------------+-------------------------------------

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

 In [changeset:"56590db07a776ce81eb89d4a4d86bd0f953fb44e/ghc" 56590db/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="56590db07a776ce81eb89d4a4d86bd0f953fb44e"
 base: Make Foreign.Marshal.Alloc.allocBytes[Aligned] NOINLINE

 As noted in #14346, touch# may be optimized away when the simplifier can
 see
 that the continuation passed to allocaBytes will not return. Marking CPS-
 style
 functions with NOINLINE ensures that the simplier can't draw any unsound
 conclusions.

 Ultimately the right solution here will be to do away with touch# and
 instead
 introduce a scoped primitive as is suggested in #14375.

 Note: This was present in 8.2 but was never merged to 8.4 in hopes that
 we would have #14375 implemented in time. This meant that the issue
 regressed again in 8.4. Thankfully we caught it in time to fix it for
 8.6.

 (cherry picked from commit 404bf05ed3193e918875cd2f6c95ae0da5989be2)
 }}}

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


More information about the ghc-tickets mailing list