[PATCH] D110953: [coro async] Disable lifetime.start sinking for ABI::Async and ABI::Retcon

Arnold Schwaighofer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 1 11:34:41 PDT 2021


aschwaighofer created this revision.
aschwaighofer added a reviewer: rjmccall.
Herald added subscribers: lxfind, hiraditya.
aschwaighofer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110953

Files:
  llvm/lib/Transforms/Coroutines/CoroFrame.cpp
  llvm/test/Transforms/Coroutines/coro-async-addr-lifetime-start-bug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110953.376585.patch
Type: text/x-patch
Size: 5585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211001/9e579129/attachment.bin>


More information about the llvm-commits mailing list