An arithmetic shift can be safely changed to a logical shift if the first operand is known positive. This allows ComputeKnownBits (and similar analysis) to determine the sign bit of the shifted value. In turn this allows InstCombine to canonicalize a signed comparison (a > 0) into an equality check (a != 0).
This fixes PR30577 and is the same approach taken in r263406.
Chad