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

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 18:26:03 PDT 2020


lxfind created this revision.
lxfind added reviewers: wenlei, rjmccall, junparser, ChuanqiXu.
Herald added subscribers: llvm-commits, modimo, modocache, hiraditya, qcolombet.
Herald added a project: LLVM.
lxfind requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87810

Files:
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/test/Transforms/Coroutines/coro-spill-defs-before-corobegin.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87810.292387.patch
Type: text/x-patch
Size: 6159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200917/4b86082f/attachment.bin>


More information about the llvm-commits mailing list