That check claims that the transform is illegal otherwise.
That isn't true:
- For ISD::ADD, we only process ISD::SHL outer shift => sign bit does not matter https://rise4fun.com/Alive/K4A
- For ISD::AND, there is no restriction on constants: https://rise4fun.com/Alive/Wy3
- For ISD::OR, there is no restriction on constants: https://rise4fun.com/Alive/GOH
- For ISD::XOR, there is no restriction on constants: https://rise4fun.com/Alive/ml6
So, why is it there then?
This changes the testcase that was touched by @spatel in rL347478,
but i'm not sure that test tests anything particular?