[ValueTracking] fix bug computing isKnownToBeAPowerOfTwo() with arithmetic shift...
[oota-llvm.git] / test / Analysis / ValueTracking / knownzero-shift.ll
1 ; RUN: opt -instsimplify -S < %s | FileCheck %s
2
3 ; CHECK-LABEL: @test
4 define i1 @test(i8 %p, i8* %pq) {
5   %q = load i8, i8* %pq, !range !0 ; %q is known nonzero; no known bits
6   %1 = or i8 %p, 2                 ; %1[1] = 1
7   %2 = and i8 %1, 254              ; %2[0] = 0, %2[1] = 1
8   %A = lshr i8 %2, 1               ; We should know that %A is nonzero.
9   %x = icmp eq i8 %A, 0
10   ; CHECK: ret i1 false
11   ret i1 %x
12 }
13
14 !0 = !{ i8 1, i8 5 }