llvm/llvm/test/Transforms/InstCombine/icmp-shr-lt-gt.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s

define i1 @lshrugt_01_00(i4 %x) {
; CHECK-LABEL: @lshrugt_01_00(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 0
  ret i1 %c
}

define i1 @lshrugt_01_01(i4 %x) {
; CHECK-LABEL: @lshrugt_01_01(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 1
  ret i1 %c
}

define i1 @lshrugt_01_02(i4 %x) {
; CHECK-LABEL: @lshrugt_01_02(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 2
  ret i1 %c
}

define i1 @lshrugt_01_03(i4 %x) {
; CHECK-LABEL: @lshrugt_01_03(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 3
  ret i1 %c
}

define i1 @lshrugt_01_04(i4 %x) {
; CHECK-LABEL: @lshrugt_01_04(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], -7
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 4
  ret i1 %c
}

define i1 @lshrugt_01_05(i4 %x) {
; CHECK-LABEL: @lshrugt_01_05(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], -5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 5
  ret i1 %c
}

define i1 @lshrugt_01_06(i4 %x) {
; CHECK-LABEL: @lshrugt_01_06(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], -3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 6
  ret i1 %c
}

define i1 @lshrugt_01_07(i4 %x) {
; CHECK-LABEL: @lshrugt_01_07(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 7
  ret i1 %c
}

define i1 @lshrugt_01_08(i4 %x) {
; CHECK-LABEL: @lshrugt_01_08(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 8
  ret i1 %c
}

define i1 @lshrugt_01_09(i4 %x) {
; CHECK-LABEL: @lshrugt_01_09(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 9
  ret i1 %c
}

define i1 @lshrugt_01_10(i4 %x) {
; CHECK-LABEL: @lshrugt_01_10(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 10
  ret i1 %c
}

define i1 @lshrugt_01_11(i4 %x) {
; CHECK-LABEL: @lshrugt_01_11(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 11
  ret i1 %c
}

define i1 @lshrugt_01_12(i4 %x) {
; CHECK-LABEL: @lshrugt_01_12(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 12
  ret i1 %c
}

define i1 @lshrugt_01_13(i4 %x) {
; CHECK-LABEL: @lshrugt_01_13(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 13
  ret i1 %c
}

define i1 @lshrugt_01_14(i4 %x) {
; CHECK-LABEL: @lshrugt_01_14(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 14
  ret i1 %c
}

define i1 @lshrugt_01_15(i4 %x) {
; CHECK-LABEL: @lshrugt_01_15(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ugt i4 %s, 15
  ret i1 %c
}

define i1 @lshrugt_02_00(i4 %x) {
; CHECK-LABEL: @lshrugt_02_00(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 0
  ret i1 %c
}

define i1 @lshrugt_02_01(i4 %x) {
; CHECK-LABEL: @lshrugt_02_01(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 1
  ret i1 %c
}

define i1 @lshrugt_02_02(i4 %x) {
; CHECK-LABEL: @lshrugt_02_02(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], -5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 2
  ret i1 %c
}

define i1 @lshrugt_02_03(i4 %x) {
; CHECK-LABEL: @lshrugt_02_03(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 3
  ret i1 %c
}

define i1 @lshrugt_02_04(i4 %x) {
; CHECK-LABEL: @lshrugt_02_04(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 4
  ret i1 %c
}

define i1 @lshrugt_02_05(i4 %x) {
; CHECK-LABEL: @lshrugt_02_05(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 5
  ret i1 %c
}

define i1 @lshrugt_02_06(i4 %x) {
; CHECK-LABEL: @lshrugt_02_06(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 6
  ret i1 %c
}

define i1 @lshrugt_02_07(i4 %x) {
; CHECK-LABEL: @lshrugt_02_07(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 7
  ret i1 %c
}

define i1 @lshrugt_02_08(i4 %x) {
; CHECK-LABEL: @lshrugt_02_08(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 8
  ret i1 %c
}

define i1 @lshrugt_02_09(i4 %x) {
; CHECK-LABEL: @lshrugt_02_09(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 9
  ret i1 %c
}

define i1 @lshrugt_02_10(i4 %x) {
; CHECK-LABEL: @lshrugt_02_10(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 10
  ret i1 %c
}

define i1 @lshrugt_02_11(i4 %x) {
; CHECK-LABEL: @lshrugt_02_11(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 11
  ret i1 %c
}

define i1 @lshrugt_02_12(i4 %x) {
; CHECK-LABEL: @lshrugt_02_12(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 12
  ret i1 %c
}

define i1 @lshrugt_02_13(i4 %x) {
; CHECK-LABEL: @lshrugt_02_13(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 13
  ret i1 %c
}

define i1 @lshrugt_02_14(i4 %x) {
; CHECK-LABEL: @lshrugt_02_14(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 14
  ret i1 %c
}

define i1 @lshrugt_02_15(i4 %x) {
; CHECK-LABEL: @lshrugt_02_15(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ugt i4 %s, 15
  ret i1 %c
}

define i1 @lshrugt_03_00(i4 %x) {
; CHECK-LABEL: @lshrugt_03_00(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 0
  ret i1 %c
}

define i1 @lshrugt_03_01(i4 %x) {
; CHECK-LABEL: @lshrugt_03_01(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 1
  ret i1 %c
}

define i1 @lshrugt_03_02(i4 %x) {
; CHECK-LABEL: @lshrugt_03_02(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 2
  ret i1 %c
}

define i1 @lshrugt_03_03(i4 %x) {
; CHECK-LABEL: @lshrugt_03_03(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 3
  ret i1 %c
}

define i1 @lshrugt_03_04(i4 %x) {
; CHECK-LABEL: @lshrugt_03_04(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 4
  ret i1 %c
}

define i1 @lshrugt_03_05(i4 %x) {
; CHECK-LABEL: @lshrugt_03_05(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 5
  ret i1 %c
}

define i1 @lshrugt_03_06(i4 %x) {
; CHECK-LABEL: @lshrugt_03_06(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 6
  ret i1 %c
}

define i1 @lshrugt_03_07(i4 %x) {
; CHECK-LABEL: @lshrugt_03_07(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 7
  ret i1 %c
}

define i1 @lshrugt_03_08(i4 %x) {
; CHECK-LABEL: @lshrugt_03_08(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 8
  ret i1 %c
}

define i1 @lshrugt_03_09(i4 %x) {
; CHECK-LABEL: @lshrugt_03_09(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 9
  ret i1 %c
}

define i1 @lshrugt_03_10(i4 %x) {
; CHECK-LABEL: @lshrugt_03_10(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 10
  ret i1 %c
}

define i1 @lshrugt_03_11(i4 %x) {
; CHECK-LABEL: @lshrugt_03_11(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 11
  ret i1 %c
}

define i1 @lshrugt_03_12(i4 %x) {
; CHECK-LABEL: @lshrugt_03_12(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 12
  ret i1 %c
}

define i1 @lshrugt_03_13(i4 %x) {
; CHECK-LABEL: @lshrugt_03_13(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 13
  ret i1 %c
}

define i1 @lshrugt_03_14(i4 %x) {
; CHECK-LABEL: @lshrugt_03_14(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 14
  ret i1 %c
}

define i1 @lshrugt_03_15(i4 %x) {
; CHECK-LABEL: @lshrugt_03_15(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ugt i4 %s, 15
  ret i1 %c
}

define i1 @lshrult_01_00(i4 %x) {
; CHECK-LABEL: @lshrult_01_00(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 0
  ret i1 %c
}

define i1 @lshrult_01_01(i4 %x) {
; CHECK-LABEL: @lshrult_01_01(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], 2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 1
  ret i1 %c
}

define i1 @lshrult_01_02(i4 %x) {
; CHECK-LABEL: @lshrult_01_02(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 2
  ret i1 %c
}

define i1 @lshrult_01_03(i4 %x) {
; CHECK-LABEL: @lshrult_01_03(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], 6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 3
  ret i1 %c
}

define i1 @lshrult_01_04(i4 %x) {
; CHECK-LABEL: @lshrult_01_04(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 4
  ret i1 %c
}

define i1 @lshrult_01_05(i4 %x) {
; CHECK-LABEL: @lshrult_01_05(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], -6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 5
  ret i1 %c
}

define i1 @lshrult_01_06(i4 %x) {
; CHECK-LABEL: @lshrult_01_06(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 6
  ret i1 %c
}

define i1 @lshrult_01_07(i4 %x) {
; CHECK-LABEL: @lshrult_01_07(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], -2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 7
  ret i1 %c
}

define i1 @lshrult_01_08(i4 %x) {
; CHECK-LABEL: @lshrult_01_08(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 8
  ret i1 %c
}

define i1 @lshrult_01_09(i4 %x) {
; CHECK-LABEL: @lshrult_01_09(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 9
  ret i1 %c
}

define i1 @lshrult_01_10(i4 %x) {
; CHECK-LABEL: @lshrult_01_10(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 10
  ret i1 %c
}

define i1 @lshrult_01_11(i4 %x) {
; CHECK-LABEL: @lshrult_01_11(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 11
  ret i1 %c
}

define i1 @lshrult_01_12(i4 %x) {
; CHECK-LABEL: @lshrult_01_12(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 12
  ret i1 %c
}

define i1 @lshrult_01_13(i4 %x) {
; CHECK-LABEL: @lshrult_01_13(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 13
  ret i1 %c
}

define i1 @lshrult_01_14(i4 %x) {
; CHECK-LABEL: @lshrult_01_14(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 14
  ret i1 %c
}

define i1 @lshrult_01_15(i4 %x) {
; CHECK-LABEL: @lshrult_01_15(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 1
  %c = icmp ult i4 %s, 15
  ret i1 %c
}

define i1 @lshrult_02_00(i4 %x) {
; CHECK-LABEL: @lshrult_02_00(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 0
  ret i1 %c
}

define i1 @lshrult_02_01(i4 %x) {
; CHECK-LABEL: @lshrult_02_01(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 1
  ret i1 %c
}

define i1 @lshrult_02_02(i4 %x) {
; CHECK-LABEL: @lshrult_02_02(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 2
  ret i1 %c
}

define i1 @lshrult_02_03(i4 %x) {
; CHECK-LABEL: @lshrult_02_03(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 3
  ret i1 %c
}

define i1 @lshrult_02_04(i4 %x) {
; CHECK-LABEL: @lshrult_02_04(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 4
  ret i1 %c
}

define i1 @lshrult_02_05(i4 %x) {
; CHECK-LABEL: @lshrult_02_05(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 5
  ret i1 %c
}

define i1 @lshrult_02_06(i4 %x) {
; CHECK-LABEL: @lshrult_02_06(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 6
  ret i1 %c
}

define i1 @lshrult_02_07(i4 %x) {
; CHECK-LABEL: @lshrult_02_07(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 7
  ret i1 %c
}

define i1 @lshrult_02_08(i4 %x) {
; CHECK-LABEL: @lshrult_02_08(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 8
  ret i1 %c
}

define i1 @lshrult_02_09(i4 %x) {
; CHECK-LABEL: @lshrult_02_09(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 9
  ret i1 %c
}

define i1 @lshrult_02_10(i4 %x) {
; CHECK-LABEL: @lshrult_02_10(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 10
  ret i1 %c
}

define i1 @lshrult_02_11(i4 %x) {
; CHECK-LABEL: @lshrult_02_11(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 11
  ret i1 %c
}

define i1 @lshrult_02_12(i4 %x) {
; CHECK-LABEL: @lshrult_02_12(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 12
  ret i1 %c
}

define i1 @lshrult_02_13(i4 %x) {
; CHECK-LABEL: @lshrult_02_13(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 13
  ret i1 %c
}

define i1 @lshrult_02_14(i4 %x) {
; CHECK-LABEL: @lshrult_02_14(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 14
  ret i1 %c
}

define i1 @lshrult_02_15(i4 %x) {
; CHECK-LABEL: @lshrult_02_15(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 2
  %c = icmp ult i4 %s, 15
  ret i1 %c
}

define i1 @lshrult_03_00(i4 %x) {
; CHECK-LABEL: @lshrult_03_00(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 0
  ret i1 %c
}

define i1 @lshrult_03_01(i4 %x) {
; CHECK-LABEL: @lshrult_03_01(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 1
  ret i1 %c
}

define i1 @lshrult_03_02(i4 %x) {
; CHECK-LABEL: @lshrult_03_02(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 2
  ret i1 %c
}

define i1 @lshrult_03_03(i4 %x) {
; CHECK-LABEL: @lshrult_03_03(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 3
  ret i1 %c
}

define i1 @lshrult_03_04(i4 %x) {
; CHECK-LABEL: @lshrult_03_04(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 4
  ret i1 %c
}

define i1 @lshrult_03_05(i4 %x) {
; CHECK-LABEL: @lshrult_03_05(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 5
  ret i1 %c
}

define i1 @lshrult_03_06(i4 %x) {
; CHECK-LABEL: @lshrult_03_06(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 6
  ret i1 %c
}

define i1 @lshrult_03_07(i4 %x) {
; CHECK-LABEL: @lshrult_03_07(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 7
  ret i1 %c
}

define i1 @lshrult_03_08(i4 %x) {
; CHECK-LABEL: @lshrult_03_08(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 8
  ret i1 %c
}

define i1 @lshrult_03_09(i4 %x) {
; CHECK-LABEL: @lshrult_03_09(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 9
  ret i1 %c
}

define i1 @lshrult_03_10(i4 %x) {
; CHECK-LABEL: @lshrult_03_10(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 10
  ret i1 %c
}

define i1 @lshrult_03_11(i4 %x) {
; CHECK-LABEL: @lshrult_03_11(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 11
  ret i1 %c
}

define i1 @lshrult_03_12(i4 %x) {
; CHECK-LABEL: @lshrult_03_12(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 12
  ret i1 %c
}

define i1 @lshrult_03_13(i4 %x) {
; CHECK-LABEL: @lshrult_03_13(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 13
  ret i1 %c
}

define i1 @lshrult_03_14(i4 %x) {
; CHECK-LABEL: @lshrult_03_14(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 14
  ret i1 %c
}

define i1 @lshrult_03_15(i4 %x) {
; CHECK-LABEL: @lshrult_03_15(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr i4 %x, 3
  %c = icmp ult i4 %s, 15
  ret i1 %c
}

define i1 @ashrsgt_01_00(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_00(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 0
  ret i1 %c
}

define i1 @ashrsgt_01_00_multiuse(i4 %x, ptr %p) {
; CHECK-LABEL: @ashrsgt_01_00_multiuse(
; CHECK-NEXT:    [[S:%.*]] = ashr i4 [[X:%.*]], 1
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[S]], 0
; CHECK-NEXT:    store i4 [[S]], ptr [[P:%.*]], align 1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 0
  store i4 %s, ptr %p
  ret i1 %c
}

define i1 @ashrsgt_01_01(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_01(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 1
  ret i1 %c
}

define i1 @ashrsgt_01_02(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_02(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 2
  ret i1 %c
}

define i1 @ashrsgt_01_03(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_03(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 3
  ret i1 %c
}

define i1 @ashrsgt_01_04(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_04(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 4
  ret i1 %c
}

define i1 @ashrsgt_01_05(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_05(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 5
  ret i1 %c
}

define i1 @ashrsgt_01_06(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_06(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 6
  ret i1 %c
}

define i1 @ashrsgt_01_07(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_07(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 7
  ret i1 %c
}

define i1 @ashrsgt_01_08(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_08(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 8
  ret i1 %c
}

define i1 @ashrsgt_01_09(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_09(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 9
  ret i1 %c
}

define i1 @ashrsgt_01_10(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_10(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 10
  ret i1 %c
}

define i1 @ashrsgt_01_11(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_11(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 11
  ret i1 %c
}

define i1 @ashrsgt_01_12(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_12(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -7
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 12
  ret i1 %c
}

define i1 @ashrsgt_01_13(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_13(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 13
  ret i1 %c
}

define i1 @ashrsgt_01_14(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_14(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 14
  ret i1 %c
}

define i1 @ashrsgt_01_15(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_15(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp sgt i4 %s, 15
  ret i1 %c
}

define i1 @ashrsgt_02_00(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_00(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 0
  ret i1 %c
}

define i1 @ashrsgt_02_01(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_01(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 1
  ret i1 %c
}

define i1 @ashrsgt_02_02(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_02(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 2
  ret i1 %c
}

define i1 @ashrsgt_02_03(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_03(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 3
  ret i1 %c
}

define i1 @ashrsgt_02_04(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_04(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 4
  ret i1 %c
}

define i1 @ashrsgt_02_05(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_05(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 5
  ret i1 %c
}

define i1 @ashrsgt_02_06(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_06(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 6
  ret i1 %c
}

define i1 @ashrsgt_02_07(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_07(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 7
  ret i1 %c
}

define i1 @ashrsgt_02_08(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_08(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 8
  ret i1 %c
}

define i1 @ashrsgt_02_09(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_09(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 9
  ret i1 %c
}

define i1 @ashrsgt_02_10(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_10(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 10
  ret i1 %c
}

define i1 @ashrsgt_02_11(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_11(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 11
  ret i1 %c
}

define i1 @ashrsgt_02_12(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_12(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 12
  ret i1 %c
}

define i1 @ashrsgt_02_13(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_13(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 13
  ret i1 %c
}

define i1 @ashrsgt_02_14(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_14(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 14
  ret i1 %c
}

define i1 @ashrsgt_02_15(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_15(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 2
  %c = icmp sgt i4 %s, 15
  ret i1 %c
}

define i1 @ashrsgt_03_00(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_00(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 0
  ret i1 %c
}

define i1 @ashrsgt_03_01(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_01(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 1
  ret i1 %c
}

define i1 @ashrsgt_03_02(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_02(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 2
  ret i1 %c
}

define i1 @ashrsgt_03_03(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_03(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 3
  ret i1 %c
}

define i1 @ashrsgt_03_04(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_04(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 4
  ret i1 %c
}

define i1 @ashrsgt_03_05(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_05(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 5
  ret i1 %c
}

define i1 @ashrsgt_03_06(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_06(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 6
  ret i1 %c
}

define i1 @ashrsgt_03_07(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_07(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 7
  ret i1 %c
}

define i1 @ashrsgt_03_08(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_08(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 8
  ret i1 %c
}

define i1 @ashrsgt_03_09(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_09(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 9
  ret i1 %c
}

define i1 @ashrsgt_03_10(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_10(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 10
  ret i1 %c
}

define i1 @ashrsgt_03_11(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_11(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 11
  ret i1 %c
}

define i1 @ashrsgt_03_12(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_12(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 12
  ret i1 %c
}

define i1 @ashrsgt_03_13(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_13(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 13
  ret i1 %c
}

define i1 @ashrsgt_03_14(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_14(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 14
  ret i1 %c
}

define i1 @ashrsgt_03_15(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_15(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 3
  %c = icmp sgt i4 %s, 15
  ret i1 %c
}

define i1 @ashrslt_01_00(i4 %x) {
; CHECK-LABEL: @ashrslt_01_00(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 0
  ret i1 %c
}

define i1 @ashrslt_01_01(i4 %x) {
; CHECK-LABEL: @ashrslt_01_01(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 1
  ret i1 %c
}

define i1 @ashrslt_01_02(i4 %x) {
; CHECK-LABEL: @ashrslt_01_02(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 2
  ret i1 %c
}

define i1 @ashrslt_01_03(i4 %x) {
; CHECK-LABEL: @ashrslt_01_03(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 3
  ret i1 %c
}

define i1 @ashrslt_01_04(i4 %x) {
; CHECK-LABEL: @ashrslt_01_04(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 4
  ret i1 %c
}

define i1 @ashrslt_01_05(i4 %x) {
; CHECK-LABEL: @ashrslt_01_05(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 5
  ret i1 %c
}

define i1 @ashrslt_01_06(i4 %x) {
; CHECK-LABEL: @ashrslt_01_06(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 6
  ret i1 %c
}

define i1 @ashrslt_01_07(i4 %x) {
; CHECK-LABEL: @ashrslt_01_07(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 7
  ret i1 %c
}

define i1 @ashrslt_01_08(i4 %x) {
; CHECK-LABEL: @ashrslt_01_08(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 8
  ret i1 %c
}

define i1 @ashrslt_01_09(i4 %x) {
; CHECK-LABEL: @ashrslt_01_09(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 9
  ret i1 %c
}

define i1 @ashrslt_01_10(i4 %x) {
; CHECK-LABEL: @ashrslt_01_10(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 10
  ret i1 %c
}

define i1 @ashrslt_01_11(i4 %x) {
; CHECK-LABEL: @ashrslt_01_11(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 11
  ret i1 %c
}

define i1 @ashrslt_01_12(i4 %x) {
; CHECK-LABEL: @ashrslt_01_12(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 12
  ret i1 %c
}

define i1 @ashrslt_01_13(i4 %x) {
; CHECK-LABEL: @ashrslt_01_13(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 13
  ret i1 %c
}

define i1 @ashrslt_01_14(i4 %x) {
; CHECK-LABEL: @ashrslt_01_14(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 14
  ret i1 %c
}

define i1 @ashrslt_01_15(i4 %x) {
; CHECK-LABEL: @ashrslt_01_15(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 1
  %c = icmp slt i4 %s, 15
  ret i1 %c
}

define i1 @ashrslt_02_00(i4 %x) {
; CHECK-LABEL: @ashrslt_02_00(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 0
  ret i1 %c
}

define i1 @ashrslt_02_01(i4 %x) {
; CHECK-LABEL: @ashrslt_02_01(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 1
  ret i1 %c
}

define i1 @ashrslt_02_02(i4 %x) {
; CHECK-LABEL: @ashrslt_02_02(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 2
  ret i1 %c
}

define i1 @ashrslt_02_03(i4 %x) {
; CHECK-LABEL: @ashrslt_02_03(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 3
  ret i1 %c
}

define i1 @ashrslt_02_04(i4 %x) {
; CHECK-LABEL: @ashrslt_02_04(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 4
  ret i1 %c
}

define i1 @ashrslt_02_05(i4 %x) {
; CHECK-LABEL: @ashrslt_02_05(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 5
  ret i1 %c
}

define i1 @ashrslt_02_06(i4 %x) {
; CHECK-LABEL: @ashrslt_02_06(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 6
  ret i1 %c
}

define i1 @ashrslt_02_07(i4 %x) {
; CHECK-LABEL: @ashrslt_02_07(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 7
  ret i1 %c
}

define i1 @ashrslt_02_08(i4 %x) {
; CHECK-LABEL: @ashrslt_02_08(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 8
  ret i1 %c
}

define i1 @ashrslt_02_09(i4 %x) {
; CHECK-LABEL: @ashrslt_02_09(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 9
  ret i1 %c
}

define i1 @ashrslt_02_10(i4 %x) {
; CHECK-LABEL: @ashrslt_02_10(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 10
  ret i1 %c
}

define i1 @ashrslt_02_11(i4 %x) {
; CHECK-LABEL: @ashrslt_02_11(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 11
  ret i1 %c
}

define i1 @ashrslt_02_12(i4 %x) {
; CHECK-LABEL: @ashrslt_02_12(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 12
  ret i1 %c
}

define i1 @ashrslt_02_13(i4 %x) {
; CHECK-LABEL: @ashrslt_02_13(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 13
  ret i1 %c
}

define i1 @ashrslt_02_14(i4 %x) {
; CHECK-LABEL: @ashrslt_02_14(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 14
  ret i1 %c
}

define i1 @ashrslt_02_15(i4 %x) {
; CHECK-LABEL: @ashrslt_02_15(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 2
  %c = icmp slt i4 %s, 15
  ret i1 %c
}

define i1 @ashrslt_03_00(i4 %x) {
; CHECK-LABEL: @ashrslt_03_00(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 0
  ret i1 %c
}

define i1 @ashrslt_03_01(i4 %x) {
; CHECK-LABEL: @ashrslt_03_01(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 1
  ret i1 %c
}

define i1 @ashrslt_03_02(i4 %x) {
; CHECK-LABEL: @ashrslt_03_02(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 2
  ret i1 %c
}

define i1 @ashrslt_03_03(i4 %x) {
; CHECK-LABEL: @ashrslt_03_03(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 3
  ret i1 %c
}

define i1 @ashrslt_03_04(i4 %x) {
; CHECK-LABEL: @ashrslt_03_04(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 4
  ret i1 %c
}

define i1 @ashrslt_03_05(i4 %x) {
; CHECK-LABEL: @ashrslt_03_05(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 5
  ret i1 %c
}

define i1 @ashrslt_03_06(i4 %x) {
; CHECK-LABEL: @ashrslt_03_06(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 6
  ret i1 %c
}

define i1 @ashrslt_03_07(i4 %x) {
; CHECK-LABEL: @ashrslt_03_07(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 7
  ret i1 %c
}

define i1 @ashrslt_03_08(i4 %x) {
; CHECK-LABEL: @ashrslt_03_08(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 8
  ret i1 %c
}

define i1 @ashrslt_03_09(i4 %x) {
; CHECK-LABEL: @ashrslt_03_09(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 9
  ret i1 %c
}

define i1 @ashrslt_03_10(i4 %x) {
; CHECK-LABEL: @ashrslt_03_10(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 10
  ret i1 %c
}

define i1 @ashrslt_03_11(i4 %x) {
; CHECK-LABEL: @ashrslt_03_11(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 11
  ret i1 %c
}

define i1 @ashrslt_03_12(i4 %x) {
; CHECK-LABEL: @ashrslt_03_12(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 12
  ret i1 %c
}

define i1 @ashrslt_03_13(i4 %x) {
; CHECK-LABEL: @ashrslt_03_13(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 13
  ret i1 %c
}

define i1 @ashrslt_03_14(i4 %x) {
; CHECK-LABEL: @ashrslt_03_14(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 14
  ret i1 %c
}

define i1 @ashrslt_03_15(i4 %x) {
; CHECK-LABEL: @ashrslt_03_15(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i4 %x, 3
  %c = icmp slt i4 %s, 15
  ret i1 %c
}

define i1 @lshrugt_01_00_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 0
  ret i1 %c
}

define i1 @lshrugt_01_01_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 1
  ret i1 %c
}

define i1 @lshrugt_01_02_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_02_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 2
  ret i1 %c
}

define i1 @lshrugt_01_03_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_03_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 3
  ret i1 %c
}

define i1 @lshrugt_01_04_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_04_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], -8
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 4
  ret i1 %c
}

define i1 @lshrugt_01_05_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_05_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], -6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 5
  ret i1 %c
}

define i1 @lshrugt_01_06_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_06_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i4 [[X:%.*]], -2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 6
  ret i1 %c
}

define i1 @lshrugt_01_07_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_07_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 7
  ret i1 %c
}

define i1 @lshrugt_01_08_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_08_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 8
  ret i1 %c
}

define i1 @lshrugt_01_09_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_09_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 9
  ret i1 %c
}

define i1 @lshrugt_01_10_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_10_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 10
  ret i1 %c
}

define i1 @lshrugt_01_11_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_11_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 11
  ret i1 %c
}

define i1 @lshrugt_01_12_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_12_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 12
  ret i1 %c
}

define i1 @lshrugt_01_13_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_13_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 13
  ret i1 %c
}

define i1 @lshrugt_01_14_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_14_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 14
  ret i1 %c
}

define i1 @lshrugt_01_15_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_01_15_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ugt i4 %s, 15
  ret i1 %c
}

define i1 @lshrugt_02_00_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 0
  ret i1 %c
}

define i1 @lshrugt_02_01_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 1
  ret i1 %c
}

define i1 @lshrugt_02_02_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_02_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 2
  ret i1 %c
}

define i1 @lshrugt_02_03_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_03_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 3
  ret i1 %c
}

define i1 @lshrugt_02_04_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_04_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 4
  ret i1 %c
}

define i1 @lshrugt_02_05_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_05_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 5
  ret i1 %c
}

define i1 @lshrugt_02_06_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_06_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 6
  ret i1 %c
}

define i1 @lshrugt_02_07_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_07_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 7
  ret i1 %c
}

define i1 @lshrugt_02_08_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_08_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 8
  ret i1 %c
}

define i1 @lshrugt_02_09_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_09_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 9
  ret i1 %c
}

define i1 @lshrugt_02_10_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_10_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 10
  ret i1 %c
}

define i1 @lshrugt_02_11_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_11_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 11
  ret i1 %c
}

define i1 @lshrugt_02_12_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_12_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 12
  ret i1 %c
}

define i1 @lshrugt_02_13_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_13_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 13
  ret i1 %c
}

define i1 @lshrugt_02_14_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_14_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 14
  ret i1 %c
}

define i1 @lshrugt_02_15_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_02_15_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ugt i4 %s, 15
  ret i1 %c
}

define i1 @lshrugt_03_00_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 0
  ret i1 %c
}

define i1 @lshrugt_03_01_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_01_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 1
  ret i1 %c
}

define i1 @lshrugt_03_02_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_02_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 2
  ret i1 %c
}

define i1 @lshrugt_03_03_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_03_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 3
  ret i1 %c
}

define i1 @lshrugt_03_04_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_04_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 4
  ret i1 %c
}

define i1 @lshrugt_03_05_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_05_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 5
  ret i1 %c
}

define i1 @lshrugt_03_06_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_06_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 6
  ret i1 %c
}

define i1 @lshrugt_03_07_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_07_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 7
  ret i1 %c
}

define i1 @lshrugt_03_08_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_08_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 8
  ret i1 %c
}

define i1 @lshrugt_03_09_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_09_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 9
  ret i1 %c
}

define i1 @lshrugt_03_10_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_10_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 10
  ret i1 %c
}

define i1 @lshrugt_03_11_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_11_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 11
  ret i1 %c
}

define i1 @lshrugt_03_12_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_12_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 12
  ret i1 %c
}

define i1 @lshrugt_03_13_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_13_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 13
  ret i1 %c
}

define i1 @lshrugt_03_14_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_14_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 14
  ret i1 %c
}

define i1 @lshrugt_03_15_exact(i4 %x) {
; CHECK-LABEL: @lshrugt_03_15_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ugt i4 %s, 15
  ret i1 %c
}

define i1 @ashr_eq_exact(i8 %x) {
; CHECK-LABEL: @ashr_eq_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp eq i8 %s, 10
  ret i1 %c
}

define i1 @ashr_ne_exact(i8 %x) {
; CHECK-LABEL: @ashr_ne_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp ne i8 %s, 10
  ret i1 %c
}

define i1 @ashr_ugt_exact(i8 %x) {
; CHECK-LABEL: @ashr_ugt_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp ugt i8 %s, 10
  ret i1 %c
}


define i1 @ashr_uge_exact(i8 %x) {
; CHECK-LABEL: @ashr_uge_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i8 [[X:%.*]], 72
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp uge i8 %s, 10
  ret i1 %c
}

define i1 @ashr_ult_exact(i8 %x) {
; CHECK-LABEL: @ashr_ult_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp ult i8 %s, 10
  ret i1 %c
}


define i1 @ashr_ule_exact(i8 %x) {
; CHECK-LABEL: @ashr_ule_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i8 [[X:%.*]], 88
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp ule i8 %s, 10
  ret i1 %c
}


define i1 @ashr_sgt_exact(i8 %x) {
; CHECK-LABEL: @ashr_sgt_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp sgt i8 %s, 10
  ret i1 %c
}


define i1 @ashr_sge_exact(i8 %x) {
; CHECK-LABEL: @ashr_sge_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i8 [[X:%.*]], 72
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp sge i8 %s, 10
  ret i1 %c
}

define i1 @ashr_slt_exact(i8 %x) {
; CHECK-LABEL: @ashr_slt_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp slt i8 %s, 10
  ret i1 %c
}

define i1 @ashr_sle_exact(i8 %x) {
; CHECK-LABEL: @ashr_sle_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 88
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp sle i8 %s, 10
  ret i1 %c
}

define i1 @ashr_eq_noexact(i8 %x) {
; CHECK-LABEL: @ashr_eq_noexact(
; CHECK-NEXT:    [[S_MASK:%.*]] = and i8 [[X:%.*]], -8
; CHECK-NEXT:    [[C:%.*]] = icmp eq i8 [[S_MASK]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp eq i8 %s, 10
  ret i1 %c
}

define i1 @ashr_ne_noexact(i8 %x) {
; CHECK-LABEL: @ashr_ne_noexact(
; CHECK-NEXT:    [[S_MASK:%.*]] = and i8 [[X:%.*]], -8
; CHECK-NEXT:    [[C:%.*]] = icmp ne i8 [[S_MASK]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp ne i8 %s, 10
  ret i1 %c
}

define i1 @ashr_ugt_noexact(i8 %x) {
; CHECK-LABEL: @ashr_ugt_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i8 [[X:%.*]], 87
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp ugt i8 %s, 10
  ret i1 %c
}


define i1 @ashr_uge_noexact(i8 %x) {
; CHECK-LABEL: @ashr_uge_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp ugt i8 [[X:%.*]], 79
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp uge i8 %s, 10
  ret i1 %c
}

define i1 @ashr_ult_noexact(i8 %x) {
; CHECK-LABEL: @ashr_ult_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp ult i8 %s, 10
  ret i1 %c
}


define i1 @ashr_ule_noexact(i8 %x) {
; CHECK-LABEL: @ashr_ule_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i8 [[X:%.*]], 88
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp ule i8 %s, 10
  ret i1 %c
}


define i1 @ashr_sgt_noexact(i8 %x) {
; CHECK-LABEL: @ashr_sgt_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i8 [[X:%.*]], 87
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp sgt i8 %s, 10
  ret i1 %c
}


define i1 @ashr_sge_noexact(i8 %x) {
; CHECK-LABEL: @ashr_sge_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i8 [[X:%.*]], 79
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp sge i8 %s, 10
  ret i1 %c
}

define i1 @ashr_slt_noexact(i8 %x) {
; CHECK-LABEL: @ashr_slt_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 80
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp slt i8 %s, 10
  ret i1 %c
}

define i1 @ashr_sle_noexact(i8 %x) {
; CHECK-LABEL: @ashr_sle_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 88
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 3
  %c = icmp sle i8 %s, 10
  ret i1 %c
}

define i1 @ashr_00_00_ashr_extra_use(i8 %x, ptr %ptr) {
; CHECK-LABEL: @ashr_00_00_ashr_extra_use(
; CHECK-NEXT:    [[S:%.*]] = ashr exact i8 [[X:%.*]], 3
; CHECK-NEXT:    [[C:%.*]] = icmp ult i8 [[S]], 11
; CHECK-NEXT:    store i8 [[S]], ptr [[PTR:%.*]], align 1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 3
  %c = icmp ule i8 %s, 10
  store i8 %s, ptr %ptr
  ret i1 %c
}

define <4 x i1> @ashr_00_00_vec(<4 x i8> %x) {
; CHECK-LABEL: @ashr_00_00_vec(
; CHECK-NEXT:    [[C:%.*]] = icmp ult <4 x i8> [[X:%.*]], <i8 88, i8 88, i8 88, i8 88>
; CHECK-NEXT:    ret <4 x i1> [[C]]
;
  %s = ashr exact <4 x i8> %x, <i8 3,i8 3, i8 3, i8 3>
  %c = icmp ule <4 x i8> %s, <i8 10,i8 10,i8 10,i8 10>
  ret <4 x i1> %c
}

define i1 @ashr_sgt_overflow(i8 %x) {
; CHECK-LABEL: @ashr_sgt_overflow(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr i8 %x, 1
  %c = icmp sgt i8 %s, 63
  ret i1 %c
}

define i1 @lshrult_01_00_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_00_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 0
  ret i1 %c
}

define i1 @lshrult_01_01_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 1
  ret i1 %c
}

define i1 @lshrult_01_02_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_02_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 2
  ret i1 %c
}

define i1 @lshrult_01_03_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_03_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], 6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 3
  ret i1 %c
}

define i1 @lshrult_01_04_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_04_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 4
  ret i1 %c
}

define i1 @lshrult_01_05_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_05_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], -6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 5
  ret i1 %c
}

define i1 @lshrult_01_06_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_06_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 6
  ret i1 %c
}

define i1 @lshrult_01_07_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_07_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], -2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 7
  ret i1 %c
}

define i1 @lshrult_01_08_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_08_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 8
  ret i1 %c
}

define i1 @lshrult_01_09_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_09_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 9
  ret i1 %c
}

define i1 @lshrult_01_10_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_10_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 10
  ret i1 %c
}

define i1 @lshrult_01_11_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_11_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 11
  ret i1 %c
}

define i1 @lshrult_01_12_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_12_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 12
  ret i1 %c
}

define i1 @lshrult_01_13_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_13_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 13
  ret i1 %c
}

define i1 @lshrult_01_14_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_14_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 14
  ret i1 %c
}

define i1 @lshrult_01_15_exact(i4 %x) {
; CHECK-LABEL: @lshrult_01_15_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 1
  %c = icmp ult i4 %s, 15
  ret i1 %c
}

define i1 @lshrult_02_00_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_00_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 0
  ret i1 %c
}

define i1 @lshrult_02_01_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 1
  ret i1 %c
}

define i1 @lshrult_02_02_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_02_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 2
  ret i1 %c
}

define i1 @lshrult_02_03_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_03_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 3
  ret i1 %c
}

define i1 @lshrult_02_04_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_04_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 4
  ret i1 %c
}

define i1 @lshrult_02_05_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_05_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 5
  ret i1 %c
}

define i1 @lshrult_02_06_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_06_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 6
  ret i1 %c
}

define i1 @lshrult_02_07_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_07_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 7
  ret i1 %c
}

define i1 @lshrult_02_08_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_08_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 8
  ret i1 %c
}

define i1 @lshrult_02_09_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_09_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 9
  ret i1 %c
}

define i1 @lshrult_02_10_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_10_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 10
  ret i1 %c
}

define i1 @lshrult_02_11_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_11_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 11
  ret i1 %c
}

define i1 @lshrult_02_12_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_12_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 12
  ret i1 %c
}

define i1 @lshrult_02_13_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_13_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 13
  ret i1 %c
}

define i1 @lshrult_02_14_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_14_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 14
  ret i1 %c
}

define i1 @lshrult_02_15_exact(i4 %x) {
; CHECK-LABEL: @lshrult_02_15_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 2
  %c = icmp ult i4 %s, 15
  ret i1 %c
}

define i1 @lshrult_03_00_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_00_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 0
  ret i1 %c
}

define i1 @lshrult_03_01_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 1
  ret i1 %c
}

define i1 @lshrult_03_02_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_02_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 2
  ret i1 %c
}

define i1 @lshrult_03_03_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_03_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 3
  ret i1 %c
}

define i1 @lshrult_03_04_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_04_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 4
  ret i1 %c
}

define i1 @lshrult_03_05_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_05_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 5
  ret i1 %c
}

define i1 @lshrult_03_06_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_06_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 6
  ret i1 %c
}

define i1 @lshrult_03_07_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_07_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 7
  ret i1 %c
}

define i1 @lshrult_03_08_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_08_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 8
  ret i1 %c
}

define i1 @lshrult_03_09_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_09_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 9
  ret i1 %c
}

define i1 @lshrult_03_10_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_10_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 10
  ret i1 %c
}

define i1 @lshrult_03_11_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_11_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 11
  ret i1 %c
}

define i1 @lshrult_03_12_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_12_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 12
  ret i1 %c
}

define i1 @lshrult_03_13_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_13_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 13
  ret i1 %c
}

define i1 @lshrult_03_14_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_14_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 14
  ret i1 %c
}

define i1 @lshrult_03_15_exact(i4 %x) {
; CHECK-LABEL: @lshrult_03_15_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = lshr exact i4 %x, 3
  %c = icmp ult i4 %s, 15
  ret i1 %c
}

define i1 @ashrsgt_01_00_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 0
  ret i1 %c
}

define i1 @ashrsgt_01_01_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 1
  ret i1 %c
}

define i1 @ashrsgt_01_02_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_02_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 2
  ret i1 %c
}

define i1 @ashrsgt_01_03_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_03_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 3
  ret i1 %c
}

define i1 @ashrsgt_01_04_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_04_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 4
  ret i1 %c
}

define i1 @ashrsgt_01_05_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_05_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 5
  ret i1 %c
}

define i1 @ashrsgt_01_06_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_06_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 6
  ret i1 %c
}

define i1 @ashrsgt_01_07_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_07_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 7
  ret i1 %c
}

define i1 @ashrsgt_01_08_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_08_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 8
  ret i1 %c
}

define i1 @ashrsgt_01_09_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_09_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 9
  ret i1 %c
}

define i1 @ashrsgt_01_10_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_10_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 10
  ret i1 %c
}

define i1 @ashrsgt_01_11_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_11_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 11
  ret i1 %c
}

define i1 @ashrsgt_01_12_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_12_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], -8
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 12
  ret i1 %c
}

define i1 @ashrsgt_01_13_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_13_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 13
  ret i1 %c
}

define i1 @ashrsgt_01_14_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_14_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 14
  ret i1 %c
}

define i1 @ashrsgt_01_15_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_01_15_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp sgt i4 %s, 15
  ret i1 %c
}

define i1 @ashrsgt_02_00_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 0
  ret i1 %c
}

define i1 @ashrsgt_02_01_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_01_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 1
  ret i1 %c
}

define i1 @ashrsgt_02_02_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_02_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 2
  ret i1 %c
}

define i1 @ashrsgt_02_03_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_03_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 3
  ret i1 %c
}

define i1 @ashrsgt_02_04_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_04_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 4
  ret i1 %c
}

define i1 @ashrsgt_02_05_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_05_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 5
  ret i1 %c
}

define i1 @ashrsgt_02_06_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_06_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 6
  ret i1 %c
}

define i1 @ashrsgt_02_07_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_07_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 7
  ret i1 %c
}

define i1 @ashrsgt_02_08_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_08_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 8
  ret i1 %c
}

define i1 @ashrsgt_02_09_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_09_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 9
  ret i1 %c
}

define i1 @ashrsgt_02_10_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_10_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 10
  ret i1 %c
}

define i1 @ashrsgt_02_11_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_11_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 11
  ret i1 %c
}

define i1 @ashrsgt_02_12_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_12_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 12
  ret i1 %c
}

define i1 @ashrsgt_02_13_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_13_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 13
  ret i1 %c
}

define i1 @ashrsgt_02_14_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_14_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp ne i4 [[X:%.*]], -8
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 14
  ret i1 %c
}

define i1 @ashrsgt_02_15_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_02_15_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 2
  %c = icmp sgt i4 %s, 15
  ret i1 %c
}

define i1 @ashrsgt_03_00_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_00_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 0
  ret i1 %c
}

define i1 @ashrsgt_03_01_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_01_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 1
  ret i1 %c
}

define i1 @ashrsgt_03_02_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_02_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 2
  ret i1 %c
}

define i1 @ashrsgt_03_03_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_03_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 3
  ret i1 %c
}

define i1 @ashrsgt_03_04_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_04_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 4
  ret i1 %c
}

define i1 @ashrsgt_03_05_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_05_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 5
  ret i1 %c
}

define i1 @ashrsgt_03_06_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_06_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 6
  ret i1 %c
}

define i1 @ashrsgt_03_07_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_07_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 7
  ret i1 %c
}

define i1 @ashrsgt_03_08_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_08_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 8
  ret i1 %c
}

define i1 @ashrsgt_03_09_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_09_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 9
  ret i1 %c
}

define i1 @ashrsgt_03_10_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_10_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 10
  ret i1 %c
}

define i1 @ashrsgt_03_11_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_11_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 11
  ret i1 %c
}

define i1 @ashrsgt_03_12_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_12_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 12
  ret i1 %c
}

define i1 @ashrsgt_03_13_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_13_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 13
  ret i1 %c
}

define i1 @ashrsgt_03_14_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_14_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 14
  ret i1 %c
}

define i1 @ashrsgt_03_15_exact(i4 %x) {
; CHECK-LABEL: @ashrsgt_03_15_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i4 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 3
  %c = icmp sgt i4 %s, 15
  ret i1 %c
}

define i1 @ashrslt_01_00_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 0
  ret i1 %c
}

define i1 @ashrslt_01_01_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 1
  ret i1 %c
}

define i1 @ashrslt_01_02_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_02_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 3
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 2
  ret i1 %c
}

define i1 @ashrslt_01_03_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_03_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 5
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 3
  ret i1 %c
}

define i1 @ashrslt_01_04_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_04_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 4
  ret i1 %c
}

define i1 @ashrslt_01_05_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_05_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 5
  ret i1 %c
}

define i1 @ashrslt_01_06_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_06_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 6
  ret i1 %c
}

define i1 @ashrslt_01_07_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_07_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 7
  ret i1 %c
}

define i1 @ashrslt_01_08_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_08_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 8
  ret i1 %c
}

define i1 @ashrslt_01_09_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_09_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 9
  ret i1 %c
}

define i1 @ashrslt_01_10_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_10_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 10
  ret i1 %c
}

define i1 @ashrslt_01_11_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_11_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 11
  ret i1 %c
}

define i1 @ashrslt_01_12_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_12_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 12
  ret i1 %c
}

define i1 @ashrslt_01_13_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_13_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -6
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 13
  ret i1 %c
}

define i1 @ashrslt_01_14_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_14_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 14
  ret i1 %c
}

define i1 @ashrslt_01_15_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_01_15_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -2
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 1
  %c = icmp slt i4 %s, 15
  ret i1 %c
}

define i1 @ashrslt_02_00_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 0
  ret i1 %c
}

define i1 @ashrslt_02_01_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_01_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 1
  ret i1 %c
}

define i1 @ashrslt_02_02_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_02_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 2
  ret i1 %c
}

define i1 @ashrslt_02_03_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_03_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 3
  ret i1 %c
}

define i1 @ashrslt_02_04_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_04_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 4
  ret i1 %c
}

define i1 @ashrslt_02_05_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_05_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 5
  ret i1 %c
}

define i1 @ashrslt_02_06_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_06_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 6
  ret i1 %c
}

define i1 @ashrslt_02_07_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_07_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 7
  ret i1 %c
}

define i1 @ashrslt_02_08_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_08_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 8
  ret i1 %c
}

define i1 @ashrslt_02_09_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_09_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 9
  ret i1 %c
}

define i1 @ashrslt_02_10_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_10_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 10
  ret i1 %c
}

define i1 @ashrslt_02_11_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_11_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 11
  ret i1 %c
}

define i1 @ashrslt_02_12_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_12_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 12
  ret i1 %c
}

define i1 @ashrslt_02_13_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_13_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 13
  ret i1 %c
}

define i1 @ashrslt_02_14_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_14_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 14
  ret i1 %c
}

define i1 @ashrslt_02_15_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_02_15_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], -4
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 2
  %c = icmp slt i4 %s, 15
  ret i1 %c
}

define i1 @ashrslt_03_00_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_00_exact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i4 [[X:%.*]], 0
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 0
  ret i1 %c
}

define i1 @ashrslt_03_01_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_01_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 1
  ret i1 %c
}

define i1 @ashrslt_03_02_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_02_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 2
  ret i1 %c
}

define i1 @ashrslt_03_03_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_03_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 3
  ret i1 %c
}

define i1 @ashrslt_03_04_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_04_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 4
  ret i1 %c
}

define i1 @ashrslt_03_05_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_05_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 5
  ret i1 %c
}

define i1 @ashrslt_03_06_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_06_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 6
  ret i1 %c
}

define i1 @ashrslt_03_07_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_07_exact(
; CHECK-NEXT:    ret i1 true
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 7
  ret i1 %c
}

define i1 @ashrslt_03_08_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_08_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 8
  ret i1 %c
}

define i1 @ashrslt_03_09_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_09_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 9
  ret i1 %c
}

define i1 @ashrslt_03_10_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_10_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 10
  ret i1 %c
}

define i1 @ashrslt_03_11_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_11_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 11
  ret i1 %c
}

define i1 @ashrslt_03_12_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_12_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 12
  ret i1 %c
}

define i1 @ashrslt_03_13_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_13_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 13
  ret i1 %c
}

define i1 @ashrslt_03_14_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_14_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 14
  ret i1 %c
}

define i1 @ashrslt_03_15_exact(i4 %x) {
; CHECK-LABEL: @ashrslt_03_15_exact(
; CHECK-NEXT:    ret i1 false
;
  %s = ashr exact i4 %x, 3
  %c = icmp slt i4 %s, 15
  ret i1 %c
}

define i1 @ashr_slt_exact_near_pow2_cmpval(i8 %x) {
; CHECK-LABEL: @ashr_slt_exact_near_pow2_cmpval(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 9
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 1
  %c = icmp slt i8 %s, 5
  ret i1 %c
}

define i1 @ashr_ult_exact_near_pow2_cmpval(i8 %x) {
; CHECK-LABEL: @ashr_ult_exact_near_pow2_cmpval(
; CHECK-NEXT:    [[C:%.*]] = icmp ult i8 [[X:%.*]], 9
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 1
  %c = icmp ult i8 %s, 5
  ret i1 %c
}

define i1 @negtest_near_pow2_cmpval_ashr_slt_noexact(i8 %x) {
; CHECK-LABEL: @negtest_near_pow2_cmpval_ashr_slt_noexact(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 10
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr i8 %x, 1
  %c = icmp slt i8 %s, 5
  ret i1 %c
}

define i1 @negtest_near_pow2_cmpval_ashr_wrong_cmp_pred(i8 %x) {
; CHECK-LABEL: @negtest_near_pow2_cmpval_ashr_wrong_cmp_pred(
; CHECK-NEXT:    [[C:%.*]] = icmp eq i8 [[X:%.*]], 10
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 1
  %c = icmp eq i8 %s, 5
  ret i1 %c
}

define i1 @negtest_near_pow2_cmpval_isnt_close_to_pow2(i8 %x) {
; CHECK-LABEL: @negtest_near_pow2_cmpval_isnt_close_to_pow2(
; CHECK-NEXT:    [[C:%.*]] = icmp slt i8 [[X:%.*]], 12
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 1
  %c = icmp slt i8 %s, 6
  ret i1 %c
}

define i1 @negtest_near_pow2_cmpval_would_overflow_into_signbit(i8 %x) {
; CHECK-LABEL: @negtest_near_pow2_cmpval_would_overflow_into_signbit(
; CHECK-NEXT:    [[C:%.*]] = icmp sgt i8 [[X:%.*]], -1
; CHECK-NEXT:    ret i1 [[C]]
;
  %s = ashr exact i8 %x, 2
  %c = icmp ult i8 %s, 33
  ret i1 %c
}