@@ -83,7 +83,7 @@ define float @clamp_float_fast_unordered_strict_maxmin(float %x) {
8383; (X <= C1) ? C1 : MIN(X, C2)
8484define float @clamp_float_fast_unordered_nonstrict_maxmin (float %x ) {
8585; CHECK-LABEL: @clamp_float_fast_unordered_nonstrict_maxmin(
86- ; CHECK-NEXT: [[MIN:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
86+ ; CHECK-NEXT: [[MIN:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
8787; CHECK-NEXT: [[CMP1:%.*]] = fcmp fast ule float [[X]], 1.000000e+00
8888; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 1.000000e+00, float [[MIN]]
8989; CHECK-NEXT: ret float [[R]]
@@ -98,7 +98,7 @@ define float @clamp_float_fast_unordered_nonstrict_maxmin(float %x) {
9898; (X > C1) ? C1 : MAX(X, C2)
9999define float @clamp_float_fast_unordered_strict_minmax (float %x ) {
100100; CHECK-LABEL: @clamp_float_fast_unordered_strict_minmax(
101- ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
101+ ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
102102; CHECK-NEXT: [[CMP1:%.*]] = fcmp fast ugt float [[X]], 2.550000e+02
103103; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
104104; CHECK-NEXT: ret float [[R]]
@@ -113,7 +113,7 @@ define float @clamp_float_fast_unordered_strict_minmax(float %x) {
113113; (X >= C1) ? C1 : MAX(X, C2)
114114define float @clamp_float_fast_unordered_nonstrict_minmax (float %x ) {
115115; CHECK-LABEL: @clamp_float_fast_unordered_nonstrict_minmax(
116- ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
116+ ; CHECK-NEXT: [[MAX:%.*]] = call fast float @llvm.maxnum.f32(float [[X:%.*]], float 1.000000e+00)
117117; CHECK-NEXT: [[CMP1:%.*]] = fcmp fast uge float [[X]], 2.550000e+02
118118; CHECK-NEXT: [[R:%.*]] = select i1 [[CMP1]], float 2.550000e+02, float [[MAX]]
119119; CHECK-NEXT: ret float [[R]]
@@ -147,7 +147,7 @@ define float @clamp_test_1(float %x) {
147147; Like @clamp_test_1 but HighConst < LowConst
148148define float @clamp_negative_wrong_const (float %x ) {
149149; CHECK-LABEL: @clamp_negative_wrong_const(
150- ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
150+ ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
151151; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ugt float [[X]], 5.120000e+02
152152; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[INNER_SEL]], float 5.120000e+02
153153; CHECK-NEXT: ret float [[R]]
@@ -162,7 +162,7 @@ define float @clamp_negative_wrong_const(float %x) {
162162; Like @clamp_test_1 but both are min
163163define float @clamp_negative_same_op (float %x ) {
164164; CHECK-LABEL: @clamp_negative_same_op(
165- ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
165+ ; CHECK-NEXT: [[INNER_SEL:%.*]] = call fast float @llvm.minnum.f32(float [[X:%.*]], float 2.550000e+02)
166166; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ult float [[X]], 1.000000e+00
167167; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[INNER_SEL]], float 1.000000e+00
168168; CHECK-NEXT: ret float [[R]]
@@ -500,9 +500,9 @@ define float @ui64_clamp_and_cast_to_float(i64 %x) {
500500
501501define float @mixed_clamp_to_float_1 (i32 %x ) {
502502; CHECK-LABEL: @mixed_clamp_to_float_1(
503- ; CHECK-NEXT: [[SI_MIN :%.*]] = call i32 @llvm.smin .i32(i32 [[X :%.*]], i32 255 )
504- ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN ]], i32 1 )
505- ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R1 ]] to float
503+ ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN :%.*]], i32 1 )
504+ ; CHECK-NEXT: [[R2 :%.*]] = call i32 @llvm.smin .i32(i32 [[R1 ]], i32 255 )
505+ ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R2 ]] to float
506506; CHECK-NEXT: ret float [[R]]
507507;
508508 %si_min_cmp = icmp sgt i32 %x , 255
@@ -535,9 +535,9 @@ define i32 @mixed_clamp_to_i32_1(float %x) {
535535
536536define float @mixed_clamp_to_float_2 (i32 %x ) {
537537; CHECK-LABEL: @mixed_clamp_to_float_2(
538- ; CHECK-NEXT: [[SI_MIN :%.*]] = call i32 @llvm.smin .i32(i32 [[X :%.*]], i32 255 )
539- ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN ]], i32 1 )
540- ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R1 ]] to float
538+ ; CHECK-NEXT: [[R1 :%.*]] = call i32 @llvm.smax .i32(i32 [[SI_MIN :%.*]], i32 1 )
539+ ; CHECK-NEXT: [[R2 :%.*]] = call i32 @llvm.smin .i32(i32 [[R1 ]], i32 255 )
540+ ; CHECK-NEXT: [[R:%.*]] = uitofp nneg i32 [[R2 ]] to float
541541; CHECK-NEXT: ret float [[R]]
542542;
543543 %si_min_cmp = icmp sgt i32 %x , 255
@@ -568,9 +568,9 @@ define i32 @mixed_clamp_to_i32_2(float %x) {
568568
569569define <2 x float > @mixed_clamp_to_float_vec (<2 x i32 > %x ) {
570570; CHECK-LABEL: @mixed_clamp_to_float_vec(
571- ; CHECK-NEXT: [[SI_MIN :%.*]] = call <2 x i32> @llvm.smin .v2i32(<2 x i32> [[X :%.*]], <2 x i32> splat (i32 255 ))
572- ; CHECK-NEXT: [[R1 :%.*]] = call <2 x i32> @llvm.smax .v2i32(<2 x i32> [[SI_MIN ]], <2 x i32> splat (i32 1 ))
573- ; CHECK-NEXT: [[R:%.*]] = uitofp nneg <2 x i32> [[R1 ]] to <2 x float>
571+ ; CHECK-NEXT: [[R1 :%.*]] = call <2 x i32> @llvm.smax .v2i32(<2 x i32> [[SI_MIN :%.*]], <2 x i32> splat (i32 1 ))
572+ ; CHECK-NEXT: [[R2 :%.*]] = call <2 x i32> @llvm.smin .v2i32(<2 x i32> [[R1 ]], <2 x i32> splat (i32 255 ))
573+ ; CHECK-NEXT: [[R:%.*]] = uitofp nneg <2 x i32> [[R2 ]] to <2 x float>
574574; CHECK-NEXT: ret <2 x float> [[R]]
575575;
576576 %si_min_cmp = icmp sgt <2 x i32 > %x , <i32 255 , i32 255 >
0 commit comments