
On Monday, January 30, 2017 9:50:56 PM EST Simon Marlow wrote:
Unfortunately the mechanisms we have right now to fix it aren't ideal - noDuplicate# is a bigger hammer than we need.
Do you think you could explain this a bit more? What aspect of nuDuplicate# is overkill? What does it guard against that can't happen here?
All we really need is some way to make a thunk atomic, it would require some special entry code to the thunk which did atomic eager-blackholing. Hmm, now that I think about it, perhaps we could just have a flag, -fatomic-eager-blackholing.
If it's possible to use a primop to do this "locally", I think it would be very nice to get that as well as a global flag. If it affects code generation in an inherently global fashion, then of course we'll just have to live with that, and lots of NOINLINE. David