%r = shl nuw i8 C, %x
As per langref:
If the nuw keyword is present, then the shift produces a poison value if it shifts out any non-zero bits.
Thus, if the sign bit is set on C, then %x can only be 0, which means that %r can only be C.
Or in other words, set sign bit means that the signed value is negative, so the constant is <= 0.
https://rise4fun.com/Alive/WMk
https://rise4fun.com/Alive/udv
Was mentioned in D47428 review.
We already handle the 0 constant, https://godbolt.org/g/UZq1sJ, so this only handles negative constants.
FIXME: could also use KnownBits.