This is an archive of the discontinued LLVM Phabricator instance.

[Coroutines] Don't merging readnone calls in presplit coroutines
ClosedPublic

Authored by ChuanqiXu on Oct 9 2022, 7:46 PM.

Details

Summary

Another alternative to fix the thread identification problem in coroutines.

We plan to fix this problem by unifying memory effecting attributes. See https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579.
But it may be a long-term project. And it is a pity that the coroutines can't resume in different threads for years. So this one is temporary fix. It may cause unnecessary performance regression for coroutines. But correctness are more important. And this one is planned to be reverted after we are able to unify the memory effecting attributes actually.

Diff Detail

Event Timeline

ChuanqiXu created this revision.Oct 9 2022, 7:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2022, 7:46 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
ChuanqiXu requested review of this revision.Oct 9 2022, 7:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2022, 7:46 PM

I am happy with this solution (as a temporary workaround).
The fixme's are clear and the code pattern is very concise.
A coroutine person might want to accept.
Thanks for trimming it down!

ChuanqiXu added subscribers: ychen, rjmccall.

@rjmccall @ychen would you like to take a look at this?

I haven't been following all the threads about the right way to handle this. If this is the consensus for the correct way to handle this in the short term, it seems like a conceptually acceptable fix to me.

I haven't been following all the threads about the right way to handle this. If this is the consensus for the correct way to handle this in the short term, it seems like a conceptually acceptable fix to me.

I feel this is a consensus. And I'll commit it in the next few days if no objection comes.

Sounds fine to me.

ChuanqiXu accepted this revision.Oct 16 2022, 7:17 PM
This revision is now accepted and ready to land.Oct 16 2022, 7:17 PM