Line 0
Link Here
|
|
|
1 |
https://cgit.freedesktop.org/mesa/mesa/commit/?id=84012262ea70 |
2 |
https://cgit.freedesktop.org/mesa/mesa/commit/?id=6e2b9fd07171 |
3 |
https://cgit.freedesktop.org/mesa/mesa/commit/?id=d9f8bae616dd |
4 |
|
5 |
--- src/amd/common/ac_llvm_helper.cpp.orig 2017-04-01 15:33:36 UTC |
6 |
+++ src/amd/common/ac_llvm_helper.cpp |
7 |
@@ -37,18 +37,24 @@ |
8 |
#include <llvm/ExecutionEngine/ExecutionEngine.h> |
9 |
#include <llvm/IR/Attributes.h> |
10 |
|
11 |
+#if HAVE_LLVM < 0x0500 |
12 |
+namespace llvm { |
13 |
+typedef AttributeSet AttributeList; |
14 |
+} |
15 |
+#endif |
16 |
+ |
17 |
void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes) |
18 |
{ |
19 |
llvm::Argument *A = llvm::unwrap<llvm::Argument>(val); |
20 |
llvm::AttrBuilder B; |
21 |
B.addDereferenceableAttr(bytes); |
22 |
- A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1, B)); |
23 |
+ A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1, B)); |
24 |
} |
25 |
|
26 |
bool ac_is_sgpr_param(LLVMValueRef arg) |
27 |
{ |
28 |
llvm::Argument *A = llvm::unwrap<llvm::Argument>(arg); |
29 |
- llvm::AttributeSet AS = A->getParent()->getAttributes(); |
30 |
+ llvm::AttributeList AS = A->getParent()->getAttributes(); |
31 |
unsigned ArgNo = A->getArgNo(); |
32 |
return AS.hasAttribute(ArgNo + 1, llvm::Attribute::ByVal) || |
33 |
AS.hasAttribute(ArgNo + 1, llvm::Attribute::InReg); |
34 |
--- src/gallium/auxiliary/gallivm/lp_bld_misc.cpp.orig 2017-04-01 15:33:37 UTC |
35 |
+++ src/gallium/auxiliary/gallivm/lp_bld_misc.cpp |
36 |
@@ -755,17 +755,6 @@ lp_free_memory_manager(LLVMMCJITMemoryMa |
37 |
delete reinterpret_cast<BaseMemoryManager*>(memorymgr); |
38 |
} |
39 |
|
40 |
-extern "C" void |
41 |
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes) |
42 |
-{ |
43 |
-#if HAVE_LLVM >= 0x0306 |
44 |
- llvm::Argument *A = llvm::unwrap<llvm::Argument>(val); |
45 |
- llvm::AttrBuilder B; |
46 |
- B.addDereferenceableAttr(bytes); |
47 |
- A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1, B)); |
48 |
-#endif |
49 |
-} |
50 |
- |
51 |
extern "C" LLVMValueRef |
52 |
lp_get_called_value(LLVMValueRef call) |
53 |
{ |
54 |
--- src/gallium/auxiliary/gallivm/lp_bld_misc.h.orig 2017-04-01 15:33:37 UTC |
55 |
+++ src/gallium/auxiliary/gallivm/lp_bld_misc.h |
56 |
@@ -73,9 +73,6 @@ lp_get_default_memory_manager(); |
57 |
extern void |
58 |
lp_free_memory_manager(LLVMMCJITMemoryManagerRef memorymgr); |
59 |
|
60 |
-extern void |
61 |
-lp_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes); |
62 |
- |
63 |
extern LLVMValueRef |
64 |
lp_get_called_value(LLVMValueRef call); |
65 |
|
66 |
--- src/gallium/drivers/radeonsi/si_shader.c.orig 2017-04-01 15:33:37 UTC |
67 |
+++ src/gallium/drivers/radeonsi/si_shader.c |
68 |
@@ -5502,7 +5502,7 @@ static void si_create_function(struct si |
69 |
*/ |
70 |
if (LLVMGetTypeKind(LLVMTypeOf(P)) == LLVMPointerTypeKind) { |
71 |
lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_BYVAL); |
72 |
- lp_add_attr_dereferenceable(P, UINT64_MAX); |
73 |
+ ac_add_attr_dereferenceable(P, UINT64_MAX); |
74 |
} else |
75 |
lp_add_function_attr(ctx->main_fn, i + 1, LP_FUNC_ATTR_INREG); |
76 |
} |
77 |
--- src/gallium/state_trackers/clover/llvm/compat.hpp.orig 2017-04-01 15:33:37 UTC |
78 |
+++ src/gallium/state_trackers/clover/llvm/compat.hpp |
79 |
@@ -83,7 +83,14 @@ namespace clover { |
80 |
inline void |
81 |
add_link_bitcode_file(clang::CodeGenOptions &opts, |
82 |
const std::string &path) { |
83 |
-#if HAVE_LLVM >= 0x0308 |
84 |
+#if HAVE_LLVM >= 0x0500 |
85 |
+ clang::CodeGenOptions::BitcodeFileToLink F; |
86 |
+ |
87 |
+ F.Filename = path; |
88 |
+ F.PropagateAttrs = true; |
89 |
+ F.LinkFlags = ::llvm::Linker::Flags::None; |
90 |
+ opts.LinkBitcodeFiles.emplace_back(F); |
91 |
+#elif HAVE_LLVM >= 0x0308 |
92 |
opts.LinkBitcodeFiles.emplace_back(::llvm::Linker::Flags::None, path); |
93 |
#else |
94 |
opts.LinkBitcodeFile = path; |