1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Revert "[InstCombine] add tests for umin/umax via usub.sat; NFC"

This reverts commit rL365999 / 0f6148df23edcd3081f5e761de19edd4f823f16d.
The tests already exist in this file, and the hoped-for transform
(mentioned in D62871) is invalid because of undef as discussed in
D63060.

llvm-svn: 366000
This commit is contained in:
Sanjay Patel 2019-07-13 13:16:46 +00:00
parent fe7c6172e8
commit 04a7ee7970

View File

@ -1614,75 +1614,3 @@ define i32 @unsigned_sat_constant_using_min_wrong_constant(i32 %x) {
%r = add i32 %s, -42
ret i32 %r
}
define i8 @umax(i8 %a, i8 %b) {
; CHECK-LABEL: @umax(
; CHECK-NEXT: [[USUB:%.*]] = tail call i8 @llvm.usub.sat.i8(i8 [[A:%.*]], i8 [[B:%.*]])
; CHECK-NEXT: [[R:%.*]] = add i8 [[USUB]], [[B]]
; CHECK-NEXT: ret i8 [[R]]
;
%usub = tail call i8 @llvm.usub.sat.i8(i8 %a, i8 %b)
%r = add i8 %usub, %b
ret i8 %r
}
define <2 x i8> @umax_vec(<2 x i8> %a, <2 x i8> %b) {
; CHECK-LABEL: @umax_vec(
; CHECK-NEXT: [[USUB:%.*]] = tail call <2 x i8> @llvm.usub.sat.v2i8(<2 x i8> [[A:%.*]], <2 x i8> [[B:%.*]])
; CHECK-NEXT: [[R:%.*]] = add <2 x i8> [[USUB]], [[B]]
; CHECK-NEXT: ret <2 x i8> [[R]]
;
%usub = tail call <2 x i8> @llvm.usub.sat.v2i8(<2 x i8> %a, <2 x i8> %b)
%r = add <2 x i8> %usub, %b
ret <2 x i8> %r
}
define i8 @umax_extra_use(i8 %a, i8 %b) {
; CHECK-LABEL: @umax_extra_use(
; CHECK-NEXT: [[USUB:%.*]] = tail call i8 @llvm.usub.sat.i8(i8 [[A:%.*]], i8 [[B:%.*]])
; CHECK-NEXT: call void @use(i8 [[USUB]])
; CHECK-NEXT: [[R:%.*]] = add i8 [[USUB]], [[B]]
; CHECK-NEXT: ret i8 [[R]]
;
%usub = tail call i8 @llvm.usub.sat.i8(i8 %a, i8 %b)
call void @use(i8 %usub)
%r = add i8 %usub, %b
ret i8 %r
}
define i8 @umin(i8 %a, i8 %b) {
; CHECK-LABEL: @umin(
; CHECK-NEXT: [[USUB:%.*]] = tail call i8 @llvm.usub.sat.i8(i8 [[A:%.*]], i8 [[B:%.*]])
; CHECK-NEXT: [[R:%.*]] = sub i8 [[A]], [[USUB]]
; CHECK-NEXT: ret i8 [[R]]
;
%usub = tail call i8 @llvm.usub.sat.i8(i8 %a, i8 %b)
%r = sub i8 %a, %usub
ret i8 %r
}
define <2 x i8> @umin_vec(<2 x i8> %a, <2 x i8> %b) {
; CHECK-LABEL: @umin_vec(
; CHECK-NEXT: [[USUB:%.*]] = tail call <2 x i8> @llvm.usub.sat.v2i8(<2 x i8> [[A:%.*]], <2 x i8> [[B:%.*]])
; CHECK-NEXT: [[R:%.*]] = sub <2 x i8> [[A]], [[USUB]]
; CHECK-NEXT: ret <2 x i8> [[R]]
;
%usub = tail call <2 x i8> @llvm.usub.sat.v2i8(<2 x i8> %a, <2 x i8> %b)
%r = sub <2 x i8> %a, %usub
ret <2 x i8> %r
}
define i8 @umin_extra_use(i8 %a, i8 %b) {
; CHECK-LABEL: @umin_extra_use(
; CHECK-NEXT: [[USUB:%.*]] = tail call i8 @llvm.usub.sat.i8(i8 [[A:%.*]], i8 [[B:%.*]])
; CHECK-NEXT: call void @use(i8 [[USUB]])
; CHECK-NEXT: [[R:%.*]] = sub i8 [[A]], [[USUB]]
; CHECK-NEXT: ret i8 [[R]]
;
%usub = tail call i8 @llvm.usub.sat.i8(i8 %a, i8 %b)
call void @use(i8 %usub)
%r = sub i8 %a, %usub
ret i8 %r
}
declare void @use(i8)