We have a version of this transform in InstCombine, but surprisingly not in SDAG.
Even more surprisingly, this benefits RISCV, but no other target. This was surprising enough I double checked my build configuration to make sure all targets were enabled; they appear to be.
ISD::MUL has a fallthrough into this block. I don't think this is correct for it.