Forked from D142901 to handle the mul/shl when Y and Z are
non-constant.
(srem (mul/shl X, Y), (mul/shl X, Z))
[If `Y`/`Z` are one use] -> `(mul/shl nuw nsw X, (srem Y, Z))` - https://alive2.llvm.org/ce/z/ccTFj2 - https://alive2.llvm.org/ce/z/i_UQ5A -> `(mul/shl nsw X, (srem Y, Z))` - https://alive2.llvm.org/ce/z/mQKc63 - https://alive2.llvm.org/ce/z/uERkKH
(urem (mul/shl X, Y), (mul/shl X, Z))
[If `Y`/`Z` are one use] -> `(mul/shl nuw nsw X, (srem Y, Z))` - https://alive2.llvm.org/ce/z/mNnQqJ - https://alive2.llvm.org/ce/z/Bj_DR- - https://alive2.llvm.org/ce/z/X6ZEtQ -> `(mul/shl nuw X, (srem Y, Z))` - https://alive2.llvm.org/ce/z/SJYtUV