blob: 186c5a3136e657dfd1c013c068151a87d685e3e2 [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
; RUN: opt -S -passes=instcombine < %s | FileCheck %s
define i1 @test_ugt_small_c(i64 %x){
; CHECK-LABEL: @test_ugt_small_c(
; CHECK-NEXT: %r = icmp slt i64 %x, 0
; CHECK-NEXT: ret i1 %r
%m = call i64 @llvm.umax.i64(i64 %x, i64 1)
%notx = xor i64 %x, -1
%r = icmp ugt i64 %m, %notx
ret i1 %r
}
define i1 @test_ugt_large_c(i64 %x){
; CHECK-LABEL: @test_ugt_large_c(
; CHECK-NEXT: %r = icmp ugt i64 %x, 8446744073709551615
; CHECK-NEXT: ret i1 %r
%m = call i64 @llvm.umax.i64(i64 %x, i64 10000000000000000000)
%notx = xor i64 %x, -1
%r = icmp ugt i64 %m, %notx
ret i1 %r
}
define i1 @test_ult_small_c(i64 %x){
; CHECK-LABEL: @test_ult_small_c(
; CHECK-NEXT: %r = icmp sgt i64 %x, -1
; CHECK-NEXT: ret i1 %r
%m = call i64 @llvm.umax.i64(i64 %x, i64 1)
%notx = xor i64 %x, -1
%r = icmp ult i64 %m, %notx
ret i1 %r
}
define i1 @test_ult_large_c(i64 %x){
; CHECK-LABEL: @test_ult_large_c(
; CHECK-NEXT: %r = icmp ult i64 %x, 8446744073709551615
; CHECK-NEXT: ret i1 %r
%m = call i64 @llvm.umax.i64(i64 %x, i64 10000000000000000000)
%notx = xor i64 %x, -1
%r = icmp ult i64 %m, %notx
ret i1 %r
}