Forked from D142901 to deduce more nsw/nuw flag for the output
shl.
We can handle the following cases + some nsw/nuw flags:
The rationale for doing this all in InstCombine rather than handling
the constant shl cases in InstSimplify is we often create a new
instruction because we are able to deduce more nsw/nuw flags than
the original instruction had.
It might be a bit easier to follow, if you explicitly do the scaling while doing the matching, i.e.