Chapter 5. Advanced IR Block Transformations
In the previous chapter, we have gone through some of the optimizations, which were mainly at instruction level. In this chapter, we will look at optimizations on block level where we will be optimizing a block of code to a simpler form, which makes the code more effective. We will start by looking at how loops are represented in LLVM, use the concept of dominance and CFG to optimize loops. We will use
Loop Simplification (LoopSimplify
)and
Loop Invariant Code Motion optimizations for loop processing. We will then see how a scalar value changes during program execution and how the result of this Scalar Evolution Optimization can be used in other optimizations. Then we will look into how LLVM represents its in build functions called as LLVM intrinsics. Finally, we will look into how LLVM deals with concepts of parallelism by understanding its approach towards vectorization.
In this chapter, we will look into the following topics:
- Loop...