This is an archive of the discontinued LLVM Phabricator instance.

[Coroutines] Handle lifetime markers, bitcast and unused instruciton for symmetric transfer
ClosedPublic

Authored by ChuanqiXu on Dec 28 2021, 12:43 AM.

Details

Summary

This fixes bug49888. The root cause for this is that simplifyTerminatorLeadingToRet didn't handle lifetime markers well. Another issue also noted in D116327 is that we deleted some inlined optimization pass in CoroSplit so that simplifyTerminatorLeadingToRet need to remove dead instructions by hand.

This patch fixes bug49888 by skipping lifetime markers and bitcast instruction and removing dead instructions by hand in simplifyTerminatorLeadingToRet.

This depends on https://reviews.llvm.org/D116327

Diff Detail

Event Timeline

ChuanqiXu created this revision.Dec 28 2021, 12:43 AM
ChuanqiXu requested review of this revision.Dec 28 2021, 12:43 AM
ChuanqiXu edited the summary of this revision. (Show Details)Dec 28 2021, 12:45 AM
ChuanqiXu edited the summary of this revision. (Show Details)Jan 5 2022, 11:17 PM
junparser accepted this revision.Jan 11 2022, 11:25 PM

LGTM with some comments.

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

GetFirstValidInstructionInBB seems can be removed. GetFirstValidInstruction(Succ->getFirstNonPHI()) is enough.

1299

ditto.

llvm/test/Transforms/Coroutines/coro-split-musttail6.ll
42–43

FIXME should be removed?

This revision is now accepted and ready to land.Jan 11 2022, 11:25 PM

Address comments.

Clean codes

This revision was landed with ongoing or failed builds.Jan 12 2022, 12:00 AM
This revision was automatically updated to reflect the committed changes.