aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/canonicalize_branch.ll
blob: 1a9e966edb19ef9048bb9f06e5298f99eb751e90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
; RUN: opt %s -instcombine -S | \
; RUN:    not grep {icmp ne\|icmp ule\|icmp uge}

define i32 @test1(i32 %X, i32 %Y) {
        %C = icmp ne i32 %X, %Y         ; <i1> [#uses=1]
        br i1 %C, label %T, label %F

T:              ; preds = %0
        ret i32 12

F:              ; preds = %0
        ret i32 123
}

define i32 @test2(i32 %X, i32 %Y) {
        %C = icmp ule i32 %X, %Y                ; <i1> [#uses=1]
        br i1 %C, label %T, label %F

T:              ; preds = %0
        ret i32 12

F:              ; preds = %0
        ret i32 123
}

define i32 @test3(i32 %X, i32 %Y) {
        %C = icmp uge i32 %X, %Y                ; <i1> [#uses=1]
        br i1 %C, label %T, label %F

T:              ; preds = %0
        ret i32 12

F:              ; preds = %0
        ret i32 123
}