aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/canonicalize_branch.ll
blob: 79f02e73209ab213f1567e08bc77c08a91048738 (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: llvm-as < %s | opt -instcombine | llvm-dis | \
; 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
}