This adresses various regression in D131260 , as well as is a useful optimization in itself.
Can you improve this comment? The codegen doesn't seem to pattern matching below.
auto *CN =
Update comment and use auto
Limit this to legal i32/i64 cases? Add test coverage for other types as well.
Not sure if we should use X86ISD::MUL_IMM here?
That make sense.
combineSelectOfTwoContants uses a mul, so I did the same.
Alive is happy with the correctness of the transform, should we land this or are there extra concerns to be addressed?