Mesa (main): gallivm: add coroutine attribute that llvm requires.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 11 01:14:57 UTC 2022


Module: Mesa
Branch: main
Commit: da0e00e0b9d62a68b4c6cd1831ccb16210615766
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=da0e00e0b9d62a68b4c6cd1831ccb16210615766

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Feb 10 10:54:58 2022 +1000

gallivm: add coroutine attribute that llvm requires.

Running llvm in debug mode asserts on this being missing.

Reviewed-by: Roland Scheidegger <sroland at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14963>

---

 src/gallium/auxiliary/draw/draw_llvm.c     | 2 ++
 src/gallium/drivers/llvmpipe/lp_state_cs.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 483bf62b44c..e0d0ebad07c 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -3397,6 +3397,8 @@ draw_tcs_llvm_generate(struct draw_llvm *llvm,
 
    LLVMSetFunctionCallConv(variant_coro, LLVMCCallConv);
 
+   LLVMAddTargetDependentFunctionAttr(variant_coro, "coroutine.presplit", "0");
+
    for (i = 0; i < ARRAY_SIZE(arg_types); ++i) {
       if (LLVMGetTypeKind(arg_types[i]) == LLVMPointerTypeKind) {
          lp_add_function_attr(variant_coro, i + 1, LP_FUNC_ATTR_NOALIAS);
diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c
index fb86e544ca8..b3de8a94537 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_cs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c
@@ -133,6 +133,7 @@ generate_compute(struct llvmpipe_context *lp,
 
    coro = LLVMAddFunction(gallivm->module, func_name_coro, coro_func_type);
    LLVMSetFunctionCallConv(coro, LLVMCCallConv);
+   LLVMAddTargetDependentFunctionAttr(coro, "coroutine.presplit", "0");
 
    variant->function = function;
 



More information about the mesa-commit mailing list