A key concept of LLVM is the low-level "intermediate" representation (IR) of your program. This IR is roughly at the level of assembler code, but it contains more information to facilitate optimization.
The power of LLVM is based on its ability to defer the compilation of this intermediate representation to a specific target machine until the moment the code is supposed to run. A just-in-time (JIT) compilation approach can be used by an application to create the code that it needs before it is needed.
In many cases, you have additional information during the operation of the program that you execute at the head office, so the program can be greatly optimized.
To get started, you can compile C ++ - a program for one intermediate representation, and then compile it on several platforms from this IR.
You can also try the Kaleidoscope demo, which will help you create a new language without having to write a compiler, just write IR.
In mission-critical applications, an application can essentially write its own code that needs to be run, just before it runs.
David dolson
source share