1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
6 define i1 @test(i32 %In) {
8 ; CHECK-NEXT: [[C2:%.*]] = icmp eq i32 [[IN:%.*]], 1
9 ; CHECK-NEXT: ret i1 [[C2]]
11 %c1 = icmp sgt i32 %In, -1
12 %c2 = icmp eq i32 %In, 1
17 define i1 @test_logical(i32 %In) {
18 ; CHECK-LABEL: @test_logical(
19 ; CHECK-NEXT: [[C2:%.*]] = icmp eq i32 [[IN:%.*]], 1
20 ; CHECK-NEXT: ret i1 [[C2]]
22 %c1 = icmp sgt i32 %In, -1
23 %c2 = icmp eq i32 %In, 1
24 %V = select i1 %c1, i1 %c2, i1 false