[PATCH] D100282: [Coroutines] Move CoroEarly pass to before AlwaysInliner

Xun Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 11 22:07:56 PDT 2021


lxfind created this revision.
lxfind added reviewers: junparser, dongAxis1944, rjmccall, ChuanqiXu.
Herald added subscribers: hoy, modimo, wenlei, hiraditya.
lxfind requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Presplit coroutines cannot be inlined. During AlwaysInliner we check if a function is a presplit coroutine, if so we skip inlining.
The presplit coroutine attributes are set in CoroEarly pass.
However in O0 pipeline, AlwaysInliner runs before CoroEarly, so the attribute isn't set yet and will still inline the coroutine.
This causes Clang to crash: https://bugs.llvm.org/show_bug.cgi?id=49920


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100282

Files:
  clang/test/CodeGenCoroutines/coro-always-inline-resume.cpp
  clang/test/CodeGenCoroutines/coro-always-inline.cpp
  llvm/lib/Passes/PassBuilder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100282.336742.patch
Type: text/x-patch
Size: 5165 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210412/71ef0e74/attachment-0001.bin>


More information about the cfe-commits mailing list