Page MenuHomePhabricator

[Coroutine] Fix a bug where Coroutine incorrectly spills phi and invoke defs before CoroBegin

Authored by lxfind on Sep 16 2020, 6:26 PM.



When a spill definition is before CoroBegin, we cannot spill it to the frame immediately after the definition. We have to spill it after the frame is ready.
The current implementation handles it properly for any other kinds of instructions except for PhINode and InvokeInst, which could also be defined before CoroBegin.
This patch fixes it by moving the CoroBegin dominance check earlier, so that it covers all cases.
Added a test.

Diff Detail

Event Timeline

lxfind created this revision.Sep 16 2020, 6:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2020, 6:26 PM
lxfind requested review of this revision.Sep 16 2020, 6:26 PM
lxfind updated this revision to Diff 292398.Sep 16 2020, 7:14 PM

fix lint

junparser accepted this revision.Sep 17 2020, 3:11 AM

LGTM, Thanks for the fix.

This revision is now accepted and ready to land.Sep 17 2020, 3:11 AM