On some targets, such as AArch64, it's possible to optimize G_ICMP + G_SELECT pairs more effectively than G_ICMP + G_SEXT pairs.
Example: https://godbolt.org/z/5nd3Gf
This is a combine that already exists in the DAGCombiner (see DAGCombiner::visitSIGN_EXTEND).
Like the DAGCombiner, this uses a target hook (convertSelectOfConstantsToMath) to allow targets to choose whether they want this, or combines that change selects into extends.
For AArch64, this is a minor code size win on CTMark at -Os.
Vectors should be easy to handle?