mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
[InstCombine] Regenerate test checks (NFC)
This commit is contained in:
parent
c0c9269ef6
commit
8ca3523a4f
@ -1,5 +1,5 @@
|
||||
; RUN: opt < %s -instcombine -S | \
|
||||
; RUN: grep select | not grep 'i32\*'
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||||
|
||||
; This testcase corresponds to PR362, which notices that this horrible code
|
||||
; is generated by the C++ front-end and LLVM optimizers, which has lots of
|
||||
@ -9,26 +9,44 @@
|
||||
; allow elimination of the extra stuff by the mem2reg pass.
|
||||
|
||||
define void @_Z5test1RiS_(i32* %x, i32* %y) {
|
||||
; CHECK-LABEL: @_Z5test1RiS_(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[TMP_1_I:%.*]] = load i32, i32* [[Y:%.*]], align 4
|
||||
; CHECK-NEXT: [[TMP_3_I:%.*]] = load i32, i32* [[X:%.*]], align 4
|
||||
; CHECK-NEXT: [[TMP_4_I:%.*]] = icmp slt i32 [[TMP_1_I]], [[TMP_3_I]]
|
||||
; CHECK-NEXT: [[TMP_4:%.*]] = select i1 [[TMP_4_I]], i32 [[TMP_1_I]], i32 [[TMP_3_I]]
|
||||
; CHECK-NEXT: store i32 [[TMP_4]], i32* [[X]], align 4
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
entry:
|
||||
%tmp.1.i = load i32, i32* %y ; <i32> [#uses=1]
|
||||
%tmp.3.i = load i32, i32* %x ; <i32> [#uses=1]
|
||||
%tmp.4.i = icmp slt i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1]
|
||||
%retval.i = select i1 %tmp.4.i, i32* %y, i32* %x ; <i32*> [#uses=1]
|
||||
%tmp.4 = load i32, i32* %retval.i ; <i32> [#uses=1]
|
||||
store i32 %tmp.4, i32* %x
|
||||
ret void
|
||||
%tmp.1.i = load i32, i32* %y ; <i32> [#uses=1]
|
||||
%tmp.3.i = load i32, i32* %x ; <i32> [#uses=1]
|
||||
%tmp.4.i = icmp slt i32 %tmp.1.i, %tmp.3.i ; <i1> [#uses=1]
|
||||
%retval.i = select i1 %tmp.4.i, i32* %y, i32* %x ; <i32*> [#uses=1]
|
||||
%tmp.4 = load i32, i32* %retval.i ; <i32> [#uses=1]
|
||||
store i32 %tmp.4, i32* %x
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @_Z5test2RiS_(i32* %x, i32* %y) {
|
||||
; CHECK-LABEL: @_Z5test2RiS_(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[TMP_2:%.*]] = load i32, i32* [[X:%.*]], align 4
|
||||
; CHECK-NEXT: [[TMP_3_I:%.*]] = load i32, i32* [[Y:%.*]], align 4
|
||||
; CHECK-NEXT: [[TMP_4_I:%.*]] = icmp slt i32 [[TMP_2]], [[TMP_3_I]]
|
||||
; CHECK-NEXT: [[TMP_6:%.*]] = select i1 [[TMP_4_I]], i32 [[TMP_3_I]], i32 [[TMP_2]]
|
||||
; CHECK-NEXT: store i32 [[TMP_6]], i32* [[Y]], align 4
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
entry:
|
||||
%tmp.0 = alloca i32 ; <i32*> [#uses=2]
|
||||
%tmp.2 = load i32, i32* %x ; <i32> [#uses=2]
|
||||
store i32 %tmp.2, i32* %tmp.0
|
||||
%tmp.3.i = load i32, i32* %y ; <i32> [#uses=1]
|
||||
%tmp.4.i = icmp slt i32 %tmp.2, %tmp.3.i ; <i1> [#uses=1]
|
||||
%retval.i = select i1 %tmp.4.i, i32* %y, i32* %tmp.0 ; <i32*> [#uses=1]
|
||||
%tmp.6 = load i32, i32* %retval.i ; <i32> [#uses=1]
|
||||
store i32 %tmp.6, i32* %y
|
||||
ret void
|
||||
%tmp.0 = alloca i32 ; <i32*> [#uses=2]
|
||||
%tmp.2 = load i32, i32* %x ; <i32> [#uses=2]
|
||||
store i32 %tmp.2, i32* %tmp.0
|
||||
%tmp.3.i = load i32, i32* %y ; <i32> [#uses=1]
|
||||
%tmp.4.i = icmp slt i32 %tmp.2, %tmp.3.i ; <i1> [#uses=1]
|
||||
%retval.i = select i1 %tmp.4.i, i32* %y, i32* %tmp.0 ; <i32*> [#uses=1]
|
||||
%tmp.6 = load i32, i32* %retval.i ; <i32> [#uses=1]
|
||||
store i32 %tmp.6, i32* %y
|
||||
ret void
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
; (X < C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_fast_ordered_strict_maxmin(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_strict_maxmin(
|
||||
; CHECK-LABEL: @clamp_float_fast_ordered_strict_maxmin(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.maxnum.f32(float [[MIN]], float 1.000000e+00)
|
||||
@ -18,7 +18,7 @@ define float @clamp_float_fast_ordered_strict_maxmin(float %x) {
|
||||
|
||||
; (X <= C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_fast_ordered_nonstrict_maxmin(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_nonstrict_maxmin(
|
||||
; CHECK-LABEL: @clamp_float_fast_ordered_nonstrict_maxmin(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.maxnum.f32(float [[MIN]], float 1.000000e+00)
|
||||
@ -33,7 +33,7 @@ define float @clamp_float_fast_ordered_nonstrict_maxmin(float %x) {
|
||||
|
||||
; (X > C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_fast_ordered_strict_minmax(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_strict_minmax(
|
||||
; CHECK-LABEL: @clamp_float_fast_ordered_strict_minmax(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast ogt float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.minnum.f32(float [[MAX]], float 2.550000e+02)
|
||||
@ -48,7 +48,7 @@ define float @clamp_float_fast_ordered_strict_minmax(float %x) {
|
||||
|
||||
; (X >= C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_fast_ordered_nonstrict_minmax(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_nonstrict_minmax(
|
||||
; CHECK-LABEL: @clamp_float_fast_ordered_nonstrict_minmax(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast ogt float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.minnum.f32(float [[MAX]], float 2.550000e+02)
|
||||
@ -66,7 +66,7 @@ define float @clamp_float_fast_ordered_nonstrict_minmax(float %x) {
|
||||
|
||||
; (X < C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_fast_unordered_strict_maxmin(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_strict_maxmin(
|
||||
; CHECK-LABEL: @clamp_float_fast_unordered_strict_maxmin(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.maxnum.f32(float [[TMP1]], float 1.000000e+00)
|
||||
@ -81,7 +81,7 @@ define float @clamp_float_fast_unordered_strict_maxmin(float %x) {
|
||||
|
||||
; (X <= C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_fast_unordered_nonstrict_maxmin(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_nonstrict_maxmin(
|
||||
; CHECK-LABEL: @clamp_float_fast_unordered_nonstrict_maxmin(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.maxnum.f32(float [[TMP1]], float 1.000000e+00)
|
||||
@ -96,7 +96,7 @@ define float @clamp_float_fast_unordered_nonstrict_maxmin(float %x) {
|
||||
|
||||
; (X > C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_fast_unordered_strict_minmax(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_strict_minmax(
|
||||
; CHECK-LABEL: @clamp_float_fast_unordered_strict_minmax(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast ole float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.minnum.f32(float [[TMP1]], float 2.550000e+02)
|
||||
@ -111,7 +111,7 @@ define float @clamp_float_fast_unordered_strict_minmax(float %x) {
|
||||
|
||||
; (X >= C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_fast_unordered_nonstrict_minmax(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_nonstrict_minmax(
|
||||
; CHECK-LABEL: @clamp_float_fast_unordered_nonstrict_minmax(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast ole float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.minnum.f32(float [[TMP1]], float 2.550000e+02)
|
||||
@ -129,7 +129,7 @@ define float @clamp_float_fast_unordered_nonstrict_minmax(float %x) {
|
||||
; (X > 1.0) ? min(x, 255.0) : 1.0
|
||||
; That did not match because select was in inverse order.
|
||||
define float @clamp_test_1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_test_1(
|
||||
; CHECK-LABEL: @clamp_test_1(
|
||||
; CHECK-NEXT: [[INNER_CMP_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.maxnum.f32(float [[TMP1]], float 1.000000e+00)
|
||||
@ -146,7 +146,7 @@ define float @clamp_test_1(float %x) {
|
||||
|
||||
; Like @clamp_test_1 but HighConst < LowConst
|
||||
define float @clamp_negative_wrong_const(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_negative_wrong_const(
|
||||
; CHECK-LABEL: @clamp_negative_wrong_const(
|
||||
; CHECK-NEXT: [[INNER_CMP_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ugt float [[X]], 5.120000e+02
|
||||
@ -162,7 +162,7 @@ define float @clamp_negative_wrong_const(float %x) {
|
||||
|
||||
; Like @clamp_test_1 but both are min
|
||||
define float @clamp_negative_same_op(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_negative_same_op(
|
||||
; CHECK-LABEL: @clamp_negative_same_op(
|
||||
; CHECK-NEXT: [[INNER_CMP_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ult float [[X]], 1.000000e+00
|
||||
@ -181,7 +181,7 @@ define float @clamp_negative_same_op(float %x) {
|
||||
|
||||
; First, check that we don't do bad things in the presence of signed zeros
|
||||
define float @clamp_float_with_zero1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_with_zero1(
|
||||
; CHECK-LABEL: @clamp_float_with_zero1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ole float [[X]], 0.000000e+00
|
||||
@ -196,7 +196,7 @@ define float @clamp_float_with_zero1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_with_zero2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_with_zero2(
|
||||
; CHECK-LABEL: @clamp_float_with_zero2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp olt float [[X]], 0.000000e+00
|
||||
@ -218,7 +218,7 @@ define float @clamp_float_with_zero2(float %x) {
|
||||
|
||||
; (X < C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_ordered_strict_maxmin1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_strict_maxmin1(
|
||||
; CHECK-LABEL: @clamp_float_ordered_strict_maxmin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp olt float [[X]], 1.000000e+00
|
||||
@ -233,11 +233,11 @@ define float @clamp_float_ordered_strict_maxmin1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_ordered_strict_maxmin2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_strict_maxmin2(
|
||||
; CHECK-LABEL: @clamp_float_ordered_strict_maxmin2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp olt float [[X]], 1.000000e+00
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[MIN]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ult float %x, 255.0 ; X is NaN => true
|
||||
@ -249,7 +249,7 @@ define float @clamp_float_ordered_strict_maxmin2(float %x) {
|
||||
|
||||
; (X <= C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_ordered_nonstrict_maxmin1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_nonstrict_maxmin1(
|
||||
; CHECK-LABEL: @clamp_float_ordered_nonstrict_maxmin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ole float [[X]], 1.000000e+00
|
||||
@ -264,11 +264,11 @@ define float @clamp_float_ordered_nonstrict_maxmin1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_ordered_nonstrict_maxmin2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_nonstrict_maxmin2(
|
||||
; CHECK-LABEL: @clamp_float_ordered_nonstrict_maxmin2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ole float [[X]], 1.000000e+00
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[MIN]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ult float %x, 255.0 ; x is NaN => true
|
||||
@ -280,7 +280,7 @@ define float @clamp_float_ordered_nonstrict_maxmin2(float %x) {
|
||||
|
||||
; (X > C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_ordered_strict_minmax1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_strict_minmax1(
|
||||
; CHECK-LABEL: @clamp_float_ordered_strict_minmax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp ogt float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ogt float [[X]], 2.550000e+02
|
||||
@ -295,11 +295,11 @@ define float @clamp_float_ordered_strict_minmax1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_ordered_strict_minmax2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_strict_minmax2(
|
||||
; CHECK-LABEL: @clamp_float_ordered_strict_minmax2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp ole float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ogt float [[X]], 2.550000e+02
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ugt float %x, 1.0 ; x is NaN => true
|
||||
@ -311,7 +311,7 @@ define float @clamp_float_ordered_strict_minmax2(float %x) {
|
||||
|
||||
; (X >= C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_ordered_nonstrict_minmax1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_nonstrict_minmax1(
|
||||
; CHECK-LABEL: @clamp_float_ordered_nonstrict_minmax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp ogt float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp oge float [[X]], 2.550000e+02
|
||||
@ -326,11 +326,11 @@ define float @clamp_float_ordered_nonstrict_minmax1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_ordered_nonstrict_minmax2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_ordered_nonstrict_minmax2(
|
||||
; CHECK-LABEL: @clamp_float_ordered_nonstrict_minmax2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp ole float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp oge float [[X]], 2.550000e+02
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ugt float %x, 1.0 ; x is NaN => true
|
||||
@ -345,7 +345,7 @@ define float @clamp_float_ordered_nonstrict_minmax2(float %x) {
|
||||
|
||||
; (X < C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_unordered_strict_maxmin1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_strict_maxmin1(
|
||||
; CHECK-LABEL: @clamp_float_unordered_strict_maxmin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ult float [[X]], 1.000000e+00
|
||||
@ -360,11 +360,11 @@ define float @clamp_float_unordered_strict_maxmin1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_unordered_strict_maxmin2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_strict_maxmin2(
|
||||
; CHECK-LABEL: @clamp_float_unordered_strict_maxmin2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ult float [[X]], 1.000000e+00
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[MIN]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ult float %x, 255.0 ; x is NaN => true
|
||||
@ -376,7 +376,7 @@ define float @clamp_float_unordered_strict_maxmin2(float %x) {
|
||||
|
||||
; (X <= C1) ? C1 : MIN(X, C2)
|
||||
define float @clamp_float_unordered_nonstrict_maxmin1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_nonstrict_maxmin1(
|
||||
; CHECK-LABEL: @clamp_float_unordered_nonstrict_maxmin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp olt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ule float [[X]], 1.000000e+00
|
||||
@ -391,11 +391,11 @@ define float @clamp_float_unordered_nonstrict_maxmin1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_unordered_nonstrict_maxmin2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_nonstrict_maxmin2(
|
||||
; CHECK-LABEL: @clamp_float_unordered_nonstrict_maxmin2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp oge float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ule float [[X]], 1.000000e+00
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[MIN]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ult float %x, 255.0 ; x is NaN => true
|
||||
@ -407,7 +407,7 @@ define float @clamp_float_unordered_nonstrict_maxmin2(float %x) {
|
||||
|
||||
; (X > C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_unordered_strict_minmax1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_strict_minmax1(
|
||||
; CHECK-LABEL: @clamp_float_unordered_strict_minmax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp ogt float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ugt float [[X]], 2.550000e+02
|
||||
@ -422,11 +422,11 @@ define float @clamp_float_unordered_strict_minmax1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_unordered_strict_minmax2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_strict_minmax2(
|
||||
; CHECK-LABEL: @clamp_float_unordered_strict_minmax2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp ole float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp ugt float [[X]], 2.550000e+02
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ugt float %x, 1.0 ; x is NaN => true
|
||||
@ -438,7 +438,7 @@ define float @clamp_float_unordered_strict_minmax2(float %x) {
|
||||
|
||||
; (X >= C1) ? C1 : MAX(X, C2)
|
||||
define float @clamp_float_unordered_nonstrict_minmax1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_nonstrict_minmax1(
|
||||
; CHECK-LABEL: @clamp_float_unordered_nonstrict_minmax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = fcmp ogt float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp uge float [[X]], 2.550000e+02
|
||||
@ -453,11 +453,11 @@ define float @clamp_float_unordered_nonstrict_minmax1(float %x) {
|
||||
}
|
||||
|
||||
define float @clamp_float_unordered_nonstrict_minmax2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@clamp_float_unordered_nonstrict_minmax2(
|
||||
; CHECK-LABEL: @clamp_float_unordered_nonstrict_minmax2(
|
||||
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp ole float [[X:%.*]], 1.000000e+00
|
||||
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = fcmp uge float [[X]], 2.550000e+02
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[TMP1]]
|
||||
; CHECK-NEXT: ret float [[R]]
|
||||
;
|
||||
%cmp2 = fcmp ugt float %x, 1.0 ; x is NaN => true
|
||||
@ -469,7 +469,7 @@ define float @clamp_float_unordered_nonstrict_minmax2(float %x) {
|
||||
|
||||
;; Check casts behavior
|
||||
define float @ui32_clamp_and_cast_to_float(i32 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@ui32_clamp_and_cast_to_float(
|
||||
; CHECK-LABEL: @ui32_clamp_and_cast_to_float(
|
||||
; CHECK-NEXT: [[LO_CMP:%.*]] = icmp eq i32 [[X:%.*]], 0
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i32 [[X]], 255
|
||||
; CHECK-NEXT: [[MIN1:%.*]] = select i1 [[TMP1]], i32 [[X]], i32 255
|
||||
@ -486,7 +486,7 @@ define float @ui32_clamp_and_cast_to_float(i32 %x) {
|
||||
}
|
||||
|
||||
define float @ui64_clamp_and_cast_to_float(i64 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@ui64_clamp_and_cast_to_float(
|
||||
; CHECK-LABEL: @ui64_clamp_and_cast_to_float(
|
||||
; CHECK-NEXT: [[LO_CMP:%.*]] = icmp eq i64 [[X:%.*]], 0
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i64 [[X]], 255
|
||||
; CHECK-NEXT: [[MIN1:%.*]] = select i1 [[TMP1]], i64 [[X]], i64 255
|
||||
@ -503,7 +503,7 @@ define float @ui64_clamp_and_cast_to_float(i64 %x) {
|
||||
}
|
||||
|
||||
define float @mixed_clamp_to_float_1(i32 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@mixed_clamp_to_float_1(
|
||||
; CHECK-LABEL: @mixed_clamp_to_float_1(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[X:%.*]], 255
|
||||
; CHECK-NEXT: [[SI_MIN:%.*]] = select i1 [[TMP1]], i32 [[X]], i32 255
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[SI_MIN]], 1
|
||||
@ -521,7 +521,7 @@ define float @mixed_clamp_to_float_1(i32 %x) {
|
||||
}
|
||||
|
||||
define i32 @mixed_clamp_to_i32_1(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@mixed_clamp_to_i32_1(
|
||||
; CHECK-LABEL: @mixed_clamp_to_i32_1(
|
||||
; CHECK-NEXT: [[FLOAT_MIN_CMP:%.*]] = fcmp ogt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[FLOAT_MIN:%.*]] = select i1 [[FLOAT_MIN_CMP]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[I32_MIN:%.*]] = fptosi float [[FLOAT_MIN]] to i32
|
||||
@ -540,7 +540,7 @@ define i32 @mixed_clamp_to_i32_1(float %x) {
|
||||
}
|
||||
|
||||
define float @mixed_clamp_to_float_2(i32 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@mixed_clamp_to_float_2(
|
||||
; CHECK-LABEL: @mixed_clamp_to_float_2(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp slt i32 [[X:%.*]], 255
|
||||
; CHECK-NEXT: [[SI_MIN:%.*]] = select i1 [[TMP1]], i32 [[X]], i32 255
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = icmp sgt i32 [[SI_MIN]], 1
|
||||
@ -557,7 +557,7 @@ define float @mixed_clamp_to_float_2(i32 %x) {
|
||||
}
|
||||
|
||||
define i32 @mixed_clamp_to_i32_2(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@mixed_clamp_to_i32_2(
|
||||
; CHECK-LABEL: @mixed_clamp_to_i32_2(
|
||||
; CHECK-NEXT: [[FLOAT_MIN_CMP:%.*]] = fcmp ogt float [[X:%.*]], 2.550000e+02
|
||||
; CHECK-NEXT: [[FLOAT_MIN:%.*]] = select i1 [[FLOAT_MIN_CMP]], float 2.550000e+02, float [[X]]
|
||||
; CHECK-NEXT: [[I32_MIN:%.*]] = fptosi float [[FLOAT_MIN]] to i32
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
; This is the canonical form for a type-changing min/max.
|
||||
define double @t1(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t1(
|
||||
; CHECK-LABEL: @t1(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 5.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 5.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
|
||||
@ -17,7 +17,7 @@ define double @t1(float %a) {
|
||||
|
||||
; Check this is converted into canonical form, as above.
|
||||
define double @t2(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t2(
|
||||
; CHECK-LABEL: @t2(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 5.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 5.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
|
||||
@ -31,7 +31,7 @@ define double @t2(float %a) {
|
||||
|
||||
; Same again, with trunc.
|
||||
define float @t4(double %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t4(
|
||||
; CHECK-LABEL: @t4(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge double [[A:%.*]], 5.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], double 5.000000e+00, double [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptrunc double [[TMP1]] to float
|
||||
@ -45,7 +45,7 @@ define float @t4(double %a) {
|
||||
|
||||
; different values, should not be converted.
|
||||
define double @t5(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t5(
|
||||
; CHECK-LABEL: @t5(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ult float [[A:%.*]], 5.000000e+00
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[A]] to double
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = select i1 [[TMP1]], double [[TMP2]], double 5.001000e+00
|
||||
@ -61,7 +61,7 @@ define double @t5(float %a) {
|
||||
; So the compare constant may be treated as +0.0, and we sink the fpext.
|
||||
|
||||
define double @t6(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t6(
|
||||
; CHECK-LABEL: @t6(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 0.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
|
||||
@ -77,7 +77,7 @@ define double @t6(float %a) {
|
||||
; So the compare constant may be treated as -0.0, and we sink the fpext.
|
||||
|
||||
define double @t7(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t7(
|
||||
; CHECK-LABEL: @t7(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float -0.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
|
||||
@ -92,7 +92,7 @@ define double @t7(float %a) {
|
||||
; min(min(x, 0.0), 0.0) --> min(x, 0.0)
|
||||
|
||||
define float @fmin_fmin_zero_mismatch(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@fmin_fmin_zero_mismatch(
|
||||
; CHECK-LABEL: @fmin_fmin_zero_mismatch(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fcmp olt float [[X:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[MIN2:%.*]] = select i1 [[TMP1]], float [[X]], float 0.000000e+00
|
||||
; CHECK-NEXT: ret float [[MIN2]]
|
||||
@ -107,7 +107,7 @@ define float @fmin_fmin_zero_mismatch(float %x) {
|
||||
; max(max(x, -0.0), -0.0) --> max(x, -0.0)
|
||||
|
||||
define float @fmax_fmax_zero_mismatch(float %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@fmax_fmax_zero_mismatch(
|
||||
; CHECK-LABEL: @fmax_fmax_zero_mismatch(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ogt float [[X:%.*]], -0.000000e+00
|
||||
; CHECK-NEXT: [[MAX11:%.*]] = select i1 [[TMP1]], float [[X]], float -0.000000e+00
|
||||
; CHECK-NEXT: ret float [[MAX11]]
|
||||
@ -120,7 +120,7 @@ define float @fmax_fmax_zero_mismatch(float %x) {
|
||||
}
|
||||
|
||||
define i64 @t8(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t8(
|
||||
; CHECK-LABEL: @t8(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 5.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 5.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptoui float [[TMP1]] to i64
|
||||
@ -133,7 +133,7 @@ define i64 @t8(float %a) {
|
||||
}
|
||||
|
||||
define i8 @t9(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t9(
|
||||
; CHECK-LABEL: @t9(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 0.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
|
||||
@ -147,7 +147,7 @@ define i8 @t9(float %a) {
|
||||
|
||||
; Either operand could be NaN, but fast modifier applied.
|
||||
define i8 @t11(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t11(
|
||||
; CHECK-LABEL: @t11(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[B:%.*]], [[A:%.*]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[DOTINV]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
|
||||
@ -162,7 +162,7 @@ define i8 @t11(float %a, float %b) {
|
||||
|
||||
; Either operand could be NaN, but nnan modifier applied.
|
||||
define i8 @t12(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t12(
|
||||
; CHECK-LABEL: @t12(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp nnan oge float [[B:%.*]], [[A:%.*]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select nnan i1 [[DOTINV]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
|
||||
@ -177,7 +177,7 @@ define i8 @t12(float %a, float %b) {
|
||||
|
||||
; Float and int values do not match.
|
||||
define i8 @t13(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t13(
|
||||
; CHECK-LABEL: @t13(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ult float [[A:%.*]], 1.500000e+00
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[A]] to i8
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = select i1 [[TMP1]], i8 [[TMP2]], i8 1
|
||||
@ -191,7 +191,7 @@ define i8 @t13(float %a) {
|
||||
|
||||
; %a could be -0.0, but it doesn't matter because the conversion to int is the same for 0.0 or -0.0.
|
||||
define i8 @t14(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t14(
|
||||
; CHECK-LABEL: @t14(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 0.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
|
||||
@ -204,7 +204,7 @@ define i8 @t14(float %a) {
|
||||
}
|
||||
|
||||
define i8 @t14_commute(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t14_commute(
|
||||
; CHECK-LABEL: @t14_commute(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ogt float [[A:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP1]], float [[A]], float 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP3:%.*]] = fptosi float [[TMP2]] to i8
|
||||
@ -217,7 +217,7 @@ define i8 @t14_commute(float %a) {
|
||||
}
|
||||
|
||||
define i8 @t15(float %a) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t15(
|
||||
; CHECK-LABEL: @t15(
|
||||
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp nsz oge float [[A:%.*]], 0.000000e+00
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select nsz i1 [[DOTINV]], float 0.000000e+00, float [[A]]
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
|
||||
@ -230,7 +230,7 @@ define i8 @t15(float %a) {
|
||||
}
|
||||
|
||||
define double @t16(i32 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t16(
|
||||
; CHECK-LABEL: @t16(
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], 0
|
||||
; CHECK-NEXT: [[CST:%.*]] = sitofp i32 [[X]] to double
|
||||
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], double [[CST]], double 5.000000e-01
|
||||
@ -243,7 +243,7 @@ define double @t16(i32 %x) {
|
||||
}
|
||||
|
||||
define double @t17(i32 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@t17(
|
||||
; CHECK-LABEL: @t17(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 [[X:%.*]], 2
|
||||
; CHECK-NEXT: [[SEL1:%.*]] = select i1 [[TMP1]], i32 [[X]], i32 2
|
||||
; CHECK-NEXT: [[TMP2:%.*]] = sitofp i32 [[SEL1]] to double
|
||||
@ -256,7 +256,7 @@ define double @t17(i32 %x) {
|
||||
}
|
||||
|
||||
define float @fneg_fmax(float %x, float %y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@fneg_fmax(
|
||||
; CHECK-LABEL: @fneg_fmax(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan olt float [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: [[MAX_V:%.*]] = select i1 [[COND]], float [[X]], float [[Y]]
|
||||
; CHECK-NEXT: [[MAX:%.*]] = fneg float [[MAX_V]]
|
||||
@ -270,7 +270,7 @@ define float @fneg_fmax(float %x, float %y) {
|
||||
}
|
||||
|
||||
define <2 x float> @fsub_fmax(<2 x float> %x, <2 x float> %y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@fsub_fmax(
|
||||
; CHECK-LABEL: @fsub_fmax(
|
||||
; CHECK-NEXT: [[COND_INV:%.*]] = fcmp nnan nsz ogt <2 x float> [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select nnan nsz <2 x i1> [[COND_INV]], <2 x float> [[Y]], <2 x float> [[X]]
|
||||
; CHECK-NEXT: [[MAX:%.*]] = fneg <2 x float> [[TMP1]]
|
||||
@ -284,7 +284,7 @@ define <2 x float> @fsub_fmax(<2 x float> %x, <2 x float> %y) {
|
||||
}
|
||||
|
||||
define <2 x double> @fsub_fmin(<2 x double> %x, <2 x double> %y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@fsub_fmin(
|
||||
; CHECK-LABEL: @fsub_fmin(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan ogt <2 x double> [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: [[MAX_V:%.*]] = select <2 x i1> [[COND]], <2 x double> [[X]], <2 x double> [[Y]]
|
||||
; CHECK-NEXT: [[MAX:%.*]] = fneg <2 x double> [[MAX_V]]
|
||||
@ -298,7 +298,7 @@ define <2 x double> @fsub_fmin(<2 x double> %x, <2 x double> %y) {
|
||||
}
|
||||
|
||||
define double @fneg_fmin(double %x, double %y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@fneg_fmin(
|
||||
; CHECK-LABEL: @fneg_fmin(
|
||||
; CHECK-NEXT: [[COND_INV:%.*]] = fcmp nnan nsz olt double [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = select nnan nsz i1 [[COND_INV]], double [[Y]], double [[X]]
|
||||
; CHECK-NEXT: [[MAX:%.*]] = fneg double [[TMP1]]
|
||||
@ -312,7 +312,7 @@ define double @fneg_fmin(double %x, double %y) {
|
||||
}
|
||||
|
||||
define float @maxnum_ogt_fmf_on_select(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@maxnum_ogt_fmf_on_select(
|
||||
; CHECK-LABEL: @maxnum_ogt_fmf_on_select(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call nnan nsz float @llvm.maxnum.f32(float [[A:%.*]], float [[B:%.*]])
|
||||
; CHECK-NEXT: ret float [[TMP1]]
|
||||
;
|
||||
@ -322,7 +322,7 @@ define float @maxnum_ogt_fmf_on_select(float %a, float %b) {
|
||||
}
|
||||
|
||||
define <2 x float> @maxnum_oge_fmf_on_select(<2 x float> %a, <2 x float> %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@maxnum_oge_fmf_on_select(
|
||||
; CHECK-LABEL: @maxnum_oge_fmf_on_select(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf nsz <2 x float> @llvm.maxnum.v2f32(<2 x float> [[A:%.*]], <2 x float> [[B:%.*]])
|
||||
; CHECK-NEXT: ret <2 x float> [[TMP1]]
|
||||
;
|
||||
@ -332,7 +332,7 @@ define <2 x float> @maxnum_oge_fmf_on_select(<2 x float> %a, <2 x float> %b) {
|
||||
}
|
||||
|
||||
define float @maxnum_ogt_fmf_on_fcmp(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@maxnum_ogt_fmf_on_fcmp(
|
||||
; CHECK-LABEL: @maxnum_ogt_fmf_on_fcmp(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan nsz ogt float [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select i1 [[COND]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: ret float [[F]]
|
||||
@ -343,7 +343,7 @@ define float @maxnum_ogt_fmf_on_fcmp(float %a, float %b) {
|
||||
}
|
||||
|
||||
define <2 x float> @maxnum_oge_fmf_on_fcmp(<2 x float> %a, <2 x float> %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@maxnum_oge_fmf_on_fcmp(
|
||||
; CHECK-LABEL: @maxnum_oge_fmf_on_fcmp(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan ninf nsz oge <2 x float> [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select <2 x i1> [[COND]], <2 x float> [[A]], <2 x float> [[B]]
|
||||
; CHECK-NEXT: ret <2 x float> [[F]]
|
||||
@ -354,7 +354,7 @@ define <2 x float> @maxnum_oge_fmf_on_fcmp(<2 x float> %a, <2 x float> %b) {
|
||||
}
|
||||
|
||||
define float @maxnum_no_nsz(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@maxnum_no_nsz(
|
||||
; CHECK-LABEL: @maxnum_no_nsz(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp ogt float [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select nnan i1 [[COND]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: ret float [[F]]
|
||||
@ -365,7 +365,7 @@ define float @maxnum_no_nsz(float %a, float %b) {
|
||||
}
|
||||
|
||||
define float @maxnum_no_nnan(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@maxnum_no_nnan(
|
||||
; CHECK-LABEL: @maxnum_no_nnan(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp oge float [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select nsz i1 [[COND]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: ret float [[F]]
|
||||
@ -376,7 +376,7 @@ define float @maxnum_no_nnan(float %a, float %b) {
|
||||
}
|
||||
|
||||
define float @minnum_olt_fmf_on_select(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@minnum_olt_fmf_on_select(
|
||||
; CHECK-LABEL: @minnum_olt_fmf_on_select(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call nnan nsz float @llvm.minnum.f32(float [[A:%.*]], float [[B:%.*]])
|
||||
; CHECK-NEXT: ret float [[TMP1]]
|
||||
;
|
||||
@ -386,7 +386,7 @@ define float @minnum_olt_fmf_on_select(float %a, float %b) {
|
||||
}
|
||||
|
||||
define <2 x float> @minnum_ole_fmf_on_select(<2 x float> %a, <2 x float> %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@minnum_ole_fmf_on_select(
|
||||
; CHECK-LABEL: @minnum_ole_fmf_on_select(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf nsz <2 x float> @llvm.minnum.v2f32(<2 x float> [[A:%.*]], <2 x float> [[B:%.*]])
|
||||
; CHECK-NEXT: ret <2 x float> [[TMP1]]
|
||||
;
|
||||
@ -396,7 +396,7 @@ define <2 x float> @minnum_ole_fmf_on_select(<2 x float> %a, <2 x float> %b) {
|
||||
}
|
||||
|
||||
define float @minnum_olt_fmf_on_fcmp(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@minnum_olt_fmf_on_fcmp(
|
||||
; CHECK-LABEL: @minnum_olt_fmf_on_fcmp(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan nsz olt float [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select i1 [[COND]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: ret float [[F]]
|
||||
@ -407,7 +407,7 @@ define float @minnum_olt_fmf_on_fcmp(float %a, float %b) {
|
||||
}
|
||||
|
||||
define <2 x float> @minnum_ole_fmf_on_fcmp(<2 x float> %a, <2 x float> %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@minnum_ole_fmf_on_fcmp(
|
||||
; CHECK-LABEL: @minnum_ole_fmf_on_fcmp(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan ninf nsz ole <2 x float> [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select <2 x i1> [[COND]], <2 x float> [[A]], <2 x float> [[B]]
|
||||
; CHECK-NEXT: ret <2 x float> [[F]]
|
||||
@ -418,7 +418,7 @@ define <2 x float> @minnum_ole_fmf_on_fcmp(<2 x float> %a, <2 x float> %b) {
|
||||
}
|
||||
|
||||
define float @minnum_no_nsz(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@minnum_no_nsz(
|
||||
; CHECK-LABEL: @minnum_no_nsz(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp olt float [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select nnan i1 [[COND]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: ret float [[F]]
|
||||
@ -429,7 +429,7 @@ define float @minnum_no_nsz(float %a, float %b) {
|
||||
}
|
||||
|
||||
define float @minnum_no_nnan(float %a, float %b) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@minnum_no_nnan(
|
||||
; CHECK-LABEL: @minnum_no_nnan(
|
||||
; CHECK-NEXT: [[COND:%.*]] = fcmp ole float [[A:%.*]], [[B:%.*]]
|
||||
; CHECK-NEXT: [[F:%.*]] = select nsz i1 [[COND]], float [[A]], float [[B]]
|
||||
; CHECK-NEXT: ret float [[F]]
|
||||
|
@ -1,11 +1,27 @@
|
||||
; do not replace a 'select' with 'or' in 'select - cmp - br' sequence
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -instcombine -S < %s | FileCheck %s
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
declare void @f(i32)
|
||||
|
||||
; Do not replace a 'select' with 'or' in 'select - cmp - br' sequence
|
||||
define void @test(i32 %len) {
|
||||
; CHECK-LABEL: @test(
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[LEN:%.*]], 8
|
||||
; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i32 [[LEN]], i32 8
|
||||
; CHECK-NEXT: [[CMP11_NOT:%.*]] = icmp eq i32 [[COND]], 0
|
||||
; CHECK-NEXT: br i1 [[CMP11_NOT]], label [[FOR_END:%.*]], label [[FOR_BODY:%.*]]
|
||||
; CHECK: for.body:
|
||||
; CHECK-NEXT: [[I_02:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[ENTRY:%.*]] ]
|
||||
; CHECK-NEXT: tail call void @f(i32 [[COND]])
|
||||
; CHECK-NEXT: [[INC]] = add i32 [[I_02]], 1
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[INC]], [[COND]]
|
||||
; CHECK-NEXT: br i1 [[CMP1]], label [[FOR_BODY]], label [[FOR_END]]
|
||||
; CHECK: for.end:
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
entry:
|
||||
%cmp = icmp ult i32 %len, 8
|
||||
%cond = select i1 %cmp, i32 %len, i32 8
|
||||
@ -21,5 +37,4 @@ for.body: ; preds = %entry, %for.body
|
||||
|
||||
for.end: ; preds = %for.body, %entry
|
||||
ret void
|
||||
; CHECK: select
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||||
|
||||
; Instcombine normally would fold the sdiv into the comparison,
|
||||
@ -7,26 +8,27 @@
|
||||
; other analyses wouldn't recognize it.
|
||||
|
||||
define i32 @foo(i32 %h) {
|
||||
; CHECK-LABEL: @foo(
|
||||
; CHECK-NEXT: [[SD:%.*]] = sdiv i32 [[H:%.*]], 2
|
||||
; CHECK-NEXT: [[T:%.*]] = icmp slt i32 [[SD]], 1
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[T]], i32 [[SD]], i32 1
|
||||
; CHECK-NEXT: ret i32 [[R]]
|
||||
;
|
||||
%sd = sdiv i32 %h, 2
|
||||
%t = icmp slt i32 %sd, 1
|
||||
%r = select i1 %t, i32 %sd, i32 1
|
||||
ret i32 %r
|
||||
}
|
||||
|
||||
; CHECK: %sd = sdiv i32 %h, 2
|
||||
; CHECK: %t = icmp slt i32 %sd, 1
|
||||
; CHECK: %r = select i1 %t, i32 %sd, i32 1
|
||||
; CHECK: ret i32 %r
|
||||
|
||||
define i32 @bar(i32 %h) {
|
||||
; CHECK-LABEL: @bar(
|
||||
; CHECK-NEXT: [[SD:%.*]] = sdiv i32 [[H:%.*]], 2
|
||||
; CHECK-NEXT: [[T:%.*]] = icmp sgt i32 [[SD]], 1
|
||||
; CHECK-NEXT: [[R:%.*]] = select i1 [[T]], i32 [[SD]], i32 1
|
||||
; CHECK-NEXT: ret i32 [[R]]
|
||||
;
|
||||
%sd = sdiv i32 %h, 2
|
||||
%t = icmp sgt i32 %sd, 1
|
||||
%r = select i1 %t, i32 %sd, i32 1
|
||||
ret i32 %r
|
||||
}
|
||||
|
||||
; CHECK: %sd = sdiv i32 %h, 2
|
||||
; CHECK: %t = icmp sgt i32 %sd, 1
|
||||
; CHECK: %r = select i1 %t, i32 %sd, i32 1
|
||||
; CHECK: ret i32 %r
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
define i1 @eq_smax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %x, %y
|
||||
@ -25,7 +25,7 @@ define i1 @eq_smax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_smax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smax2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %y, %x
|
||||
@ -38,8 +38,8 @@ define i1 @eq_smax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_smax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -53,8 +53,8 @@ define i1 @eq_smax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @eq_smax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -68,7 +68,7 @@ define i1 @eq_smax4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @sle_smax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @sle_smax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %x, %y
|
||||
@ -81,7 +81,7 @@ define i1 @sle_smax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @sle_smax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @sle_smax2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %y, %x
|
||||
@ -94,8 +94,8 @@ define i1 @sle_smax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @sle_smax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @sle_smax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -109,8 +109,8 @@ define i1 @sle_smax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @sle_smax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @sle_smax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -124,7 +124,7 @@ define i1 @sle_smax4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_smax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %x, %y
|
||||
@ -137,7 +137,7 @@ define i1 @ne_smax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_smax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smax2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %y, %x
|
||||
@ -150,8 +150,8 @@ define i1 @ne_smax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_smax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -165,8 +165,8 @@ define i1 @ne_smax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_smax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -180,7 +180,7 @@ define i1 @ne_smax4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @sgt_smax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @sgt_smax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %x, %y
|
||||
@ -193,7 +193,7 @@ define i1 @sgt_smax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @sgt_smax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @sgt_smax2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp sgt i32 %y, %x
|
||||
@ -206,8 +206,8 @@ define i1 @sgt_smax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @sgt_smax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @sgt_smax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -221,8 +221,8 @@ define i1 @sgt_smax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @sgt_smax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @sgt_smax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
define i1 @eq_smin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %x, %y
|
||||
@ -24,7 +24,7 @@ define i1 @eq_smin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_smin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smin2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %y, %x
|
||||
@ -37,8 +37,8 @@ define i1 @eq_smin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_smin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -52,8 +52,8 @@ define i1 @eq_smin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @eq_smin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_smin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -67,7 +67,7 @@ define i1 @eq_smin4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @sge_smin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @sge_smin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %x, %y
|
||||
@ -80,7 +80,7 @@ define i1 @sge_smin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @sge_smin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @sge_smin2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %y, %x
|
||||
@ -93,8 +93,8 @@ define i1 @sge_smin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @sge_smin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @sge_smin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -108,8 +108,8 @@ define i1 @sge_smin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @sge_smin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @sge_smin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sle i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -123,7 +123,7 @@ define i1 @sge_smin4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_smin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %x, %y
|
||||
@ -136,7 +136,7 @@ define i1 @ne_smin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_smin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smin2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %y, %x
|
||||
@ -149,8 +149,8 @@ define i1 @ne_smin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_smin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -164,8 +164,8 @@ define i1 @ne_smin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_smin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_smin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -179,7 +179,7 @@ define i1 @ne_smin4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @slt_smin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @slt_smin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %x, %y
|
||||
@ -192,7 +192,7 @@ define i1 @slt_smin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @slt_smin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @slt_smin2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp slt i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp slt i32 %y, %x
|
||||
@ -205,8 +205,8 @@ define i1 @slt_smin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @slt_smin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @slt_smin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -220,8 +220,8 @@ define i1 @slt_smin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @slt_smin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @slt_smin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
define i1 @eq_umax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %x, %y
|
||||
@ -25,7 +25,7 @@ define i1 @eq_umax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_umax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umax2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %y, %x
|
||||
@ -38,8 +38,8 @@ define i1 @eq_umax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_umax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -53,8 +53,8 @@ define i1 @eq_umax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @eq_umax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -68,7 +68,7 @@ define i1 @eq_umax4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ule_umax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ule_umax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %x, %y
|
||||
@ -81,7 +81,7 @@ define i1 @ule_umax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ule_umax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ule_umax2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %y, %x
|
||||
@ -94,8 +94,8 @@ define i1 @ule_umax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ule_umax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ule_umax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -109,8 +109,8 @@ define i1 @ule_umax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ule_umax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ule_umax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp uge i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -124,7 +124,7 @@ define i1 @ule_umax4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_umax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %x, %y
|
||||
@ -137,7 +137,7 @@ define i1 @ne_umax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_umax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umax2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %y, %x
|
||||
@ -150,8 +150,8 @@ define i1 @ne_umax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_umax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -165,8 +165,8 @@ define i1 @ne_umax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_umax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -180,7 +180,7 @@ define i1 @ne_umax4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ugt_umax1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ugt_umax1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %x, %y
|
||||
@ -193,7 +193,7 @@ define i1 @ugt_umax1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ugt_umax2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ugt_umax2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp ugt i32 %y, %x
|
||||
@ -206,8 +206,8 @@ define i1 @ugt_umax2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ugt_umax3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ugt_umax3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -221,8 +221,8 @@ define i1 @ugt_umax3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ugt_umax4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ugt_umax4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
define i1 @eq_umin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %x, %y
|
||||
@ -25,7 +25,7 @@ define i1 @eq_umin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_umin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umin2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %y, %x
|
||||
@ -38,8 +38,8 @@ define i1 @eq_umin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @eq_umin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -53,8 +53,8 @@ define i1 @eq_umin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @eq_umin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @eq_umin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -68,7 +68,7 @@ define i1 @eq_umin4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @uge_umin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @uge_umin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %x, %y
|
||||
@ -81,7 +81,7 @@ define i1 @uge_umin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @uge_umin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @uge_umin2(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %y, %x
|
||||
@ -94,8 +94,8 @@ define i1 @uge_umin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @uge_umin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @uge_umin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -109,8 +109,8 @@ define i1 @uge_umin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @uge_umin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @uge_umin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ule i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -124,7 +124,7 @@ define i1 @uge_umin4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_umin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %x, %y
|
||||
@ -137,7 +137,7 @@ define i1 @ne_umin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_umin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umin2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %y, %x
|
||||
@ -150,8 +150,8 @@ define i1 @ne_umin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ne_umin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -165,8 +165,8 @@ define i1 @ne_umin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ne_umin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ne_umin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -180,7 +180,7 @@ define i1 @ne_umin4(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ult_umin1(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ult_umin1(
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 %x, %y
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %x, %y
|
||||
@ -193,7 +193,7 @@ define i1 @ult_umin1(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ult_umin2(i32 %x, i32 %y) {
|
||||
; CHECK-LABEL: @ult_umin2(
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 %y, %x
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ult i32 [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%cmp1 = icmp ult i32 %y, %x
|
||||
@ -206,8 +206,8 @@ define i1 @ult_umin2(i32 %x, i32 %y) {
|
||||
|
||||
define i1 @ult_umin3(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ult_umin3(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP2]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
@ -221,8 +221,8 @@ define i1 @ult_umin3(i32 %a, i32 %y) {
|
||||
|
||||
define i1 @ult_umin4(i32 %a, i32 %y) {
|
||||
; CHECK-LABEL: @ult_umin4(
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 %a, 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 [[X]], %y
|
||||
; CHECK-NEXT: [[X:%.*]] = add i32 [[A:%.*]], 3
|
||||
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i32 [[X]], [[Y:%.*]]
|
||||
; CHECK-NEXT: ret i1 [[CMP1]]
|
||||
;
|
||||
%x = add i32 %a, 3 ; thwart complexity-based canonicalization
|
||||
|
Loading…
Reference in New Issue
Block a user