• Home
  • Raw
  • Download

Lines Matching refs:JIT

2 Kaleidoscope: Adding JIT and Optimizer Support
15 language, and adding JIT compiler support. These additions will
213 Adding a JIT Compiler
219 the code to an assembly file (.s) for some target, or you can JIT
223 In this section, we'll add JIT compiler support to our interpreter. The
230 In order to do this, we first declare and initialize the JIT. This is
248 The KaleidoscopeJIT class is a simple JIT built specifically for these
251 ``addModule`` adds an LLVM IR module to the JIT, making its functions
266 // JIT the module containing the anonymous expression, keeping a handle so
271 // Search the JIT for the __anon_expr symbol.
280 // Delete the anonymous expression module from the JIT.
285 the top-level expression to the JIT. We do this by calling addModule, which
287 handle that can be used to remove the module from the JIT later. Once the module
288 has been added to the JIT it can no longer be modified, so we also open a new
291 Once we've added the module to the JIT we need to get a pointer to the final
292 generated code. We do this by calling the JIT's findSymbol method, and passing
299 computed double. Because the LLVM JIT compiler matches the native platform ABI,
301 that type and call it directly. This means, there is no difference between JIT
306 remove the module from the JIT when we're done to free the associated memory.
356 the the API a Module is a unit of allocation for the JIT, and testfunc was part
358 module from the JIT to free the memory for the anonymous expression, we deleted
360 testfunc a second time, the JIT could no longer find it.
363 module from the rest of the function definitions. The JIT will happily resolve
365 has a prototype, and is added to the JIT before it is called. By putting the
372 JIT more than once (unlike a module where every function must have a unique
485 the JIT and open a new module. In HandleExtern, we just need to add one line to
547 Whoa, how does the JIT know about sin and cos? The answer is surprisingly
550 it searches all the modules that have already been added to the JIT, from the
552 found inside the JIT, it falls back to calling "``dlsym("sin")``" on the
553 Kaleidoscope process itself. Since "``sin``" is defined within the JIT's
559 symbols available to JIT'd code), to dynamic code generation based on symbol
580 This completes the JIT and optimizer chapter of the Kaleidoscope
582 programming language, optimize and JIT compile it in a user-driven way.
591 the LLVM JIT and optimizer. To build this example, use: