@@ -6,9 +6,8 @@ define float @clamp_float_fast_ordered_strict_maxmin(float %x) {
6
6
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_strict_maxmin(
7
7
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast olt float [[X:%.*]], 2.550000e+02
8
8
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
9
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[MIN]], 1.000000e+00
10
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MIN]], float 1.000000e+00
11
- ; CHECK-NEXT: ret float [[R1]]
9
+ ; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.maxnum.f32(float [[MIN]], float 1.000000e+00)
10
+ ; CHECK-NEXT: ret float [[TMP1]]
12
11
;
13
12
%cmp2 = fcmp fast olt float %x , 255 .0
14
13
%min = select i1 %cmp2 , float %x , float 255 .0
@@ -22,9 +21,8 @@ define float @clamp_float_fast_ordered_nonstrict_maxmin(float %x) {
22
21
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_nonstrict_maxmin(
23
22
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast olt float [[X:%.*]], 2.550000e+02
24
23
; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2]], float [[X]], float 2.550000e+02
25
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[MIN]], 1.000000e+00
26
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MIN]], float 1.000000e+00
27
- ; CHECK-NEXT: ret float [[R1]]
24
+ ; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.maxnum.f32(float [[MIN]], float 1.000000e+00)
25
+ ; CHECK-NEXT: ret float [[TMP1]]
28
26
;
29
27
%cmp2 = fcmp fast olt float %x , 255 .0
30
28
%min = select i1 %cmp2 , float %x , float 255 .0
@@ -38,9 +36,8 @@ define float @clamp_float_fast_ordered_strict_minmax(float %x) {
38
36
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_strict_minmax(
39
37
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast ogt float [[X:%.*]], 1.000000e+00
40
38
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
41
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast ole float [[MAX]], 2.550000e+02
42
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MAX]], float 2.550000e+02
43
- ; CHECK-NEXT: ret float [[R1]]
39
+ ; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.minnum.f32(float [[MAX]], float 2.550000e+02)
40
+ ; CHECK-NEXT: ret float [[TMP1]]
44
41
;
45
42
%cmp2 = fcmp fast ogt float %x , 1 .0
46
43
%max = select i1 %cmp2 , float %x , float 1 .0
@@ -54,9 +51,8 @@ define float @clamp_float_fast_ordered_nonstrict_minmax(float %x) {
54
51
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_ordered_nonstrict_minmax(
55
52
; CHECK-NEXT: [[CMP2:%.*]] = fcmp fast ogt float [[X:%.*]], 1.000000e+00
56
53
; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2]], float [[X]], float 1.000000e+00
57
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast ole float [[MAX]], 2.550000e+02
58
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MAX]], float 2.550000e+02
59
- ; CHECK-NEXT: ret float [[R1]]
54
+ ; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.minnum.f32(float [[MAX]], float 2.550000e+02)
55
+ ; CHECK-NEXT: ret float [[TMP1]]
60
56
;
61
57
%cmp2 = fcmp fast ogt float %x , 1 .0
62
58
%max = select i1 %cmp2 , float %x , float 1 .0
@@ -72,10 +68,9 @@ define float @clamp_float_fast_ordered_nonstrict_minmax(float %x) {
72
68
define float @clamp_float_fast_unordered_strict_maxmin (float %x ) {
73
69
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_strict_maxmin(
74
70
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
75
- ; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
76
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[MIN]], 1.000000e+00
77
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MIN]], float 1.000000e+00
78
- ; CHECK-NEXT: ret float [[R1]]
71
+ ; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
72
+ ; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.maxnum.f32(float [[TMP1]], float 1.000000e+00)
73
+ ; CHECK-NEXT: ret float [[TMP2]]
79
74
;
80
75
%cmp2 = fcmp fast ult float %x , 255 .0
81
76
%min = select i1 %cmp2 , float %x , float 255 .0
@@ -88,10 +83,9 @@ define float @clamp_float_fast_unordered_strict_maxmin(float %x) {
88
83
define float @clamp_float_fast_unordered_nonstrict_maxmin (float %x ) {
89
84
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_nonstrict_maxmin(
90
85
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
91
- ; CHECK-NEXT: [[MIN:%.*]] = select i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
92
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[MIN]], 1.000000e+00
93
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MIN]], float 1.000000e+00
94
- ; CHECK-NEXT: ret float [[R1]]
86
+ ; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 2.550000e+02, float [[X]]
87
+ ; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.maxnum.f32(float [[TMP1]], float 1.000000e+00)
88
+ ; CHECK-NEXT: ret float [[TMP2]]
95
89
;
96
90
%cmp2 = fcmp fast ult float %x , 255 .0
97
91
%min = select i1 %cmp2 , float %x , float 255 .0
@@ -104,10 +98,9 @@ define float @clamp_float_fast_unordered_nonstrict_maxmin(float %x) {
104
98
define float @clamp_float_fast_unordered_strict_minmax (float %x ) {
105
99
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_strict_minmax(
106
100
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast ole float [[X:%.*]], 1.000000e+00
107
- ; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
108
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast ole float [[MAX]], 2.550000e+02
109
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MAX]], float 2.550000e+02
110
- ; CHECK-NEXT: ret float [[R1]]
101
+ ; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
102
+ ; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.minnum.f32(float [[TMP1]], float 2.550000e+02)
103
+ ; CHECK-NEXT: ret float [[TMP2]]
111
104
;
112
105
%cmp2 = fcmp fast ugt float %x , 1 .0
113
106
%max = select i1 %cmp2 , float %x , float 1 .0
@@ -120,10 +113,9 @@ define float @clamp_float_fast_unordered_strict_minmax(float %x) {
120
113
define float @clamp_float_fast_unordered_nonstrict_minmax (float %x ) {
121
114
; CHECK-LABEL: define {{[^@]+}}@clamp_float_fast_unordered_nonstrict_minmax(
122
115
; CHECK-NEXT: [[CMP2_INV:%.*]] = fcmp fast ole float [[X:%.*]], 1.000000e+00
123
- ; CHECK-NEXT: [[MAX:%.*]] = select i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
124
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast ole float [[MAX]], 2.550000e+02
125
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[MAX]], float 2.550000e+02
126
- ; CHECK-NEXT: ret float [[R1]]
116
+ ; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[CMP2_INV]], float 1.000000e+00, float [[X]]
117
+ ; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.minnum.f32(float [[TMP1]], float 2.550000e+02)
118
+ ; CHECK-NEXT: ret float [[TMP2]]
127
119
;
128
120
%cmp2 = fcmp fast ugt float %x , 1 .0
129
121
%max = select i1 %cmp2 , float %x , float 1 .0
@@ -139,10 +131,9 @@ define float @clamp_float_fast_unordered_nonstrict_minmax(float %x) {
139
131
define float @clamp_test_1 (float %x ) {
140
132
; CHECK-LABEL: define {{[^@]+}}@clamp_test_1(
141
133
; CHECK-NEXT: [[INNER_CMP_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
142
- ; CHECK-NEXT: [[INNER_SEL:%.*]] = select i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
143
- ; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[INNER_SEL]], 1.000000e+00
144
- ; CHECK-NEXT: [[R1:%.*]] = select i1 [[DOTINV]], float [[INNER_SEL]], float 1.000000e+00
145
- ; CHECK-NEXT: ret float [[R1]]
134
+ ; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
135
+ ; CHECK-NEXT: [[TMP2:%.*]] = call fast float @llvm.maxnum.f32(float [[TMP1]], float 1.000000e+00)
136
+ ; CHECK-NEXT: ret float [[TMP2]]
146
137
;
147
138
%inner_cmp = fcmp fast ult float %x , 255 .0
148
139
%inner_sel = select i1 %inner_cmp , float %x , float 255 .0
@@ -157,9 +148,9 @@ define float @clamp_test_1(float %x) {
157
148
define float @clamp_negative_wrong_const (float %x ) {
158
149
; CHECK-LABEL: define {{[^@]+}}@clamp_negative_wrong_const(
159
150
; CHECK-NEXT: [[INNER_CMP_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
160
- ; CHECK-NEXT: [[INNER_SEL :%.*]] = select i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
151
+ ; CHECK-NEXT: [[TMP1 :%.*]] = select fast i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
161
152
; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ugt float [[X]], 5.120000e+02
162
- ; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[INNER_SEL ]], float 5.120000e+02
153
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[TMP1 ]], float 5.120000e+02
163
154
; CHECK-NEXT: ret float [[R]]
164
155
;
165
156
%inner_cmp = fcmp fast ult float %x , 255 .0
@@ -173,9 +164,9 @@ define float @clamp_negative_wrong_const(float %x) {
173
164
define float @clamp_negative_same_op (float %x ) {
174
165
; CHECK-LABEL: define {{[^@]+}}@clamp_negative_same_op(
175
166
; CHECK-NEXT: [[INNER_CMP_INV:%.*]] = fcmp fast oge float [[X:%.*]], 2.550000e+02
176
- ; CHECK-NEXT: [[INNER_SEL :%.*]] = select i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
167
+ ; CHECK-NEXT: [[TMP1 :%.*]] = select fast i1 [[INNER_CMP_INV]], float 2.550000e+02, float [[X]]
177
168
; CHECK-NEXT: [[OUTER_CMP:%.*]] = fcmp fast ult float [[X]], 1.000000e+00
178
- ; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[INNER_SEL ]], float 1.000000e+00
169
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[OUTER_CMP]], float [[TMP1 ]], float 1.000000e+00
179
170
; CHECK-NEXT: ret float [[R]]
180
171
;
181
172
%inner_cmp = fcmp fast ult float %x , 255 .0
0 commit comments