Overview of the instruction selection frameworks
You can view an instruction selector as a funnel that takes the massive space of a program that can be represented in LLVM IR and narrows it down to an equivalent program that only uses the instructions available for your backend.
The LLVM infrastructure offers two (and a half!) different frameworks to help you solve the instruction selection (ISel) problem. The main two frameworks are, respectively, SelectionDAG (also known as SDISel), which is the legacy instruction selector, and GlobalISel (also known as GISel), which is the newer selector. There is also a sub-framework called FastISel, which is part of the SDISel framework. From this point forward, we will use SDISel, GlobalISel, and FastISel as nouns, since this is what is done in all LLVM documentation.
Therefore, right off the bat, you must choose which selector you want to use for your backend. The frameworks all share some common infrastructure, thanks to TableGen,...