Mesa (master): gallivm: fix coroutines on aarch64 with llvm 8

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 11 03:58:28 UTC 2019


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Thu Oct 10 13:27:30 2019 +1000

gallivm: fix coroutines on aarch64 with llvm 8

The coroutine split pass is missing a dependency before LLVM 9.0,
and fails to initialise properly if the CallGraphWrapperPass hasn't
be initialised earlier (x86 does it due to some of it's passes
requiring it).

This is a workaround for llvm 8 (coroutines are only supported in 8
and higher). It adds another pass that has a dependency on the pass
the coroutines split requires. This pass shouldn't have any raal
effects.

Fixes: d32690b43c9 (gallivm: add coroutine pass manager support)
Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/gallium/auxiliary/gallivm/lp_bld_init.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c
index 19d0d5ab031..beffbc552a2 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_init.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c
@@ -46,6 +46,9 @@
 #endif
 #include <llvm-c/BitWriter.h>
 #if GALLIVM_HAVE_CORO
+#if LLVM_VERSION_MAJOR <= 8 && defined(PIPE_ARCH_AARCH64)
+#include <llvm-c/Transforms/IPO.h>
+#endif
 #include <llvm-c/Transforms/Coroutines.h>
 #endif
 
@@ -134,6 +137,9 @@ create_pass_manager(struct gallivm_state *gallivm)
    }
 
 #if GALLIVM_HAVE_CORO
+#if LLVM_VERSION_MAJOR <= 8 && defined(PIPE_ARCH_AARCH64)
+   LLVMAddFunctionAttrsPass(gallivm->cgpassmgr);
+#endif
    LLVMAddCoroEarlyPass(gallivm->cgpassmgr);
    LLVMAddCoroSplitPass(gallivm->cgpassmgr);
    LLVMAddCoroElidePass(gallivm->cgpassmgr);




More information about the mesa-commit mailing list