This is an archive of the discontinued LLVM Phabricator instance.

[coroutines][PR40979] Ignore unreachable uses across suspend points
ClosedPublic

Authored by modocache on Mar 6 2019, 6:49 PM.

Details

Summary

Depends on https://reviews.llvm.org/D59069.

https://bugs.llvm.org/show_bug.cgi?id=40979 describes a bug in which the
-coro-split pass would assert that a use was across a suspend point from
a definition. Normally this would mean that a value would "spill" across
a suspend point and thus need to be stored in the coroutine frame. However,
in this case the use was unreachable, and so it would not be necessary
to store the definition on the frame.

To prevent the assert, simply remove unreachable basic blocks from a
coroutine function before computing spills. This avoids the assert
reported in PR40979.

Diff Detail

Repository
rL LLVM

Event Timeline

modocache created this revision.Mar 6 2019, 6:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2019, 6:49 PM
modocache edited the summary of this revision. (Show Details)Mar 6 2019, 6:51 PM
GorNishanov accepted this revision.Mar 7 2019, 1:13 PM

LGTM with a tiny suggestion

lib/Transforms/Coroutines/CoroSplit.cpp
931 ↗(On Diff #189638)

I suggest to move it inside of the splitCoroutine function.

This revision is now accepted and ready to land.Mar 7 2019, 1:13 PM

Thanks @GorNishanov! I moved the call into splitCoroutine. I'll land this now.

This revision was automatically updated to reflect the committed changes.