[all-commits] [llvm/llvm-project] 5b533d: [Coroutine] Fix a bug where Coroutine incorrectly ...

Xun Li via All-commits all-commits at lists.llvm.org
Thu Sep 17 08:13:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5b533d6cdeed21369dee4572b5485b1fd5d5dcf5
      https://github.com/llvm/llvm-project/commit/5b533d6cdeed21369dee4572b5485b1fd5d5dcf5
  Author: Xun Li <xun at fb.com>
  Date:   2020-09-17 (Thu, 17 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    A llvm/test/Transforms/Coroutines/coro-spill-defs-before-corobegin.ll

  Log Message:
  -----------
  [Coroutine] Fix a bug where Coroutine incorrectly spills phi and invoke defs before CoroBegin

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.

Differential Revision: https://reviews.llvm.org/D87810




More information about the All-commits mailing list