Move the code which adjusts the immediate/predicate on a G_ICMP to AArch64PostLegalizerLowering.
This
- Reduces the number of places we need to test for optimized compares in the selector. We know that the compare should have been simplified by the time it hits the selector, so we can avoid testing this in selects, brconds, etc.
- Allows us to potentially fold more compares (previously, this optimization was only done after calling tryFoldCompare, this may allow us to hit some more TST cases)
- Simplifies the selection code in emitIntegerCompare significantly; we can just use an emitSUBS function.
- Allows us to avoid checking that the predicate has been updated after emitIntegerCompare.
Also add a utility header file for things that may be useful in the selector and various combiners. No need for an implementation file at this point, since it's just one constexpr function for now. I've run into a couple cases where having one of these would be handy, so might as well add it here. There are a couple functions in the selector that can probably be factored out into here.
debug left