Emit function attribute "coroutine.presplit" for coroutines This fixes issues with recent LLVM revisions that require this attribute: https://llvm.org/docs/Coroutines.html. Context: cl/419786634 https://github.com/llvm/llvm-project/commit/c75cedc237f9747c5d5fe2a312d5ccc8531e2e70 https://reviews.llvm.org/D115790 Bug: b/165000222 Change-Id: I75308c6cf75d7aa9b823e7ded37f3f6ddf0a7010 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/61148 Reviewed-by: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp index fcd018a..a0d85c6 100644 --- a/src/Reactor/LLVMReactor.cpp +++ b/src/Reactor/LLVMReactor.cpp
@@ -4318,6 +4318,7 @@ auto promisePtrTy = promiseTy->getPointerTo(); jit->function = rr::createFunction("coroutine_begin", handleTy, T(Params)); + jit->function->addFnAttr("coroutine.presplit", "0"); jit->coroutine.await = rr::createFunction("coroutine_await", boolTy, { handleTy, promisePtrTy }); jit->coroutine.destroy = rr::createFunction("coroutine_destroy", voidTy, { handleTy }); jit->coroutine.yieldType = promiseTy;