Mercurial > octave-nkf
annotate libinterp/interp-core/jit-typeinfo.h @ 15370:8355fddce815
Use sret and do not use save/restore stack (bug #37308)
* jit-typeinfo.cc (octave_jit_grab_matrix, octave_jit_cast_matrix_any,
octave_jit_paren_subsasgn_impl, octave_jit_paren_scalar_subsasgn,
octave_jit_paren_subsasgn_matrix_range): Return matrix directly.
(octave_jit_cast_range_any): Return range directly.
(jit_function::jit_function): Maybe mark llvm function return as sret.
(jit_function::call): Maybe mark llvm call sret and place allocas at function
entry.
(jit_function::do_return): Handle new parameter, verify.
(jit_typeinfo::jit_typeinfo): Match C++ std::complex type better, pass
jit_convetion::external explicitly, and disable right complex division.
(jit_typeinfo::create_identity): Improve name.
(jit_typeinfo::pack_complex, jit_typeinfo::unpack_complex): Handle changed
complex format.
* jit-typeinfo.h (jit_array::jit_array): New overload.
(jit_type::mark_sret, jit_type::mark_pointer_arg): Remove default convention.
(jit_function::do_return): Add verify parameter.
* pt-jit.cc (jit_convert_llvm::convert_function): Store the jit_function.
(jit_convert::visit): Call do_return if converting a function.
* pt-jit.h (jit_convert_llvm::creating): New member variable.
author | Max Brister <max@2bass.com> |
---|---|
date | Wed, 12 Sep 2012 19:18:51 -0600 |
parents | 3f43e9d6d86e |
children | 8ccb187b24e9 |
rev | line source |
---|---|
15016 | 1 /* |
2 | |
3 Copyright (C) 2012 Max Brister <max@2bass.com> | |
4 | |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 3 of the License, or (at your | |
10 option) any later version. | |
11 | |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with Octave; see the file COPYING. If not, see | |
19 <http://www.gnu.org/licenses/>. | |
20 | |
21 */ | |
22 | |
23 #if !defined (octave_jit_typeinfo_h) | |
24 #define octave_jit_typeinfo_h 1 | |
25 | |
26 #ifdef HAVE_LLVM | |
27 | |
28 #include <map> | |
29 #include <vector> | |
30 | |
31 #include "Range.h" | |
32 #include "jit-util.h" | |
33 | |
34 // Defines the type system used by jit and a singleton class, jit_typeinfo, to | |
35 // manage the types. | |
36 // | |
37 // FIXME: | |
38 // Operations are defined and implemented in jit_typeinfo. Eventually they | |
39 // should be moved elsewhere. (just like with octave_typeinfo) | |
40 | |
41 // jit_range is compatable with the llvm range structure | |
42 struct | |
43 jit_range | |
44 { | |
45 jit_range (const Range& from) : base (from.base ()), limit (from.limit ()), | |
46 inc (from.inc ()), nelem (from.nelem ()) | |
47 {} | |
48 | |
49 operator Range () const | |
50 { | |
51 return Range (base, limit, inc); | |
52 } | |
53 | |
54 bool all_elements_are_ints () const; | |
55 | |
56 double base; | |
57 double limit; | |
58 double inc; | |
59 octave_idx_type nelem; | |
60 }; | |
61 | |
62 std::ostream& operator<< (std::ostream& os, const jit_range& rng); | |
63 | |
64 // jit_array is compatable with the llvm array/matrix structures | |
65 template <typename T, typename U> | |
66 struct | |
67 jit_array | |
68 { | |
15370
8355fddce815
Use sret and do not use save/restore stack (bug #37308)
Max Brister <max@2bass.com>
parents:
15337
diff
changeset
|
69 jit_array () : array (0) {} |
8355fddce815
Use sret and do not use save/restore stack (bug #37308)
Max Brister <max@2bass.com>
parents:
15337
diff
changeset
|
70 |
15016 | 71 jit_array (T& from) : array (new T (from)) |
72 { | |
73 update (); | |
74 } | |
75 | |
76 void update (void) | |
77 { | |
78 ref_count = array->jit_ref_count (); | |
79 slice_data = array->jit_slice_data () - 1; | |
80 slice_len = array->capacity (); | |
81 dimensions = array->jit_dimensions (); | |
82 } | |
83 | |
84 void update (T *aarray) | |
85 { | |
86 array = aarray; | |
87 update (); | |
88 } | |
89 | |
90 operator T () const | |
91 { | |
92 return *array; | |
93 } | |
94 | |
95 int *ref_count; | |
96 | |
97 U *slice_data; | |
98 octave_idx_type slice_len; | |
99 octave_idx_type *dimensions; | |
100 | |
101 T *array; | |
102 }; | |
103 | |
104 typedef jit_array<NDArray, double> jit_matrix; | |
105 | |
106 std::ostream& operator<< (std::ostream& os, const jit_matrix& mat); | |
107 | |
108 // calling convention | |
109 namespace | |
110 jit_convention | |
111 { | |
112 enum | |
113 type | |
114 { | |
115 // internal to jit | |
116 internal, | |
117 | |
118 // an external C call | |
119 external, | |
120 | |
121 length | |
122 }; | |
123 } | |
124 | |
125 // Used to keep track of estimated (infered) types during JIT. This is a | |
126 // hierarchical type system which includes both concrete and abstract types. | |
127 // | |
128 // The types form a lattice. Currently we only allow for one parent type, but | |
129 // eventually we may allow for multiple predecessors. | |
130 class | |
131 jit_type | |
132 { | |
133 public: | |
134 typedef llvm::Value *(*convert_fn) (llvm::IRBuilderD&, llvm::Value *); | |
135 | |
136 jit_type (const std::string& aname, jit_type *aparent, llvm::Type *allvm_type, | |
15124
0464e3ceb85b
Skip functions when resolving end context in JIT
Max Brister <max@2bass.com>
parents:
15102
diff
changeset
|
137 bool askip_paren, int aid); |
15016 | 138 |
139 // a user readable type name | |
140 const std::string& name (void) const { return mname; } | |
141 | |
142 // a unique id for the type | |
143 int type_id (void) const { return mid; } | |
144 | |
145 // An abstract base type, may be null | |
146 jit_type *parent (void) const { return mparent; } | |
147 | |
148 // convert to an llvm type | |
149 llvm::Type *to_llvm (void) const { return llvm_type; } | |
150 | |
151 // how this type gets passed as a function argument | |
152 llvm::Type *to_llvm_arg (void) const; | |
153 | |
154 size_t depth (void) const { return mdepth; } | |
155 | |
15124
0464e3ceb85b
Skip functions when resolving end context in JIT
Max Brister <max@2bass.com>
parents:
15102
diff
changeset
|
156 bool skip_paren (void) const { return mskip_paren; } |
0464e3ceb85b
Skip functions when resolving end context in JIT
Max Brister <max@2bass.com>
parents:
15102
diff
changeset
|
157 |
15016 | 158 // -------------------- Calling Convention information -------------------- |
159 | |
160 // A function declared like: mytype foo (int arg0, int arg1); | |
161 // Will be converted to: void foo (mytype *retval, int arg0, int arg1) | |
162 // if mytype is sret. The caller is responsible for allocating space for | |
163 // retval. (on the stack) | |
164 bool sret (jit_convention::type cc) const { return msret[cc]; } | |
165 | |
15370
8355fddce815
Use sret and do not use save/restore stack (bug #37308)
Max Brister <max@2bass.com>
parents:
15337
diff
changeset
|
166 void mark_sret (jit_convention::type cc) |
15016 | 167 { msret[cc] = true; } |
168 | |
169 // A function like: void foo (mytype arg0) | |
170 // Will be converted to: void foo (mytype *arg0) | |
171 // Basically just pass by reference. | |
172 bool pointer_arg (jit_convention::type cc) const { return mpointer_arg[cc]; } | |
173 | |
15370
8355fddce815
Use sret and do not use save/restore stack (bug #37308)
Max Brister <max@2bass.com>
parents:
15337
diff
changeset
|
174 void mark_pointer_arg (jit_convention::type cc) |
15016 | 175 { mpointer_arg[cc] = true; } |
176 | |
177 // Convert into an equivalent form before calling. For example, complex is | |
178 // represented as two values llvm vector, but we need to pass it as a two | |
179 // valued llvm structure to C functions. | |
180 convert_fn pack (jit_convention::type cc) { return mpack[cc]; } | |
181 | |
182 void set_pack (jit_convention::type cc, convert_fn fn) { mpack[cc] = fn; } | |
183 | |
184 // The inverse operation of pack. | |
185 convert_fn unpack (jit_convention::type cc) { return munpack[cc]; } | |
186 | |
187 void set_unpack (jit_convention::type cc, convert_fn fn) | |
188 { munpack[cc] = fn; } | |
189 | |
190 // The resulting type after pack is called. | |
191 llvm::Type *packed_type (jit_convention::type cc) | |
192 { return mpacked_type[cc]; } | |
193 | |
194 void set_packed_type (jit_convention::type cc, llvm::Type *ty) | |
195 { mpacked_type[cc] = ty; } | |
196 private: | |
197 std::string mname; | |
198 jit_type *mparent; | |
199 llvm::Type *llvm_type; | |
200 int mid; | |
201 size_t mdepth; | |
15124
0464e3ceb85b
Skip functions when resolving end context in JIT
Max Brister <max@2bass.com>
parents:
15102
diff
changeset
|
202 bool mskip_paren; |
15016 | 203 |
204 bool msret[jit_convention::length]; | |
205 bool mpointer_arg[jit_convention::length]; | |
206 | |
207 convert_fn mpack[jit_convention::length]; | |
208 convert_fn munpack[jit_convention::length]; | |
209 | |
210 llvm::Type *mpacked_type[jit_convention::length]; | |
211 }; | |
212 | |
213 // seperate print function to allow easy printing if type is null | |
214 std::ostream& jit_print (std::ostream& os, jit_type *atype); | |
215 | |
216 class jit_value; | |
217 | |
218 // An abstraction for calling llvm functions with jit_values. Deals with calling | |
219 // convention details. | |
220 class | |
221 jit_function | |
222 { | |
223 friend std::ostream& operator<< (std::ostream& os, const jit_function& fn); | |
224 public: | |
225 // create a function in an invalid state | |
226 jit_function (); | |
227 | |
228 jit_function (llvm::Module *amodule, jit_convention::type acall_conv, | |
229 const llvm::Twine& aname, jit_type *aresult, | |
230 const std::vector<jit_type *>& aargs); | |
231 | |
232 // Use an existing function, but change the argument types. The new argument | |
233 // types must behave the same for the current calling convention. | |
234 jit_function (const jit_function& fn, jit_type *aresult, | |
235 const std::vector<jit_type *>& aargs); | |
236 | |
237 jit_function (const jit_function& fn); | |
238 | |
15019
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
239 template <typename T> |
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
240 void add_mapping (llvm::ExecutionEngine *engine, T fn) |
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
241 { |
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
242 do_add_mapping (engine, reinterpret_cast<void *> (fn)); |
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
243 } |
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
244 |
15016 | 245 bool valid (void) const { return llvm_function; } |
246 | |
247 std::string name (void) const; | |
248 | |
249 llvm::BasicBlock *new_block (const std::string& aname = "body", | |
250 llvm::BasicBlock *insert_before = 0); | |
251 | |
252 llvm::Value *call (llvm::IRBuilderD& builder, | |
253 const std::vector<jit_value *>& in_args) const; | |
254 | |
255 llvm::Value *call (llvm::IRBuilderD& builder, | |
256 const std::vector<llvm::Value *>& in_args | |
257 = std::vector<llvm::Value *> ()) const; | |
258 | |
259 #define JIT_PARAM_ARGS llvm::IRBuilderD& builder, | |
260 #define JIT_PARAMS builder, | |
261 #define JIT_CALL(N) JIT_EXPAND (llvm::Value *, call, llvm::Value *, const, N) | |
262 | |
263 JIT_CALL (1) | |
264 JIT_CALL (2) | |
265 JIT_CALL (3) | |
266 JIT_CALL (4) | |
267 JIT_CALL (5) | |
268 | |
269 #undef JIT_CALL | |
270 | |
271 #define JIT_CALL(N) JIT_EXPAND (llvm::Value *, call, jit_value *, const, N) | |
272 | |
273 JIT_CALL (1); | |
274 JIT_CALL (2); | |
15102
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
275 JIT_CALL (3); |
15016 | 276 |
277 #undef JIT_CALL | |
278 #undef JIT_PARAMS | |
279 #undef JIT_PARAM_ARGS | |
280 | |
281 llvm::Value *argument (llvm::IRBuilderD& builder, size_t idx) const; | |
282 | |
15370
8355fddce815
Use sret and do not use save/restore stack (bug #37308)
Max Brister <max@2bass.com>
parents:
15337
diff
changeset
|
283 void do_return (llvm::IRBuilderD& builder, llvm::Value *rval = 0, |
8355fddce815
Use sret and do not use save/restore stack (bug #37308)
Max Brister <max@2bass.com>
parents:
15337
diff
changeset
|
284 bool verify = true); |
15016 | 285 |
286 llvm::Function *to_llvm (void) const { return llvm_function; } | |
287 | |
288 // If true, then the return value is passed as a pointer in the first argument | |
289 bool sret (void) const { return mresult && mresult->sret (call_conv); } | |
290 | |
291 bool can_error (void) const { return mcan_error; } | |
292 | |
293 void mark_can_error (void) { mcan_error = true; } | |
294 | |
295 jit_type *result (void) const { return mresult; } | |
296 | |
297 jit_type *argument_type (size_t idx) const | |
298 { | |
299 assert (idx < args.size ()); | |
300 return args[idx]; | |
301 } | |
302 | |
303 const std::vector<jit_type *>& arguments (void) const { return args; } | |
304 private: | |
15019
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
305 void do_add_mapping (llvm::ExecutionEngine *engine, void *fn); |
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
306 |
15016 | 307 llvm::Module *module; |
308 llvm::Function *llvm_function; | |
309 jit_type *mresult; | |
310 std::vector<jit_type *> args; | |
311 jit_convention::type call_conv; | |
312 bool mcan_error; | |
313 }; | |
314 | |
315 std::ostream& operator<< (std::ostream& os, const jit_function& fn); | |
316 | |
317 | |
318 // Keeps track of information about how to implement operations (+, -, *, ect) | |
319 // and their resulting types. | |
320 class | |
321 jit_operation | |
322 { | |
323 public: | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
324 // type signature vector |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
325 typedef std::vector<jit_type *> signature_vec; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
326 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
327 virtual ~jit_operation (void); |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
328 |
15016 | 329 void add_overload (const jit_function& func) |
330 { | |
331 add_overload (func, func.arguments ()); | |
332 } | |
333 | |
334 void add_overload (const jit_function& func, | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
335 const signature_vec& args); |
15016 | 336 |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
337 const jit_function& overload (const signature_vec& types) const; |
15016 | 338 |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
339 jit_type *result (const signature_vec& types) const |
15016 | 340 { |
341 const jit_function& temp = overload (types); | |
342 return temp.result (); | |
343 } | |
344 | |
345 #define JIT_PARAMS | |
346 #define JIT_PARAM_ARGS | |
347 #define JIT_OVERLOAD(N) \ | |
348 JIT_EXPAND (const jit_function&, overload, jit_type *, const, N) \ | |
349 JIT_EXPAND (jit_type *, result, jit_type *, const, N) | |
350 | |
351 JIT_OVERLOAD (1); | |
352 JIT_OVERLOAD (2); | |
353 JIT_OVERLOAD (3); | |
354 | |
355 #undef JIT_PARAMS | |
356 #undef JIT_PARAM_ARGS | |
357 | |
358 const std::string& name (void) const { return mname; } | |
359 | |
360 void stash_name (const std::string& aname) { mname = aname; } | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
361 protected: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
362 virtual jit_function *generate (const signature_vec& types) const; |
15016 | 363 private: |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
364 Array<octave_idx_type> to_idx (const signature_vec& types) const; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
365 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
366 const jit_function& do_generate (const signature_vec& types) const; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
367 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
368 struct signature_cmp |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
369 { |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
370 bool operator() (const signature_vec *lhs, const signature_vec *rhs); |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
371 }; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
372 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
373 typedef std::map<const signature_vec *, jit_function *, signature_cmp> |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
374 generated_map; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
375 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
376 mutable generated_map generated; |
15016 | 377 |
378 std::vector<Array<jit_function> > overloads; | |
379 | |
380 std::string mname; | |
381 }; | |
382 | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
383 class |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
384 jit_index_operation : public jit_operation |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
385 { |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
386 public: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
387 jit_index_operation (void) : module (0), engine (0) {} |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
388 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
389 void initialize (llvm::Module *amodule, llvm::ExecutionEngine *aengine) |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
390 { |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
391 module = amodule; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
392 engine = aengine; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
393 do_initialize (); |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
394 } |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
395 protected: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
396 virtual jit_function *generate (const signature_vec& types) const; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
397 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
398 virtual jit_function *generate_matrix (const signature_vec& types) const = 0; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
399 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
400 virtual void do_initialize (void) = 0; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
401 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
402 // helper functions |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
403 // [start_idx, end_idx). |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
404 llvm::Value *create_arg_array (llvm::IRBuilderD& builder, |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
405 const jit_function &fn, size_t start_idx, |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
406 size_t end_idx) const; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
407 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
408 llvm::Module *module; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
409 llvm::ExecutionEngine *engine; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
410 }; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
411 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
412 class |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
413 jit_paren_subsref : public jit_index_operation |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
414 { |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
415 protected: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
416 virtual jit_function *generate_matrix (const signature_vec& types) const; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
417 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
418 virtual void do_initialize (void); |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
419 private: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
420 jit_function paren_scalar; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
421 }; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
422 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
423 class |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
424 jit_paren_subsasgn : public jit_index_operation |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
425 { |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
426 protected: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
427 jit_function *generate_matrix (const signature_vec& types) const; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
428 |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
429 virtual void do_initialize (void); |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
430 private: |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
431 jit_function paren_scalar; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
432 }; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
433 |
15016 | 434 // A singleton class which handles the construction of jit_types and |
435 // jit_operations. | |
436 class | |
437 jit_typeinfo | |
438 { | |
439 public: | |
440 static void initialize (llvm::Module *m, llvm::ExecutionEngine *e); | |
441 | |
442 static jit_type *join (jit_type *lhs, jit_type *rhs) | |
443 { | |
444 return instance->do_join (lhs, rhs); | |
445 } | |
446 | |
447 static jit_type *get_any (void) { return instance->any; } | |
448 | |
449 static jit_type *get_matrix (void) { return instance->matrix; } | |
450 | |
451 static jit_type *get_scalar (void) { return instance->scalar; } | |
452 | |
453 static llvm::Type *get_scalar_llvm (void) | |
454 { return instance->scalar->to_llvm (); } | |
455 | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
456 static jit_type *get_scalar_ptr (void) { return instance->scalar_ptr; } |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
457 |
15337
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
458 static jit_type *get_any_ptr (void) { return instance->any_ptr; } |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
459 |
15016 | 460 static jit_type *get_range (void) { return instance->range; } |
461 | |
462 static jit_type *get_string (void) { return instance->string; } | |
463 | |
464 static jit_type *get_bool (void) { return instance->boolean; } | |
465 | |
466 static jit_type *get_index (void) { return instance->index; } | |
467 | |
468 static llvm::Type *get_index_llvm (void) | |
469 { return instance->index->to_llvm (); } | |
470 | |
471 static jit_type *get_complex (void) { return instance->complex; } | |
472 | |
473 // Get the jit_type of an octave_value | |
474 static jit_type *type_of (const octave_value& ov) | |
475 { | |
476 return instance->do_type_of (ov); | |
477 } | |
478 | |
479 static const jit_operation& binary_op (int op) | |
480 { | |
481 return instance->do_binary_op (op); | |
482 } | |
483 | |
15146
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
484 static const jit_operation& unary_op (int op) |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
485 { |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
486 return instance->do_unary_op (op); |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
487 } |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
488 |
15016 | 489 static const jit_operation& grab (void) { return instance->grab_fn; } |
490 | |
491 static const jit_function& get_grab (jit_type *type) | |
492 { | |
493 return instance->grab_fn.overload (type); | |
494 } | |
495 | |
496 static const jit_operation& release (void) | |
497 { | |
498 return instance->release_fn; | |
499 } | |
500 | |
501 static const jit_function& get_release (jit_type *type) | |
502 { | |
503 return instance->release_fn.overload (type); | |
504 } | |
505 | |
15337
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
506 static const jit_operation& destroy (void) |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
507 { |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
508 return instance->destroy_fn; |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
509 } |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
510 |
15016 | 511 static const jit_operation& print_value (void) |
512 { | |
513 return instance->print_fn; | |
514 } | |
515 | |
516 static const jit_operation& for_init (void) | |
517 { | |
518 return instance->for_init_fn; | |
519 } | |
520 | |
521 static const jit_operation& for_check (void) | |
522 { | |
523 return instance->for_check_fn; | |
524 } | |
525 | |
526 static const jit_operation& for_index (void) | |
527 { | |
528 return instance->for_index_fn; | |
529 } | |
530 | |
531 static const jit_operation& make_range (void) | |
532 { | |
533 return instance->make_range_fn; | |
534 } | |
535 | |
536 static const jit_operation& paren_subsref (void) | |
537 { | |
538 return instance->paren_subsref_fn; | |
539 } | |
540 | |
541 static const jit_operation& paren_subsasgn (void) | |
542 { | |
543 return instance->paren_subsasgn_fn; | |
544 } | |
545 | |
546 static const jit_operation& logically_true (void) | |
547 { | |
548 return instance->logically_true_fn; | |
549 } | |
550 | |
551 static const jit_operation& cast (jit_type *result) | |
552 { | |
553 return instance->do_cast (result); | |
554 } | |
555 | |
556 static const jit_function& cast (jit_type *to, jit_type *from) | |
557 { | |
558 return instance->do_cast (to, from); | |
559 } | |
560 | |
561 static llvm::Value *insert_error_check (llvm::IRBuilderD& bld) | |
562 { | |
563 return instance->do_insert_error_check (bld); | |
564 } | |
15056
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
565 |
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
566 static const jit_operation& end (void) |
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
567 { |
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
568 return instance->end_fn; |
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
569 } |
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
570 |
15102
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
571 static const jit_function& end (jit_value *value, jit_value *index, |
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
572 jit_value *count) |
15056
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
573 { |
15102
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
574 return instance->do_end (value, index, count); |
15056
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
575 } |
15337
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
576 |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
577 static const jit_operation& create_undef (void) |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
578 { |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
579 return instance->create_undef_fn; |
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
580 } |
15016 | 581 private: |
582 jit_typeinfo (llvm::Module *m, llvm::ExecutionEngine *e); | |
583 | |
584 // FIXME: Do these methods really need to be in jit_typeinfo? | |
585 jit_type *do_join (jit_type *lhs, jit_type *rhs) | |
586 { | |
587 // empty case | |
588 if (! lhs) | |
589 return rhs; | |
590 | |
591 if (! rhs) | |
592 return lhs; | |
593 | |
594 // check for a shared parent | |
595 while (lhs != rhs) | |
596 { | |
597 if (lhs->depth () > rhs->depth ()) | |
598 lhs = lhs->parent (); | |
599 else if (lhs->depth () < rhs->depth ()) | |
600 rhs = rhs->parent (); | |
601 else | |
602 { | |
603 // we MUST have depth > 0 as any is the base type of everything | |
604 do | |
605 { | |
606 lhs = lhs->parent (); | |
607 rhs = rhs->parent (); | |
608 } | |
609 while (lhs != rhs); | |
610 } | |
611 } | |
612 | |
613 return lhs; | |
614 } | |
615 | |
616 jit_type *do_difference (jit_type *lhs, jit_type *) | |
617 { | |
618 // FIXME: Maybe we can do something smarter? | |
619 return lhs; | |
620 } | |
621 | |
622 jit_type *do_type_of (const octave_value &ov) const; | |
623 | |
624 const jit_operation& do_binary_op (int op) const | |
625 { | |
626 assert (static_cast<size_t>(op) < binary_ops.size ()); | |
627 return binary_ops[op]; | |
628 } | |
629 | |
15146
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
630 const jit_operation& do_unary_op (int op) const |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
631 { |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
632 assert (static_cast<size_t> (op) < unary_ops.size ()); |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
633 return unary_ops[op]; |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
634 } |
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
635 |
15016 | 636 const jit_operation& do_cast (jit_type *to) |
637 { | |
638 static jit_operation null_function; | |
639 if (! to) | |
640 return null_function; | |
641 | |
642 size_t id = to->type_id (); | |
643 if (id >= casts.size ()) | |
644 return null_function; | |
645 return casts[id]; | |
646 } | |
647 | |
648 const jit_function& do_cast (jit_type *to, jit_type *from) | |
649 { | |
650 return do_cast (to).overload (from); | |
651 } | |
652 | |
15102
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
653 const jit_function& do_end (jit_value *value, jit_value *index, |
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
654 jit_value *count); |
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
655 |
15016 | 656 jit_type *new_type (const std::string& name, jit_type *parent, |
15124
0464e3ceb85b
Skip functions when resolving end context in JIT
Max Brister <max@2bass.com>
parents:
15102
diff
changeset
|
657 llvm::Type *llvm_type, bool skip_paren = false); |
15016 | 658 |
659 | |
15019
ae3670d4df29
Update the execution engine's global mapping for external functions
Max Brister <max@2bass.com>
parents:
15016
diff
changeset
|
660 void add_print (jit_type *ty, void *fptr); |
15016 | 661 |
662 void add_binary_op (jit_type *ty, int op, int llvm_op); | |
663 | |
664 void add_binary_icmp (jit_type *ty, int op, int llvm_op); | |
665 | |
666 void add_binary_fcmp (jit_type *ty, int op, int llvm_op); | |
667 | |
668 jit_function create_function (jit_convention::type cc, | |
669 const llvm::Twine& name, jit_type *ret, | |
670 const std::vector<jit_type *>& args | |
671 = std::vector<jit_type *> ()); | |
672 | |
673 #define JIT_PARAM_ARGS jit_convention::type cc, const llvm::Twine& name, \ | |
674 jit_type *ret, | |
675 #define JIT_PARAMS cc, name, ret, | |
676 #define CREATE_FUNCTION(N) JIT_EXPAND(jit_function, create_function, \ | |
677 jit_type *, /* empty */, N) | |
678 | |
679 CREATE_FUNCTION(1); | |
680 CREATE_FUNCTION(2); | |
681 CREATE_FUNCTION(3); | |
682 CREATE_FUNCTION(4); | |
683 | |
684 #undef JIT_PARAM_ARGS | |
685 #undef JIT_PARAMS | |
686 #undef CREATE_FUNCTION | |
687 | |
688 jit_function create_identity (jit_type *type); | |
689 | |
690 llvm::Value *do_insert_error_check (llvm::IRBuilderD& bld); | |
691 | |
692 void add_builtin (const std::string& name); | |
693 | |
694 void register_intrinsic (const std::string& name, size_t id, | |
695 jit_type *result, jit_type *arg0) | |
696 { | |
697 std::vector<jit_type *> args (1, arg0); | |
698 register_intrinsic (name, id, result, args); | |
699 } | |
700 | |
701 void register_intrinsic (const std::string& name, size_t id, jit_type *result, | |
702 const std::vector<jit_type *>& args); | |
703 | |
704 void register_generic (const std::string& name, jit_type *result, | |
705 jit_type *arg0) | |
706 { | |
707 std::vector<jit_type *> args (1, arg0); | |
708 register_generic (name, result, args); | |
709 } | |
710 | |
711 void register_generic (const std::string& name, jit_type *result, | |
712 const std::vector<jit_type *>& args); | |
713 | |
714 octave_builtin *find_builtin (const std::string& name); | |
715 | |
716 jit_function mirror_binary (const jit_function& fn); | |
717 | |
718 llvm::Function *wrap_complex (llvm::Function *wrap); | |
719 | |
720 static llvm::Value *pack_complex (llvm::IRBuilderD& bld, | |
721 llvm::Value *cplx); | |
722 | |
723 static llvm::Value *unpack_complex (llvm::IRBuilderD& bld, | |
724 llvm::Value *result); | |
725 | |
726 llvm::Value *complex_real (llvm::Value *cx); | |
727 | |
728 llvm::Value *complex_real (llvm::Value *cx, llvm::Value *real); | |
729 | |
730 llvm::Value *complex_imag (llvm::Value *cx); | |
731 | |
732 llvm::Value *complex_imag (llvm::Value *cx, llvm::Value *imag); | |
733 | |
734 llvm::Value *complex_new (llvm::Value *real, llvm::Value *imag); | |
735 | |
736 void create_int (size_t nbits); | |
737 | |
738 jit_type *intN (size_t nbits) const; | |
739 | |
740 static jit_typeinfo *instance; | |
741 | |
742 llvm::Module *module; | |
743 llvm::ExecutionEngine *engine; | |
744 int next_id; | |
745 | |
746 llvm::GlobalVariable *lerror_state; | |
747 | |
748 std::vector<jit_type*> id_to_type; | |
749 jit_type *any; | |
750 jit_type *matrix; | |
751 jit_type *scalar; | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
752 jit_type *scalar_ptr; // a fake type for interfacing with C++ |
15135
bd6bb87e2bea
Support sin, cos, and exp with matrix arguments in JIT
Max Brister <max@2bass.com>
parents:
15124
diff
changeset
|
753 jit_type *any_ptr; // a fake type for interfacing with C++ |
15016 | 754 jit_type *range; |
755 jit_type *string; | |
756 jit_type *boolean; | |
757 jit_type *index; | |
758 jit_type *complex; | |
759 jit_type *unknown_function; | |
760 std::map<size_t, jit_type *> ints; | |
761 std::map<std::string, jit_type *> builtins; | |
762 | |
763 llvm::StructType *complex_ret; | |
764 | |
765 std::vector<jit_operation> binary_ops; | |
15146
709e8928e68c
Scalar unary operation support in JIT
Max Brister <max@2bass.com>
parents:
15135
diff
changeset
|
766 std::vector<jit_operation> unary_ops; |
15016 | 767 jit_operation grab_fn; |
768 jit_operation release_fn; | |
15337
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
769 jit_operation destroy_fn; |
15016 | 770 jit_operation print_fn; |
771 jit_operation for_init_fn; | |
772 jit_operation for_check_fn; | |
773 jit_operation for_index_fn; | |
774 jit_operation logically_true_fn; | |
775 jit_operation make_range_fn; | |
15078
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
776 jit_paren_subsref paren_subsref_fn; |
fe4752f772e2
Generate ND indexing functions on demand in JIT.
Max Brister <max@2bass.com>
parents:
15068
diff
changeset
|
777 jit_paren_subsasgn paren_subsasgn_fn; |
15102
d29f2583cf7b
Support end in multi indexing in JIT
Max Brister <max@2bass.com>
parents:
15096
diff
changeset
|
778 jit_operation end1_fn; |
15056
bc32288f4a42
Support the end keyword for one dimentional indexing in JIT.
Max Brister <max@2bass.com>
parents:
15019
diff
changeset
|
779 jit_operation end_fn; |
15337
3f43e9d6d86e
JIT compile anonymous functions
Max Brister <max@2bass.com>
parents:
15334
diff
changeset
|
780 jit_operation create_undef_fn; |
15016 | 781 |
15135
bd6bb87e2bea
Support sin, cos, and exp with matrix arguments in JIT
Max Brister <max@2bass.com>
parents:
15124
diff
changeset
|
782 jit_function any_call; |
bd6bb87e2bea
Support sin, cos, and exp with matrix arguments in JIT
Max Brister <max@2bass.com>
parents:
15124
diff
changeset
|
783 |
15016 | 784 // type id -> cast function TO that type |
785 std::vector<jit_operation> casts; | |
786 | |
787 // type id -> identity function | |
788 std::vector<jit_function> identities; | |
789 | |
790 llvm::IRBuilderD& builder; | |
791 }; | |
792 | |
793 #endif | |
794 #endif |