Skip to content

Commit e1008df

Browse files
committed
Handle cases coro handle may be passed to another coroutine
1 parent 28596aa commit e1008df

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

llvm/docs/Coroutines.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,9 +2123,9 @@ CoroEarly
21232123
---------
21242124
The CoroEarly pass ensures later middle end passes correctly interpret coroutine
21252125
semantics and lowers coroutine intrinsics that not needed to be preserved to
2126-
help later coroutine passes. This pass lowers `coro.promise`_ that outside the
2127-
coroutine body, `coro.frame`_ and `coro.done`_ intrinsics. It replace uses of
2128-
promise alloca with `coro.promise`_ intrinsic.
2126+
help later coroutine passes. This pass lowers `coro.promise`_, `coro.frame`_ and
2127+
`coro.done`_ intrinsics. Afterwards, it replace uses of promise alloca with
2128+
`coro.promise`_ intrinsic.
21292129

21302130
.. _CoroSplit:
21312131

llvm/lib/Transforms/Coroutines/CoroEarly.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ void Lowerer::lowerEarlyIntrinsics(Function &F) {
237237
lowerResumeOrDestroy(*CB, CoroSubFnInst::DestroyIndex);
238238
break;
239239
case Intrinsic::coro_promise: {
240-
bool OutsideCoro = CoroBegin == nullptr;
241-
if (OutsideCoro)
242-
lowerCoroPromise(cast<CoroPromiseInst>(&I));
240+
lowerCoroPromise(cast<CoroPromiseInst>(&I));
243241
break;
244242
}
245243
case Intrinsic::coro_done:

0 commit comments

Comments
 (0)