Line 0
Link Here
|
|
|
1 |
commit 7372e3cf5f2d |
2 |
Author: Dave Airlie <airlied@redhat.com> |
3 |
Date: Wed Mar 15 07:15:50 2017 +1000 |
4 |
|
5 |
radv/ac: workaround regression in llvm 4.0 release |
6 |
|
7 |
LLVM 4.0 released with a pretty messy regression, that hopefully |
8 |
get fixed in the future. |
9 |
|
10 |
This work around was proposed by Tom, and it fixes the CTS regressions |
11 |
here at least, I'm not sure if this will cause any major side effects, |
12 |
but correctness over speed and all that. |
13 |
|
14 |
radeonsi should possibly consider the same workaround until an llvm |
15 |
fix can be found. |
16 |
|
17 |
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> |
18 |
Signed-off-by: Dave Airlie <airlied@redhat.com> |
19 |
|
20 |
--- src/amd/common/ac_llvm_util.c.orig 2017-03-20 14:08:50 UTC |
21 |
+++ src/amd/common/ac_llvm_util.c |
22 |
@@ -26,7 +26,7 @@ |
23 |
#include "ac_llvm_util.h" |
24 |
|
25 |
#include <llvm-c/Core.h> |
26 |
- |
27 |
+#include <llvm-c/Support.h> |
28 |
#include "c11/threads.h" |
29 |
|
30 |
#include <assert.h> |
31 |
@@ -47,6 +47,17 @@ static void ac_init_llvm_target() |
32 |
LLVMInitializeAMDGPUTarget(); |
33 |
LLVMInitializeAMDGPUTargetMC(); |
34 |
LLVMInitializeAMDGPUAsmPrinter(); |
35 |
+ |
36 |
+ /* |
37 |
+ * Workaround for bug in llvm 4.0 that causes image intrinsics |
38 |
+ * to disappear. |
39 |
+ * https://reviews.llvm.org/D26348 |
40 |
+ */ |
41 |
+#if HAVE_LLVM >= 0x0400 |
42 |
+ const char *argv[2] = {"mesa", "-simplifycfg-sink-common=false"}; |
43 |
+ LLVMParseCommandLineOptions(2, argv, NULL); |
44 |
+#endif |
45 |
+ |
46 |
#endif |
47 |
} |
48 |
|