Overview of the IR building
The IR building phase of the selectors is conceptually simple except that it is also responsible for materializing the ABI of the input LLVM IR function. In other words, the pure IR building part of this phase is straightforward: one LLVM IR instruction maps to one or several SDNode instances for the SelectionDAG Instruction Selection (SDISel) framework or MachineInstr instances with generic opcodes for the Global Instruction Selection (GlobalISel) framework.
Note
We will use SDISel and GlobalISel as nouns in the rest of this chapter as well as FastISel for the SDISel sub-selector (see Chapter 14 for more details on how they relate to each other.)
For instance, the add instruction in LLVM IR translates into the ISD::ADD SDNode instance and G_ADD MachineInstr instance. Also, in SDISel, the IR building phase, implemented with the SelectionDAGBuilder class, translates pointer types into integer types of the right size.
The pure...