[InstCombine] Rewrite bswap/bitreverse handling completely.
There are several requirements that ended up with this design;
- Matching bitreversals is too heavyweight for InstCombine and doesn't really need to be done so early.
- Bitreversals and byteswaps are very related in their matching logic.
- We want to implement support for matching more advanced bswap/bitreverse patterns like partial bswaps/bitreverses.
- Bswaps are best matched early in InstCombine.
The result of these is that a new utility function is created in Transforms/Utils/Local.h that can be configured to search for bswaps, bitreverses or both. InstCombine uses it to find only bswaps, CGP uses it to find only bitreversals.
We can then extend the matching logic in one place only.