]> git.pld-linux.org Git - packages/Mesa.git/blame - Mesa-llvm.patch
- up to 9.1.4
[packages/Mesa.git] / Mesa-llvm.patch
CommitLineData
7a8ebc57
AM
1From 7cd248aa7938a068663fcd605169b7d4e21636bf Mon Sep 17 00:00:00 2001
2From: Tom Stellard <thomas.stellard@amd.com>
3Date: Wed, 13 Feb 2013 20:59:41 +0000
4Subject: radeon/llvm: Fix build with LLVM 3.3
5
6---
7diff --git a/src/gallium/drivers/r600/llvm_wrapper.cpp b/src/gallium/drivers/r600/llvm_wrapper.cpp
8index 81f5397..ae2f4d2 100644
9--- a/src/gallium/drivers/r600/llvm_wrapper.cpp
10+++ b/src/gallium/drivers/r600/llvm_wrapper.cpp
11@@ -1,6 +1,10 @@
12 #include <llvm/ADT/OwningPtr.h>
13 #include <llvm/ADT/StringRef.h>
14+#if HAVE_LLVM < 0x0303
15 #include <llvm/LLVMContext.h>
16+#else
17+#include <llvm/IR/LLVMContext.h>
18+#endif
19 #include <llvm/PassManager.h>
20 #include <llvm/Support/IRReader.h>
21 #include <llvm/Support/MemoryBuffer.h>
22diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
23index 903e102..0491e64 100644
24--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
25+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
26@@ -25,8 +25,16 @@
27 */
28 #include "radeon_llvm_emit.h"
29
30+#if HAVE_LLVM < 0x0303
31 #include <llvm/LLVMContext.h>
32 #include <llvm/Module.h>
33+#include <llvm/DataLayout.h>
34+#else
35+#include <llvm/IR/LLVMContext.h>
36+#include <llvm/IR/Module.h>
37+#include <llvm/IR/DataLayout.h>
38+#endif
39+
40 #include <llvm/PassManager.h>
41 #include <llvm/ADT/Triple.h>
42 #include <llvm/Support/FormattedStream.h>
43@@ -39,7 +47,6 @@
44 #include <llvm/Target/TargetMachine.h>
45 #include <llvm/Transforms/Scalar.h>
46 #include <llvm-c/Target.h>
47-#include <llvm/DataLayout.h>
48
49 #include <iostream>
50 #include <stdlib.h>
51--
52cgit v0.9.0.2-2-gbebe
53From 1f006717db5258e703d83b37772b85ad25bf3319 Mon Sep 17 00:00:00 2001
54From: Tom Stellard <thomas.stellard@amd.com>
55Date: Wed, 13 Feb 2013 20:57:25 +0000
56Subject: r600g: Add $(DEFINES) to AM_CXXFLAGS
57
58This way llvm_wrapper.cpp is compiled with -DHAVE_LLVM=0x....
59---
60(limited to 'src/gallium')
61
62diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
63index 6f48b56..e1c8574 100644
64--- a/src/gallium/drivers/r600/Makefile.am
65+++ b/src/gallium/drivers/r600/Makefile.am
66@@ -26,7 +26,8 @@ AM_CFLAGS += \
67 -I$(top_srcdir)/src/gallium/drivers/radeon/
68
69 AM_CXXFLAGS= \
70- $(LLVM_CXXFLAGS)
71+ $(LLVM_CXXFLAGS) \
72+ $(DEFINES)
73 endif
74
75 if USE_R600_LLVM_COMPILER
76--
77cgit v0.9.0.2-2-gbebe
78From ead4db420e9e5408f41c70768a290592a384aedb Mon Sep 17 00:00:00 2001
79From: Tom Stellard <thomas.stellard@amd.com>
80Date: Tue, 23 Apr 2013 14:57:54 +0000
81Subject: gallivm: Fix build with LLVM >= r180063
82
83---
7a8ebc57
AM
84diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
85index 024819e..717afa7 100644
86--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
87+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
88@@ -67,6 +67,10 @@
89 #include <llvm/Target/TargetSelect.h>
90 #endif /* HAVE_LLVM < 0x0300 */
91
92+#if HAVE_LLVM >= 0x0303
93+#include <llvm/Wrap.h>
94+#endif
95+
96 #include "pipe/p_config.h"
97 #include "util/u_debug.h"
98 #include "util/u_cpu_detect.h"
99--
100cgit v0.9.0.2-2-gbebe
101From a0c8942bb4742b4bd22f494cea4dcd59d9ca99ab Mon Sep 17 00:00:00 2001
102From: Tom Stellard <thomas.stellard@amd.com>
103Date: Tue, 23 Apr 2013 14:58:38 +0000
104Subject: radeon/llvm: Fix build with LLVM >= r180063
105
106---
107diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
108index d2dc035..5b770d0 100644
109--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
110+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
111@@ -47,6 +47,7 @@
112 #include <llvm/Support/Threading.h>
113 #include <llvm/Target/TargetMachine.h>
114 #include <llvm/Transforms/Scalar.h>
115+#include <llvm/Wrap.h>
116 #include <llvm-c/Target.h>
117
118 #include <iostream>
119--
120cgit v0.9.0.2-2-gbebe
121From 6249db73ea580e6a54874235ffb3a7d42ac63bb4 Mon Sep 17 00:00:00 2001
122From: Christian König <christian.koenig@amd.com>
123Date: Tue, 26 Mar 2013 10:37:45 +0000
124Subject: radeon/llvm: remove uneeded inclusion
125
126The include isn't needed and the file has moved with LLVM master.
127
128Signed-off-by: Christian König <christian.koenig@amd.com>
129Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
130---
131(limited to 'src/gallium/drivers/radeon/radeon_llvm_emit.cpp')
132
133diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
134index ee82a90..a23532b 100644
135--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
136+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
137@@ -41,7 +41,6 @@
138 #include <llvm/ADT/Triple.h>
139 #include <llvm/Support/FormattedStream.h>
140 #include <llvm/Support/Host.h>
141-#include <llvm/Support/IRReader.h>
142 #include <llvm/Support/SourceMgr.h>
143 #include <llvm/Support/TargetRegistry.h>
144 #include <llvm/Support/TargetSelect.h>
145--
146cgit v0.9.0.2-2-gbebe
147diff -ur a/src/gallium/drivers/r600/llvm_wrapper.cpp b/src/gallium/drivers/r600/llvm_wrapper.cpp
148--- a/src/gallium/drivers/r600/llvm_wrapper.cpp 2013-03-05 23:54:28.000000000 +0100
149+++ b/src/gallium/drivers/r600/llvm_wrapper.cpp 2013-05-02 17:46:36.411226826 +0200
150@@ -2,7 +2,12 @@
151 #include <llvm/ADT/StringRef.h>
152 #include <llvm/LLVMContext.h>
153 #include <llvm/PassManager.h>
154+#if HAVE_LLVM < 0x0303
155 #include <llvm/Support/IRReader.h>
156+#else
157+#include <llvm/IRReader/IRReader.h>
158+#include <llvm/Support/CBindingWrapping.h>
159+#endif /* HAVE_LLVM < 0x0303 */
160 #include <llvm/Support/MemoryBuffer.h>
161 #include <llvm/Support/SourceMgr.h>
162 #include <llvm/Transforms/IPO.h>
163diff -ur a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
164--- a/src/gallium/drivers/r600/Makefile.am 2013-03-05 23:54:28.000000000 +0100
165+++ b/src/gallium/drivers/r600/Makefile.am 2013-05-02 18:00:20.035242047 +0200
166@@ -23,6 +23,7 @@
167
168 AM_CFLAGS += \
169 $(LLVM_CFLAGS) \
170+ -lLLVMIRReader \
171 -I$(top_srcdir)/src/gallium/drivers/radeon/
172
173 AM_CXXFLAGS= \
174From 4742f9b00b804dd01eb9955dd386a2373cd8eb36 Mon Sep 17 00:00:00 2001
175From: Armin K <krejzi@email.com>
176Date: Thu, 02 May 2013 10:55:04 +0000
177Subject: gallivm: Fix build with LLVM 3.3
178
179Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
180---
181diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
182index 717afa7..a531d98 100644
183--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
184+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
185@@ -68,7 +68,9 @@
186 #endif /* HAVE_LLVM < 0x0300 */
187
188 #if HAVE_LLVM >= 0x0303
189-#include <llvm/Wrap.h>
190+#include <llvm/IR/IRBuilder.h>
191+#include <llvm/IR/Module.h>
192+#include <llvm/Support/CBindingWrapping.h>
193 #endif
194
195 #include "pipe/p_config.h"
196--
197cgit v0.9.0.2-2-gbebe
198From cd84353d576246273d1c6ae8e96b65217be15ebc Mon Sep 17 00:00:00 2001
199From: Armin K <krejzi@email.com>
200Date: Thu, 02 May 2013 10:55:05 +0000
201Subject: radeon: Fix build with LLVM 3.3
202
203Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
204---
205diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
206index 55dad9b..fb974f9 100644
207--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
208+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
209@@ -39,6 +39,7 @@
210
211 #include <llvm/PassManager.h>
212 #include <llvm/ADT/Triple.h>
213+#include <llvm/Support/CBindingWrapping.h>
214 #include <llvm/Support/FormattedStream.h>
215 #include <llvm/Support/Host.h>
216 #include <llvm/Support/SourceMgr.h>
217@@ -47,7 +48,6 @@
218 #include <llvm/Support/Threading.h>
219 #include <llvm/Target/TargetMachine.h>
220 #include <llvm/Transforms/Scalar.h>
221-#include <llvm/Wrap.h>
222 #include <llvm-c/Target.h>
223
224 #include <iostream>
7a8ebc57
AM
225 # Provide compatibility with scripts for the old Mesa build system for
226--
2271.8.1.5
228
229Signed-off-by: Vinson Lee <vlee at freedesktop.org>
230---
231 src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 4 +++-
232 1 file changed, 3 insertions(+), 1 deletion(-)
233
234diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
235index 86617d4..1c886ea 100644
236--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
237+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
238@@ -212,7 +212,9 @@ disassemble(const void* func, llvm::raw_ostream & Out)
239 std::string Error;
240 const Target *T = TargetRegistry::lookupTarget(Triple, Error);
241
242-#if HAVE_LLVM >= 0x0300
243+#if HAVE_LLVM >= 0x0304
244+ OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(*T->createMCRegInfo(Triple), Triple));
245+#elif HAVE_LLVM >= 0x0300
246 OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(Triple));
247 #else
248 OwningPtr<const MCAsmInfo> AsmInfo(T->createAsmInfo(Triple));
249--
2501.8.2.1
49e00572
AM
251--- x/src/gallium/state_trackers/clover/llvm/invocation.cpp.org 2013-06-19 12:06:31.055563544 +0200
252+++ x/src/gallium/state_trackers/clover/llvm/invocation.cpp 2013-06-19 12:16:58.645029877 +0200
253@@ -28,10 +28,18 @@
254 #include <clang/CodeGen/CodeGenAction.h>
255 #include <llvm/Bitcode/BitstreamWriter.h>
256 #include <llvm/Bitcode/ReaderWriter.h>
257+#if HAVE_LLVM < 0x0303
258 #include <llvm/DerivedTypes.h>
259-#include <llvm/Linker.h>
260 #include <llvm/LLVMContext.h>
261 #include <llvm/Module.h>
262+#else
263+#include <llvm/IR/DerivedTypes.h>
264+#include <llvm/IR/LLVMContext.h>
265+#include <llvm/IR/Module.h>
266+#include <llvm/Support/SourceMgr.h>
267+#include <llvm/IRReader/IRReader.h>
268+#endif
269+#include <llvm/Linker.h>
270 #include <llvm/PassManager.h>
271 #include <llvm/Support/TargetSelect.h>
272 #include <llvm/Support/MemoryBuffer.h>
273@@ -41,8 +49,10 @@
274
275 #if HAVE_LLVM < 0x0302
276 #include <llvm/Target/TargetData.h>
277-#else
278+#elif HAVE_LLVM < 0x0303
279 #include <llvm/DataLayout.h>
280+#else
281+#include <llvm/IR/DataLayout.h>
282 #endif
283
284 #include "pipe/p_state.h"
285@@ -151,7 +161,11 @@
286 // Add libclc generic search path
287 c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR,
288 clang::frontend::Angled,
289- false, false, false);
290+ false, false
291+#if HAVE_LLVM < 0x0303
292+ , false
293+#endif
294+ );
295
296 // Add libclc include
297 c.getPreprocessorOpts().Includes.push_back("clc/clc.h");
298@@ -167,8 +181,12 @@
299 c.getInvocation().setLangDefaults(c.getLangOpts(), clang::IK_OpenCL,
300 clang::LangStandard::lang_opencl11);
301 #endif
302- c.createDiagnostics(0, NULL, new clang::TextDiagnosticPrinter(
303- s_log,
304+ c.createDiagnostics(
305+#if HAVE_LLVM < 0x0303
306+ 0, NULL,
307+#endif
308+ new clang::TextDiagnosticPrinter(
309+ s_log,
310 #if HAVE_LLVM <= 0x0301
311 c.getDiagnosticOpts()));
312 #else
313@@ -201,12 +219,26 @@
314
315 llvm::PassManager PM;
316 llvm::PassManagerBuilder Builder;
317- bool isNative;
318- llvm::Linker linker("clover", mod);
319+ llvm::sys::Path libclc_path =
320+ llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc");
321
322 // Link the kernel with libclc
323- linker.LinkInFile(llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc"), isNative);
324+#if HAVE_LLVM < 0x0303
325+ bool isNative;
326+ llvm::Linker linker("clover", mod);
327+ linker.LinkInFile(libclc_path, isNative);
328 mod = linker.releaseModule();
329+#else
330+ std::string err_str;
331+ llvm::SMDiagnostic err;
332+ llvm::Module *libclc_mod = llvm::ParseIRFile(libclc_path.str(), err,
333+ mod->getContext());
334+ if (llvm::Linker::LinkModules(mod, libclc_mod,
335+ llvm::Linker::DestroySource,
336+ &err_str)) {
337+ throw build_error(err_str);
338+ }
339+#endif
340
341 // Add a function internalizer pass.
342 //
343--- ./src/gallium/drivers/r600/llvm_wrapper.cpp~ 2013-06-19 12:24:15.000000000 +0200
344+++ ./src/gallium/drivers/r600/llvm_wrapper.cpp 2013-06-19 12:29:10.363799511 +0200
345@@ -11,6 +11,7 @@
346 #else
347 #include <llvm/IRReader/IRReader.h>
348 #include <llvm/Support/CBindingWrapping.h>
349+#include <llvm/LinkAllIR.h>
350 #endif /* HAVE_LLVM < 0x0303 */
351 #include <llvm/Support/MemoryBuffer.h>
352 #include <llvm/Support/SourceMgr.h>
aadc36a9
AM
353--- Mesa-9.1.3/src/gallium/targets/opencl/Makefile.am~ 2013-03-05 23:54:28.000000000 +0100
354+++ Mesa-9.1.3/src/gallium/targets/opencl/Makefile.am 2013-06-19 12:38:56.722221012 +0200
355@@ -21,9 +21,9 @@
356 -lclangSema \
357 -lclangAnalysis \
358 -lclangAST \
359+ -lclangEdit \
360 -lclangLex \
361 -lclangBasic \
362- -lclangEdit \
363 $(LLVM_LIBS)
364
365
This page took 0.074088 seconds and 4 git commands to generate.