#13104: runRW# ruins join points -------------------------------------+------------------------------------- Reporter: lukemaurer | Owner: chessai Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.1 Resolution: | Keywords: JoinPoints Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by sgraf): Yes, I meant 'make runRW# a proper primop'. It's treated like one by Core anyway. This mostly entails adding it to primops.txt.pp, but I'd suggest grepping for mentions of another primop like `seq#` (lowered in STG, IIRC) and handle it the same way.
To be clear, while currently the demand signature of runRW# is <C(S), C1(U)>, and you'd rather it be < L, C1(U)>? Why? How is this laziness related to the problem related to the Note [runRW magic]?
I got the note wrong. I was referring to `Note [runRW arg]`, but that note says that we ''should'' make `runRW#` strict and says that we do so in `MkId`. I couldn't find any mention of runRW in there, so that may have been a lie, not sure. So, it seems that `<C(S), C1(U)>` is actually the correct demand signature. Upon following Phab:D2444, I'm not so sure anymore we should actually handle it as a primop, but rather like `lazy` or `unsafeCoerce#` entirely in `MkId`. Reading wiki:Commentary/PrimOps and wiki:Commentary/Compiler/WiredIn, it seems that currently `runRW#` is a "known-key" thing, but we need it to become a "wired-in" thing to attach useful `IdInfo` such as demand signatures. It should not become a prim-op, because we know how to lower it in CoreToStg as opposed to StgToCmm (effectively 'linking' to an appropriate implementation). It would be great if someone more knowledgable could chime in and confirm my last paragraph. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13104#comment:18> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler