SamplePGO - Add line offset and discriminator information to sample reports.
[oota-llvm.git] / test / Analysis / ValueTracking / known-bits-from-range-md.ll
1 ; RUN: opt -S -instsimplify < %s | FileCheck %s
2
3 define i1 @test0(i8* %ptr) {
4 ; CHECK-LABEL: @test0(
5  entry:
6   %val = load i8, i8* %ptr, !range !{i8 -50, i8 0}
7   %and = and i8 %val, 128
8   %is.eq = icmp eq i8 %and, 128
9   ret i1 %is.eq
10 ; CHECK: ret i1 true
11 }
12
13 define i1 @test1(i8* %ptr) {
14 ; CHECK-LABEL: @test1(
15  entry:
16   %val = load i8, i8* %ptr, !range !{i8 64, i8 128}
17   %and = and i8 %val, 64
18   %is.eq = icmp eq i8 %and, 64
19   ret i1 %is.eq
20 ; CHECK: ret i1 true
21 }
22
23 define i1 @test2(i8* %ptr) {
24 ; CHECK-LABEL: @test2(
25  entry:
26 ; CHECK: load
27 ; CHECK: and
28 ; CHECK: icmp eq
29 ; CHECK: ret
30   %val = load i8, i8* %ptr, !range !{i8 64, i8 129}
31   %and = and i8 %val, 64
32   %is.eq = icmp eq i8 %and, 64
33   ret i1 %is.eq
34 }