Noah Goldstein 112e49b381 [DAGCombiner] Transform (icmp eq/ne (and X,C0),(shift X,C1)) to use rotate or to getter constants.
If `C0` is a mask and `C1` shifts out all the masked bits (to
essentially compare two subsets of `X`), we can arbitrarily re-order
shift as `srl` or `shl`.

If `C1` (shift amount) is a power of 2, we can replace the and+shift
with a rotate.

Otherwise, based on target preference we can arbitrarily swap `shl`
and `shl` in/out to get better constants.

On x86 we can use this re-ordering to:
    1) get better `and` constants for `C0` (zero extended moves or
       avoid imm64).
    2) covert `srl` to `shl` if `shl` will be implementable with `lea`
       or `add` (both of which can be preferable).

Proofs: https://alive2.llvm.org/ce/z/qzGM_w

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D152116
2023-10-18 01:16:55 -05:00
..
2023-06-18 16:02:59 +01:00
2023-03-05 00:48:53 -08:00
2022-12-17 16:15:22 +05:30
2023-08-21 08:49:01 +08:00
2023-09-01 19:45:03 -04:00
2023-09-20 16:58:00 +01:00
2022-12-17 16:15:22 +05:30
2023-07-20 10:24:16 +08:00
2023-07-20 13:35:15 +08:00
2023-05-14 21:51:44 +08:00