llvm-6502/test/Transforms/InstCombine/canonicalize_branch.ll
Chris Lattner 1dafbe1738 filecheckize this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-18 22:00:46 +00:00

45 lines
778 B
LLVM

; RUN: opt < %s -instcombine -S | FileCheck %s
define i32 @test1(i32 %X, i32 %Y) {
%C = icmp ne i32 %X, %Y
br i1 %C, label %T, label %F
; CHECK: @test1
; CHECK: %C = icmp eq i32 %X, %Y
; CHECK: br i1 %C, label %F, label %T
T:
ret i32 12
F:
ret i32 123
}
define i32 @test2(i32 %X, i32 %Y) {
%C = icmp ule i32 %X, %Y
br i1 %C, label %T, label %F
; CHECK: @test2
; CHECK: %C = icmp ugt i32 %X, %Y
; CHECK: br i1 %C, label %F, label %T
T:
ret i32 12
F:
ret i32 123
}
define i32 @test3(i32 %X, i32 %Y) {
%C = icmp uge i32 %X, %Y
br i1 %C, label %T, label %F
; CHECK: @test3
; CHECK: %C = icmp ult i32 %X, %Y
; CHECK: br i1 %C, label %F, label %T
T:
ret i32 12
F:
ret i32 123
}