xref: /llvm-project/llvm/test/Transforms/InstCombine/2007-05-10-icmp-or.ll (revision acdc419c897f8a9414c7a00c8908ac32312afee2)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt < %s -passes=instcombine -S | FileCheck %s
3
4define i1 @test(i32 %tmp9) {
5; CHECK-LABEL: @test(
6; CHECK-NEXT:    [[TMP20:%.*]] = icmp ugt i32 [[TMP9:%.*]], 255
7; CHECK-NEXT:    ret i1 [[TMP20]]
8;
9  %tmp20 = icmp ugt i32 %tmp9, 255                ; <i1> [#uses=1]
10  %tmp11.not = icmp sgt i32 %tmp9, 255            ; <i1> [#uses=1]
11  %bothcond = or i1 %tmp20, %tmp11.not            ; <i1> [#uses=1]
12  ret i1 %bothcond
13}
14
15define i1 @test_logical(i32 %tmp9) {
16; CHECK-LABEL: @test_logical(
17; CHECK-NEXT:    [[TMP20:%.*]] = icmp ugt i32 [[TMP9:%.*]], 255
18; CHECK-NEXT:    ret i1 [[TMP20]]
19;
20  %tmp20 = icmp ugt i32 %tmp9, 255                ; <i1> [#uses=1]
21  %tmp11.not = icmp sgt i32 %tmp9, 255            ; <i1> [#uses=1]
22  %bothcond = select i1 %tmp20, i1 true, i1 %tmp11.not            ; <i1> [#uses=1]
23  ret i1 %bothcond
24}
25
26