1 ; RUN: opt -S -passes=instsimplify,instcombine < %s | FileCheck %s
3 define i1 @test0(ptr %ptr) {
6 %val = load i8, ptr %ptr, !range !{i8 -50, i8 0}
7 %and = and i8 %val, 128
8 %is.eq = icmp eq i8 %and, 128
13 define i1 @test1(ptr %ptr) {
14 ; CHECK-LABEL: @test1(
16 %val = load i8, ptr %ptr, !range !{i8 64, i8 128}
17 %and = and i8 %val, 64
18 %is.eq = icmp eq i8 %and, 64
23 define i1 @test2(ptr %ptr) {
24 ; CHECK-LABEL: @test2(
26 ; CHECK: %val = load i8
27 ; CHECK: %and = and i8 %val
28 ; CHECK: %is.eq = icmp ne i8 %and, 0
29 ; CHECK: ret i1 %is.eq
30 %val = load i8, ptr %ptr, !range !{i8 64, i8 129}
31 %and = and i8 %val, 64
32 %is.eq = icmp eq i8 %and, 64