Page MenuHomePhabricator

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

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

Details

Summary

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.Wed, Sep 16, 6:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Sep 16, 6:26 PM
lxfind requested review of this revision.Wed, Sep 16, 6:26 PM
lxfind updated this revision to Diff 292398.Wed, Sep 16, 7:14 PM

fix lint

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

LGTM, Thanks for the fix.

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