Optimizations
In GlobalISel and SDISel, it is possible to inject your own optimizations within the instruction selection pipeline. In this section, you will learn how to use these infrastructures to insert your own optimizations.
Let us start with SDISel.
Using the DAGCombiner framework
Since SDISel is a single MachineFunctionPass
instance, the optimization opportunities are limited to what SDISel exposes as hooks.
Essentially, the only thing that you can do in SDISel is some pattern rewriting using the DAGCombiner infrastructure. The DAGCombiner
infrastructure allows you to run custom pattern rewrites at four predetermined points of the SDISel pipeline, identified by the following CombineLevel
enumeration values:
BeforeLegalizeTypes
: Before legalizationAfterLegalizeTypes
: After the legalization of scalar types but before the legalization of vector typesAfterLegalizeVectorOps
: After the legalization of vector types but before the legalization...