; CHECK-LABEL: @umin_assume_uge(
; CHECK-NEXT: [[C:%.*]] = icmp uge i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp uge i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umin_assume_ugt(
; CHECK-NEXT: [[C:%.*]] = icmp ugt i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp ugt i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umin_assume_ule(
; CHECK-NEXT: [[C:%.*]] = icmp ule i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp ule i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umin_assume_ult(
; CHECK-NEXT: [[C:%.*]] = icmp ult i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp ult i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umax_assume_uge(
; CHECK-NEXT: [[C:%.*]] = icmp uge i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp uge i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umax_assume_ugt(
; CHECK-NEXT: [[C:%.*]] = icmp ugt i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp ugt i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umax_assume_ule(
; CHECK-NEXT: [[C:%.*]] = icmp ule i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp ule i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @umax_assume_ult(
; CHECK-NEXT: [[C:%.*]] = icmp ult i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp ult i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smin_assume_sge(
; CHECK-NEXT: [[C:%.*]] = icmp sge i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp sge i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smin_assume_sgt(
; CHECK-NEXT: [[C:%.*]] = icmp sgt i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp sgt i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smin_assume_sle(
; CHECK-NEXT: [[C:%.*]] = icmp sle i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp sle i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smin_assume_slt(
; CHECK-NEXT: [[C:%.*]] = icmp slt i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp slt i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smax_assume_sge(
; CHECK-NEXT: [[C:%.*]] = icmp sge i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp sge i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smax_assume_sgt(
; CHECK-NEXT: [[C:%.*]] = icmp sgt i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[X]]
;
%c = icmp sgt i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smax_assume_sle(
; CHECK-NEXT: [[C:%.*]] = icmp sle i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp sle i8 %x, %y
call void @llvm.assume(i1 %c)
; CHECK-LABEL: @smax_assume_slt(
; CHECK-NEXT: [[C:%.*]] = icmp slt i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C]])
-; CHECK-NEXT: [[M:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[M]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%c = icmp slt i8 %x, %y
call void @llvm.assume(i1 %c)
define i8 @umax_add_nuw_1(i8 %x) {
; CHECK-LABEL: @umax_add_nuw_1(
; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[X:%.*]], 1
-; CHECK-NEXT: [[MAX:%.*]] = call i8 @llvm.umax.i8(i8 [[ADD]], i8 [[X]])
-; CHECK-NEXT: ret i8 [[MAX]]
+; CHECK-NEXT: ret i8 [[ADD]]
;
%add = add nuw i8 %x, 1
%max = call i8 @llvm.umax.i8(i8 %add, i8 %x)
define i8 @umax_add_nuw_2(i8 %x) {
; CHECK-LABEL: @umax_add_nuw_2(
; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[X:%.*]], 42
-; CHECK-NEXT: [[MAX:%.*]] = call i8 @llvm.umax.i8(i8 [[ADD]], i8 42)
-; CHECK-NEXT: ret i8 [[MAX]]
+; CHECK-NEXT: ret i8 [[ADD]]
;
%add = add nuw i8 %x, 42
%max = call i8 @llvm.umax.i8(i8 %add, i8 42)
define i8 @umax_range_metadata(i8* %p1, i8* %p2) {
; CHECK-LABEL: @umax_range_metadata(
-; CHECK-NEXT: [[X:%.*]] = load i8, i8* [[P1:%.*]], align 1, [[RNG0:!range !.*]]
-; CHECK-NEXT: [[Y:%.*]] = load i8, i8* [[P2:%.*]], align 1, [[RNG1:!range !.*]]
-; CHECK-NEXT: [[MAX:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 [[Y]])
-; CHECK-NEXT: ret i8 [[MAX]]
+; CHECK-NEXT: [[Y:%.*]] = load i8, i8* [[P2:%.*]], align 1, [[RNG0:!range !.*]]
+; CHECK-NEXT: ret i8 [[Y]]
;
%x = load i8, i8* %p1, !range !{i8 0, i8 10}
%y = load i8, i8* %p2, !range !{i8 20, i8 30}
define i8 @umax_zext_sext(i4 %x) {
; CHECK-LABEL: @umax_zext_sext(
-; CHECK-NEXT: [[ZEXT:%.*]] = zext i4 [[X:%.*]] to i8
-; CHECK-NEXT: [[SEXT:%.*]] = sext i4 [[X]] to i8
-; CHECK-NEXT: [[MAX:%.*]] = call i8 @llvm.umax.i8(i8 [[ZEXT]], i8 [[SEXT]])
-; CHECK-NEXT: ret i8 [[MAX]]
+; CHECK-NEXT: [[SEXT:%.*]] = sext i4 [[X:%.*]] to i8
+; CHECK-NEXT: ret i8 [[SEXT]]
;
%zext = zext i4 %x to i8
%sext = sext i4 %x to i8
define i8 @umax_lshr(i8 %x, i8 %y) {
; CHECK-LABEL: @umax_lshr(
-; CHECK-NEXT: [[SHR:%.*]] = lshr i8 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[MAX:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 [[SHR]])
-; CHECK-NEXT: ret i8 [[MAX]]
+; CHECK-NEXT: ret i8 [[X:%.*]]
;
%shr = lshr i8 %x, %y
%max = call i8 @llvm.umax.i8(i8 %x, i8 %shr)