mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-01 08:23:21 +01:00
205b641954
input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. llvm-svn: 81537
86 lines
1.8 KiB
LLVM
86 lines
1.8 KiB
LLVM
; RUN: opt < %s -instcombine -S | grep {icmp s\[lg\]t i32 %n, 0} | count 16
|
|
|
|
; Instcombine should recognize that this code can be adjusted
|
|
; to fit the canonical smax/smin pattern.
|
|
|
|
define i32 @floor_a(i32 %n) {
|
|
%t = icmp sgt i32 %n, -1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_a(i32 %n) {
|
|
%t = icmp slt i32 %n, 1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_b(i32 %n) {
|
|
%t = icmp sgt i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_b(i32 %n) {
|
|
%t = icmp slt i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_c(i32 %n) {
|
|
%t = icmp sge i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_c(i32 %n) {
|
|
%t = icmp sle i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_d(i32 %n) {
|
|
%t = icmp sge i32 %n, 1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_d(i32 %n) {
|
|
%t = icmp sle i32 %n, -1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_e(i32 %n) {
|
|
%t = icmp sgt i32 %n, -1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_e(i32 %n) {
|
|
%t = icmp slt i32 %n, 1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_f(i32 %n) {
|
|
%t = icmp sgt i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_f(i32 %n) {
|
|
%t = icmp slt i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_g(i32 %n) {
|
|
%t = icmp sge i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_g(i32 %n) {
|
|
%t = icmp sle i32 %n, 0
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @floor_h(i32 %n) {
|
|
%t = icmp sge i32 %n, 1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|
|
define i32 @ceil_h(i32 %n) {
|
|
%t = icmp sle i32 %n, -1
|
|
%m = select i1 %t, i32 %n, i32 0
|
|
ret i32 %m
|
|
}
|