Quiz time
Now that you have completed reading this chapter, try answering the following questions to test your knowledge:
- What are the three main stages that the Machine IR goes through during the lowering process?
The Machine IR starts in SSA form with virtual registers, then goes in non-SSA form still with virtual registers, and finally uses only physical registers.
See the The Machine pass pipeline at a glance section for more details.
- Should you override the
TargetPassConfig::addMachinePasses
method and why?
Our recommendation is to not override this particular method because it creates the backbone of a typical LLVM backend that uses the LLVM target-independent code generator. If you want to use this code generator, you don’t want to waste time rediscovering how to build a proper pipeline.
See the Injecting passes section for more details, in particular regarding how to tweak this default pipeline.
- How can you...