[all-commits] [llvm/llvm-project] 64ba9d: [coro async] Disable lifetime.start sinking for AB...

Arnold Schwaighofer via All-commits all-commits at lists.llvm.org
Mon Dec 6 11:00:35 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64ba9dd943aab8b7bdb44a1c3ae05ed2a940280d
      https://github.com/llvm/llvm-project/commit/64ba9dd943aab8b7bdb44a1c3ae05ed2a940280d
  Author: Arnold Schwaighofer <aschwaighofer at apple.com>
  Date:   2021-12-06 (Mon, 06 Dec 2021)

  Changed paths:
    M llvm/lib/Transforms/Coroutines/CoroFrame.cpp
    A llvm/test/Transforms/Coroutines/coro-async-addr-lifetime-start-bug.ll

  Log Message:
  -----------
  [coro async] Disable lifetime.start sinking for ABI::Async and ABI::Retcon

It does not handle loops correctly i.e it moves the lifetime.start
intrinsic into a loop rendering the stack object as not alive for part
of the loop.

```
  entry:
    %obj = alloca i8
    lifetime.start(%obj)

    br loop

  loop:
    coro.suspend()
    escape(%obj)
    cond_br %cond, label %exit, label loop

    br loop

  exit:
    lifetime.end(%obj

```

After sinking:

```
  entry:
    %obj = alloca i8
    br loop

  loop:
    coro.suspend()
    lifetime.start(%obj)
    escape(%obj)
    cond_br %cond, label %exit, label loop

    br loop

  exit:
    lifetime.end(%obj

```

rdar://83411917

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




More information about the All-commits mailing list