This is an archive of the discontinued LLVM Phabricator instance.

CoroSplit: Replace ad-hoc implementation of reachability with API from CFG.h
ClosedPublic

Authored by aprantl on May 21 2021, 7:09 PM.

Details

Summary

The current ad-hoc implementation used to determine whether a basic block is unreachable doesn't work correctly in the general case (for example it won't detect successors of unreachable blocks as unreachable). This patch replaces it with the correct API that uses a DominatorTree to answer the question correctly and quickly.

rdar://77181156

Diff Detail

Event Timeline

aprantl created this revision.May 21 2021, 7:09 PM
aprantl requested review of this revision.May 21 2021, 7:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2021, 7:09 PM
ChuanqiXu accepted this revision.May 23 2021, 6:29 PM

It looks good to me with an unused variables to remove.

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

It looks like UnreachableCache doesn't be used.

This revision is now accepted and ready to land.May 23 2021, 6:29 PM