This is an archive of the discontinued LLVM Phabricator instance.

[coroutine] add nomerge function attribute to `llvm.coro.save`
ClosedPublic

Authored by ychen on Jul 11 2022, 6:04 PM.

Details

Summary

It is illegal to merge two llvm.coro.save calls unless their
llvm.coro.suspend users are also merged. Marks it "nomerge" for
the moment.

This reverts D129025.

Alternative to D129025, which affects other token type users like WinEH.

Diff Detail

Event Timeline

ychen created this revision.Jul 11 2022, 6:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 6:04 PM
ychen requested review of this revision.Jul 11 2022, 6:04 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 11 2022, 6:04 PM

This looks good to me basically. I would love to see an example to test the two coro.save wouldn't be merged.

ychen added a comment.Jul 11 2022, 7:13 PM

This looks good to me basically. I would love to see an example to test the two coro.save wouldn't be merged.

Yep, hoist-skip-token.ll is testing this.

ChuanqiXu accepted this revision.Jul 11 2022, 7:16 PM

This looks good to me basically. I would love to see an example to test the two coro.save wouldn't be merged.

Yep, hoist-skip-token.ll is testing this.

Oh, sorry. I didn't notice that. The current version should be fine.

Personally, I would like to move the test to Transforms/Coroutine and add a new test that the two llvm.coro.suspend are the same but they couldn't be merged. This is not required.

This revision is now accepted and ready to land.Jul 11 2022, 7:16 PM
ychen updated this revision to Diff 443818.Jul 11 2022, 7:23 PM
  • Address Chuanqi's feedback
ychen added a comment.Jul 11 2022, 7:25 PM

This looks good to me basically. I would love to see an example to test the two coro.save wouldn't be merged.

Yep, hoist-skip-token.ll is testing this.

Oh, sorry. I didn't notice that. The current version should be fine.

Personally, I would like to move the test to Transforms/Coroutine and add a new test that the two llvm.coro.suspend are the same but they couldn't be merged. This is not required.

Sure, sounds good to me. Thanks for the review!

This revision was landed with ongoing or failed builds.Jul 12 2022, 10:39 AM
This revision was automatically updated to reflect the committed changes.
llvm/test/Transforms/Coroutines/coro-save-nomerge.ll