1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
From 1a894699354f5f984f31e5d3418b651edf486df9 Mon Sep 17 00:00:00 2001
From: Ryan Eatmon <reatmon@ti.com>
Date: Fri, 22 Sep 2023 22:32:41 -0500
Subject: [PATCH] fix: gallivm: limit usage of LLVMContextSetOpaquePointers()
to LLVM 15
LLVMContextSetOpaquePointers() was a temporary workaround offered to
allow transitioning to opaque pointers. Mesa is ready for this now with
recent versions of LLVM (16+). Therefore we limit the workaround of
using LLVMContextSetOpaquePointers() to LLVM 15 now, that this C
interface was removed in LLVM 17.
Reference: https://github.com/llvm/llvm-project/commit/1270879376025457e266572c7cccc51eb5de9276
Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21124]
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
src/gallium/auxiliary/draw/draw_llvm.c | 2 +-
src/gallium/drivers/llvmpipe/lp_context.c | 2 +-
src/gallium/drivers/llvmpipe/lp_test_arit.c | 2 +-
src/gallium/drivers/llvmpipe/lp_test_blend.c | 2 +-
src/gallium/drivers/llvmpipe/lp_test_conv.c | 2 +-
src/gallium/drivers/llvmpipe/lp_test_format.c | 4 ++--
src/gallium/drivers/llvmpipe/lp_test_printf.c | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 50c157bc3cc..8b3a1522725 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -784,7 +784,7 @@ draw_llvm_create(struct draw_context *draw, LLVMContextRef context)
if (!llvm->context) {
llvm->context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(llvm->context, false);
#endif
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 8309335aebc..0ef4317fc76 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -263,7 +263,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv,
if (!llvmpipe->context)
goto fail;
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(llvmpipe->context, false);
#endif
diff --git a/src/gallium/drivers/llvmpipe/lp_test_arit.c b/src/gallium/drivers/llvmpipe/lp_test_arit.c
index 4118928d52e..565b1c47753 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_arit.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_arit.c
@@ -434,7 +434,7 @@ test_unary(unsigned verbose, FILE *fp, const struct unary_test_t *test, unsigned
}
context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c
index 37c3f731eaf..3d2899a78d4 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c
@@ -452,7 +452,7 @@ test_one(unsigned verbose,
dump_blend_type(stdout, blend, type);
context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c
index c7ea9efc12d..83236f0c0ba 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_conv.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c
@@ -223,7 +223,7 @@ test_one(unsigned verbose,
}
context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c
index 0a2a1e449e8..89f7d5dec1a 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_format.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_format.c
@@ -150,7 +150,7 @@ test_format_float(unsigned verbose, FILE *fp,
unsigned i, j, k, l;
context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module_float", context, NULL);
@@ -254,7 +254,7 @@ test_format_unorm8(unsigned verbose, FILE *fp,
unsigned i, j, k, l;
context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module_unorm8", context, NULL);
diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c
index b3de9cb9e8b..850c0abfe22 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_printf.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c
@@ -96,7 +96,7 @@ test_printf(unsigned verbose, FILE *fp,
boolean success = TRUE;
context = LLVMContextCreate();
-#if LLVM_VERSION_MAJOR >= 15
+#if LLVM_VERSION_MAJOR == 15
LLVMContextSetOpaquePointers(context, false);
#endif
gallivm = gallivm_create("test_module", context, NULL);
--
2.17.1
|