From: Sanjay Patel Date: Sat, 13 Jul 2019 13:16:46 +0000 (+0000) Subject: Revert "[InstCombine] add tests for umin/umax via usub.sat; NFC" X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22cc1030f6a9afd14cc48ec0b935ebe8678c0c2e;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/llvm/test/Transforms/InstCombine/saturating-add-sub.ll b/llvm/test/Transforms/InstCombine/saturating-add-sub.ll index 56e1062..364c80d 100644 --- a/llvm/test/Transforms/InstCombine/saturating-add-sub.ll +++ b/llvm/test/Transforms/InstCombine/saturating-add-sub.ll @@ -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)