[InstCombine] fold a shifted bool zext to a select

For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)

https://rise4fun.com/Alive/IZ9

Fixes PR42257.

Based on original patch by @zvi (Zvi Rackover)

Differential Revision: https://reviews.llvm.org/D63382

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374828 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed