Summary
In this chapter, you learned that the lowering of the stack layout consists of provisioning the stack space for your stack frame and replacing the frame indices with actual stack addresses.
You learned that the whole process is driven by the target-independent PEI
pass and that this pass relies on the target-specific versions of the TargetFrameLowering
and TargetRegisterInfo
classes to perform the lowering. More specifically, you learned which methods you need to provide for both of these classes and saw that the TargetFrameLowering
class is responsible for allocating the stack space by providing the code sequences that materialize the prologue and epilogue of your function, as well as that the TargetRegisterInfo
class is responsible for the expansion of the frame indices into stack addresses.
Finally, you were exposed to the concept of register scavenging and saw how you can use the related RegScavenger
class to obtain the registers that may be necessary to materialize...