For all shifts we can apply the same two optimizations.
- ShiftOp(KnownVal.One, Max(KnownCnt)) != 0 -> result is non-zero
- If already known Val != 0 and we only shift out zeros (based on Max(KnownCnt)) -> result is non-zero
The former exists for shl and the latter (for constant Cnt) exists
for ashr/lshr.
This patch improves the latter to use Max(KnownCnt) instead of
relying on a constant shift Cnt and applies both techniques for all
shift ops.
const APInt &