Page MenuHomePhabricator

[Coroutines 2/2] Improve symmetric control transfer feature
ClosedPublic

Authored by junparser on Mar 27 2020, 2:52 AM.

Details

Summary

This patch implements part 2 described in https://reviews.llvm.org/D76911 which handle conditional branch in simplifyTerminatorLeadingToRet

We do not use LazyValueInfo to handle this since it is too heavy here. Instead, when case number of suspend switch instruction is reduced to 1, llvm::ConstantFoldTerminator simplifies it to 'icmp eq' , so we only need handle this.

@lewissbaker, the two patches fix the stack overflow failure.

TestPlan: check-llvm , cppcoro

Diff Detail

Event Timeline

junparser created this revision.Mar 27 2020, 2:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2020, 2:52 AM
junparser edited the summary of this revision. (Show Details)Mar 27 2020, 3:01 AM
junparser updated this revision to Diff 253069.Mar 27 2020, 3:32 AM

minor update

junparser set the repository for this revision to rG LLVM Github Monorepo.Mar 27 2020, 3:35 AM
modocache accepted this revision.Mar 28 2020, 5:21 PM

Looks great, thanks!

llvm/lib/Transforms/Coroutines/CoroSplit.cpp
971

I don't have an opinion either way, but just for information the clang-tidy pre-merge check thinks you ought to name this variable It with a capital I, that's why it's failing on this revision.

This revision is now accepted and ready to land.Mar 28 2020, 5:21 PM
junparser marked an inline comment as done.Mar 28 2020, 8:03 PM
junparser added inline comments.
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
971

Thanks for the info, It seems better to keep same with below code.

This revision was automatically updated to reflect the committed changes.