The selection for G_ICMP is unfortunately not currently importable from SDAG due to the use of custom SDNodes. To support this, this selection method has an opcode table which has been generated by a script, indexed by various instruction properties. Ideally in future we will have a GISel native selection patterns that we can write in tablegen to improve on this.
For selection of some types we also need support for G_ASHR and G_LSR which are generated as a result of legalization. This patch also adds support for them, generating the same code as SelectionDAG currently does.