efriedma added a comment. The transform is wrong whether or not the shift type is legal: ISD::SHL returns poison for out-of-range shifts, just like the IR "shl", and DAGCombine will take advantage of this. Repository: rL LLVM https://reviews.llvm.org/D50018