blob: 2c4c1ef15af644c9f33873d6a27e74b57dae7f58 [file] [log] [blame]
Sanjay Patele104a5f2016-09-16 17:54:52 +00001; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
James Molloyb6be1eb2015-09-24 16:06:32 +00002; RUN: opt -instsimplify -S < %s | FileCheck %s
3
James Molloyb6be1eb2015-09-24 16:06:32 +00004define i1 @test(i8 %p, i8* %pq) {
Sanjay Patele104a5f2016-09-16 17:54:52 +00005; CHECK-LABEL: @test(
6; CHECK-NEXT: ret i1 false
7;
James Molloyb6be1eb2015-09-24 16:06:32 +00008 %q = load i8, i8* %pq, !range !0 ; %q is known nonzero; no known bits
9 %1 = or i8 %p, 2 ; %1[1] = 1
10 %2 = and i8 %1, 254 ; %2[0] = 0, %2[1] = 1
11 %A = lshr i8 %2, 1 ; We should know that %A is nonzero.
12 %x = icmp eq i8 %A, 0
James Molloyb6be1eb2015-09-24 16:06:32 +000013 ret i1 %x
14}
15
16!0 = !{ i8 1, i8 5 }