diff options
Diffstat (limited to 'recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch')
-rw-r--r-- | recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch b/recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch deleted file mode 100644 index ee5cbaf..0000000 --- a/recipes-core/llvm/llvm2.8/30may-llvm2.8-pr399-ppc-arm.patch +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | Index: llvm-2.8/lib/ExecutionEngine/JIT/JIT.cpp | ||
2 | =================================================================== | ||
3 | --- llvm-2.8.orig/lib/ExecutionEngine/JIT/JIT.cpp 2010-08-17 18:19:18.000000000 +0200 | ||
4 | +++ llvm-2.8/lib/ExecutionEngine/JIT/JIT.cpp 2011-12-19 21:16:21.884288536 +0100 | ||
5 | @@ -252,7 +252,12 @@ | ||
6 | MutexGuard guard(Lock); | ||
7 | JITs.erase(jit); | ||
8 | } | ||
9 | - void *getPointerToNamedFunction(const char *Name) const { | ||
10 | + bool empty() { | ||
11 | + MutexGuard guard(Lock); | ||
12 | + return JITs.empty(); | ||
13 | + } | ||
14 | + void *getPointerToNamedFunction(const char *Name, | ||
15 | + bool AbortOnFailure = true) const { | ||
16 | MutexGuard guard(Lock); | ||
17 | assert(JITs.size() != 0 && "No Jit registered"); | ||
18 | //search function in every instance of JIT | ||
19 | @@ -264,7 +269,19 @@ | ||
20 | } | ||
21 | // The function is not available : fallback on the first created (will | ||
22 | // search in symbol of the current program/library) | ||
23 | - return (*JITs.begin())->getPointerToNamedFunction(Name); | ||
24 | + return (*JITs.begin())->getPointerToNamedFunction(Name, AbortOnFailure); | ||
25 | + } | ||
26 | + void *getPointerToGlobalIfAvailable(GlobalValue *V) const { | ||
27 | + MutexGuard guard(Lock); | ||
28 | + assert(JITs.size() != 0 && "No Jit registered"); | ||
29 | + //search function in every instance of JIT | ||
30 | + for (SmallPtrSet<JIT*, 1>::const_iterator Jit = JITs.begin(), | ||
31 | + end = JITs.end(); | ||
32 | + Jit != end; ++Jit) { | ||
33 | + if (void *Ptr = (*Jit)->getPointerToGlobalIfAvailable(V)) | ||
34 | + return Ptr; | ||
35 | + } | ||
36 | + return 0; | ||
37 | } | ||
38 | }; | ||
39 | ManagedStatic<JitPool> AllJits; | ||
40 | @@ -280,6 +297,22 @@ | ||
41 | } | ||
42 | } | ||
43 | |||
44 | +extern "C" { | ||
45 | + // getPointerToNamedFunctionOrNull - same as the above, but returns | ||
46 | + // NULL instead of aborting if the function cannot be found. | ||
47 | + void *getPointerToNamedFunctionOrNull(const char *Name) { | ||
48 | + return !AllJits->empty() ? AllJits->getPointerToNamedFunction(Name, false) : 0; | ||
49 | + } | ||
50 | +} | ||
51 | + | ||
52 | +extern "C" { | ||
53 | + // getPointerToGlobalIfAvailable - same as the above, but for global | ||
54 | + // variables, and only for those that have been codegened already. | ||
55 | + void *getPointerToGlobalIfAvailable(GlobalValue *V) { | ||
56 | + return !AllJits->empty() ? AllJits->getPointerToGlobalIfAvailable(V) : 0; | ||
57 | + } | ||
58 | +} | ||
59 | + | ||
60 | JIT::JIT(Module *M, TargetMachine &tm, TargetJITInfo &tji, | ||
61 | JITMemoryManager *JMM, CodeGenOpt::Level OptLevel, bool GVsWithCode) | ||
62 | : ExecutionEngine(M), TM(tm), TJI(tji), AllocateGVsWithCode(GVsWithCode), | ||
63 | Index: llvm-2.8/lib/Target/ARM/ARMISelLowering.cpp | ||
64 | =================================================================== | ||
65 | --- llvm-2.8.orig/lib/Target/ARM/ARMISelLowering.cpp 2010-09-03 03:35:08.000000000 +0200 | ||
66 | +++ llvm-2.8/lib/Target/ARM/ARMISelLowering.cpp 2011-12-19 21:16:21.884288536 +0100 | ||
67 | @@ -1119,6 +1119,9 @@ | ||
68 | } | ||
69 | } | ||
70 | |||
71 | +extern "C" void *getPointerToNamedFunctionOrNull(const char *Name); | ||
72 | +extern "C" void *getPointerToGlobalIfAvailable(GlobalValue *Value); | ||
73 | + | ||
74 | /// LowerCall - Lowering a call into a callseq_start <- | ||
75 | /// ARMISD:CALL <- callseq_end chain. Also add input and output parameter | ||
76 | /// nodes. | ||
77 | @@ -1272,6 +1275,26 @@ | ||
78 | InFlag =SDValue(); | ||
79 | } | ||
80 | |||
81 | + EVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); | ||
82 | + | ||
83 | + // XXX Work around for http://llvm.org/bugs/show_bug.cgi?id=5201 | ||
84 | + // and http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=399 | ||
85 | + // for Shark. | ||
86 | + // | ||
87 | + // If the callee is an ExternalSymbol node, and the symbol can be | ||
88 | + // resolved to a function pointer, then insert that pointer as a | ||
89 | + // constant. This causes the next block of code to fall into the | ||
90 | + // block that emits an indirect call. This works around | ||
91 | + // | ||
92 | + // This works for Shark because the only kinds of call that Shark | ||
93 | + // makes that do not already fall into the indirect call block are | ||
94 | + // calls to pre-existing external functions. | ||
95 | + if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee)) { | ||
96 | + void *FuncPtr = getPointerToNamedFunctionOrNull(S->getSymbol()); | ||
97 | + if (FuncPtr) | ||
98 | + Callee = DAG.getConstant((uint64_t) FuncPtr, PtrVT); | ||
99 | + } | ||
100 | + | ||
101 | // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every | ||
102 | // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol | ||
103 | // node so that legalize doesn't hack it. | ||
104 | Index: llvm-2.8/tools/llc/CMakeLists.txt | ||
105 | =================================================================== | ||
106 | --- llvm-2.8.orig/tools/llc/CMakeLists.txt 2009-09-03 00:45:31.000000000 +0200 | ||
107 | +++ llvm-2.8/tools/llc/CMakeLists.txt 2011-12-19 21:16:21.884288536 +0100 | ||
108 | @@ -1,4 +1,4 @@ | ||
109 | -set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} bitreader asmparser) | ||
110 | +set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} jit bitreader asmparser) | ||
111 | |||
112 | add_llvm_tool(llc | ||
113 | llc.cpp | ||