Instruction Scheduling
Instruction scheduling is a low-level optimization that improves the sequence of instructions according to different strategies. For instance, it is possible to use this optimization to reduce the register pressure (how many registers you need to allocate) or increase the instruction-level parallelism (ILP) (the number of instructions that can be executed in parallel) of your program.
While this optimization is optional in your LLVM backend, we thought it was important to cover it for two main reasons:
- Instruction scheduling can unlock important performance improvements, especially if you are dealing with an in-order processor. In-order processors execute instructions in the order prescribed by the assembly code, whereas out-of-order processors can dynamically adapt the execution of the program while decoding the assembly code.
- Approaching the LLVM instruction scheduling infrastructure can be tricky without some guidance.
In this...