This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Part 4b: Coroutine Devirtualization: Handle unwinding coro.resume and coro.destroy.
AbandonedPublic

Authored by GorNishanov on Aug 3 2016, 4:30 AM.

Details

Reviewers
majnemer
Summary

This is the 4b patch in the coroutine series. CoroEaly pass now can lower coro.resume and coro.destroy intrinsics called via InvokeInst.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan):

  1. Add documentation. (https://reviews.llvm.org/D22603)
  2. Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
  3. Add empty coroutine passes. (https://reviews.llvm.org/D22847)
  4. Add coroutine devirtualization + tests.

a) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998)
b) Handle invoke resumers <= we are here
c) Do devirtualization

  1. Add CGSCC restart trigger + tests.
  2. Add coroutine heap elision + tests.
  3. Add the rest of the logic (split into more patches)

Diff Detail

Event Timeline

GorNishanov updated this revision to Diff 66644.Aug 3 2016, 4:30 AM
GorNishanov retitled this revision from to [coroutines] Part 4b: Coroutine Devirtualization: Handle unwinding coro.resume and coro.destroy..
GorNishanov updated this object.
GorNishanov added a reviewer: majnemer.
GorNishanov set the repository for this revision to rL LLVM.
GorNishanov added a subscriber: llvm-commits.
majnemer added inline comments.Aug 3 2016, 8:56 AM
lib/Transforms/Coroutines/CoroEarly.cpp
72–88

Why not throw &I into a CallSite? CallSite abstracts over call and invoke.

You would need to add getIntrinsicID to CallSite.

GorNishanov removed rL LLVM as the repository for this revision.

Switch to iterating over CallSites per David Majnemer feedback, much prettier now!

majnemer edited edge metadata.Aug 3 2016, 12:41 PM

Would it be a major burden to fold this into 4a?

GorNishanov marked an inline comment as done.Aug 3 2016, 12:43 PM
GorNishanov added inline comments.
lib/Transforms/Coroutines/CoroEarly.cpp
72–88

Good idea! Much prettier now.

(I can add getIntrinsicID to CallSite as a separate commit. It will save one line :-) in CoroEarly)

GorNishanov marked 2 inline comments as done.Aug 3 2016, 12:43 PM
GorNishanov abandoned this revision.Aug 4 2016, 1:52 PM

Abandoning... Changes rolled in part4a