Register bank selection
The register bank selection phase, represented by the RegBankSelect
pass, is a mandatory pass in GlobalISel. This phase is responsible for assigning register banks to all the virtual registers of the current MachineFunction
instance. If you are not using GlobalISel, you can skip this section. However, you may still want to read through it to see what GlobalISel has to offer on something that SDISel cannot do.
The goal of the register bank selection
The concept of register bank selection came with GlobalISel and solved the problem of optimizing cross-register bank copies. A cross-register bank copy is an instruction that cannot be coalesced (removed) during register allocation because the source and destination of the copy live on different register files or banks. For instance, on an architecture with general purpose registers (GPRs) and vector registers (VRs), the GPRs may be used for integer operations and the VRs may be used for vector type operations...