Legalization in SDISel
The legalization phase in SDISel adds another dimension: the concept of legal types. The core idea behind this is that you describe to the framework all the types that you natively support and SDISel will figure out how illegal types will be emulated on the legal ones.
Reminder
The concept of legalization does not exist in FastISel since you must handle the translation from the LLVM IR to the Machine IR in one go in this sub-framework. In other words, when selecting instruction through the FastISel sub-framework, you cannot leverage any of the legalization infrastructure that SDISel provides.
This concept of legal type has a side effect: as soon as you tell SDISel that a type is legal, all the operations on this type are assumed to be legal as well. For instance, imagine that your target can do 64-bit integer additions but not 64-bit integer multiplications. If you mark the 64-bit integer type legal, you must let SDISel know that all...