Lines Matching refs:JIT
2 Kaleidoscope: Adding JIT and Optimizer Support
15 language, and adding JIT compiler support. These additions will
212 Adding a JIT Compiler
218 the code to an assembly file (.s) for some target, or you can JIT
222 In this section, we'll add JIT compiler support to our interpreter. The
229 In order to do this, we first declare and initialize the JIT. This is
247 The KaleidoscopeJIT class is a simple JIT built specifically for these
250 ``addModule`` adds an LLVM IR module to the JIT, making its functions
265 // JIT the module containing the anonymous expression, keeping a handle so
270 // Search the JIT for the __anon_expr symbol.
279 // Delete the anonymous expression module from the JIT.
284 the top-level expression to the JIT. We do this by calling addModule, which
286 handle that can be used to remove the module from the JIT later. Once the module
287 has been added to the JIT it can no longer be modified, so we also open a new
290 Once we've added the module to the JIT we need to get a pointer to the final
291 generated code. We do this by calling the JIT's findSymbol method, and passing
298 computed double. Because the LLVM JIT compiler matches the native platform ABI,
300 that type and call it directly. This means, there is no difference between JIT
305 remove the module from the JIT when we're done to free the associated memory.
355 the the API a Module is a unit of allocation for the JIT, and testfunc was part
357 module from the JIT to free the memory for the anonymous expression, we deleted
359 testfunc a second time, the JIT could no longer find it.
362 module from the rest of the function definitions. The JIT will happily resolve
364 has a prototype, and is added to the JIT before it is called. By putting the
371 JIT more than once (unlike a module where every function must have a unique
484 the JIT and open a new module. In HandleExtern, we just need to add one line to
546 Whoa, how does the JIT know about sin and cos? The answer is surprisingly
549 it searches all the modules that have already been added to the JIT, from the
551 found inside the JIT, it falls back to calling "``dlsym("sin")``" on the
552 Kaleidoscope process itself. Since "``sin``" is defined within the JIT's
558 symbols available to JIT'd code), to dynamic code generation based on symbol
579 This completes the JIT and optimizer chapter of the Kaleidoscope
581 programming language, optimize and JIT compile it in a user-driven way.
590 the LLVM JIT and optimizer. To build this example, use: