; CHECK-LABEL: @sge_or_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sge i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sge i8 %notx, %y
; CHECK-LABEL: @sge_or_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sge i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sge i8 %notx, %y
; CHECK-LABEL: @sge_swap_or_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sle i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sle i8 %y, %notx
; CHECK-LABEL: @sge_swap_or_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sle i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sle i8 %y, %notx
; CHECK-LABEL: @uge_or_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp uge i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp uge i8 %notx, %y
; CHECK-LABEL: @uge_or_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp uge i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp uge i8 %notx, %y
; CHECK-LABEL: @uge_swap_or_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ule i8 %y, %notx
; CHECK-LABEL: @uge_swap_or_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ule i8 %y, %notx
; CHECK-LABEL: @sle_or_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sle i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sle i8 %notx, %y
; CHECK-LABEL: @sle_or_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sle i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sle i8 %notx, %y
; CHECK-LABEL: @sle_swap_or_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sge i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sge i8 %y, %notx
; CHECK-LABEL: @sle_swap_or_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sge i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sge i8 %y, %notx
; CHECK-LABEL: @ule_or_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ule i8 %notx, %y
; CHECK-LABEL: @ule_or_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ule i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ule i8 %notx, %y
; CHECK-LABEL: @ule_swap_or_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp uge i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp uge i8 %y, %notx
; CHECK-LABEL: @ule_swap_or_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp uge i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp eq i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = or i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp uge i8 %y, %notx
; CHECK-LABEL: @slt_and_not_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp slt i8 %notx, %y
; CHECK-LABEL: @slt_and_not_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp slt i8 %notx, %y
; CHECK-LABEL: @slt_swap_and_not_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sgt i8 %y, %notx
; CHECK-LABEL: @slt_swap_and_not_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -128
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sgt i8 %y, %notx
; CHECK-LABEL: @ult_and_not_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ult i8 %notx, %y
; CHECK-LABEL: @ult_and_not_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ult i8 %notx, %y
; CHECK-LABEL: @ult_swap_and_not_max_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ugt i8 %y, %notx
; CHECK-LABEL: @ult_swap_and_not_max_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 0
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ugt i8 %y, %notx
; CHECK-LABEL: @sgt_and_not_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sgt i8 %notx, %y
; CHECK-LABEL: @sgt_and_not_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp sgt i8 %notx, %y
; CHECK-LABEL: @sgt_swap_and_not_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp slt i8 %y, %notx
; CHECK-LABEL: @sgt_swap_and_not_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], 127
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp slt i8 %y, %notx
; CHECK-LABEL: @ugt_and_not_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ugt i8 %notx, %y
; CHECK-LABEL: @ugt_and_not_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8 [[NOTX]], [[Y:%.*]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ugt i8 %notx, %y
; CHECK-LABEL: @ugt_swap_and_not_min_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMP]], [[CMPEQ]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ult i8 %y, %notx
; CHECK-LABEL: @ugt_swap_and_not_min_commute_not_op(
; CHECK-NEXT: [[NOTX:%.*]] = xor i8 [[X:%.*]], -1
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[Y:%.*]], [[NOTX]]
-; CHECK-NEXT: [[CMPEQ:%.*]] = icmp ne i8 [[X]], -1
-; CHECK-NEXT: [[R:%.*]] = and i1 [[CMPEQ]], [[CMP]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: ret i1 [[CMP]]
;
%notx = xor i8 %x, -1
%cmp = icmp ult i8 %y, %notx