Skip to content

Commit 7d56a78

Browse files
committed
[InstSimplify] fix some test names; NFC
Too much division...the quotient is the answer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312943 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent c18e8bc commit 7d56a78

File tree

3 files changed

+56
-56
lines changed

3 files changed

+56
-56
lines changed

test/Transforms/InstSimplify/div.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ define <2 x i1> @udiv_bool_vec(<2 x i1> %x, <2 x i1> %y) {
5454
ret <2 x i1> %div
5555
}
5656

57-
define i32 @udiv_quotient_known_smaller_than_constant_denom(i32 %x) {
58-
; CHECK-LABEL: @udiv_quotient_known_smaller_than_constant_denom(
57+
define i32 @udiv_dividend_known_smaller_than_constant_divisor(i32 %x) {
58+
; CHECK-LABEL: @udiv_dividend_known_smaller_than_constant_divisor(
5959
; CHECK-NEXT: ret i32 0
6060
;
6161
%and = and i32 %x, 250
6262
%div = udiv i32 %and, 251
6363
ret i32 %div
6464
}
6565

66-
define i32 @not_udiv_quotient_known_smaller_than_constant_denom(i32 %x) {
67-
; CHECK-LABEL: @not_udiv_quotient_known_smaller_than_constant_denom(
66+
define i32 @not_udiv_dividend_known_smaller_than_constant_divisor(i32 %x) {
67+
; CHECK-LABEL: @not_udiv_dividend_known_smaller_than_constant_divisor(
6868
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 251
6969
; CHECK-NEXT: [[DIV:%.*]] = udiv i32 [[AND]], 251
7070
; CHECK-NEXT: ret i32 [[DIV]]
@@ -74,17 +74,17 @@ define i32 @not_udiv_quotient_known_smaller_than_constant_denom(i32 %x) {
7474
ret i32 %div
7575
}
7676

77-
define i32 @udiv_constant_quotient_known_smaller_than_denom(i32 %x) {
78-
; CHECK-LABEL: @udiv_constant_quotient_known_smaller_than_denom(
77+
define i32 @udiv_constant_dividend_known_smaller_than_divisor(i32 %x) {
78+
; CHECK-LABEL: @udiv_constant_dividend_known_smaller_than_divisor(
7979
; CHECK-NEXT: ret i32 0
8080
;
8181
%or = or i32 %x, 251
8282
%div = udiv i32 250, %or
8383
ret i32 %div
8484
}
8585

86-
define i32 @not_udiv_constant_quotient_known_smaller_than_denom(i32 %x) {
87-
; CHECK-LABEL: @not_udiv_constant_quotient_known_smaller_than_denom(
86+
define i32 @not_udiv_constant_dividend_known_smaller_than_divisor(i32 %x) {
87+
; CHECK-LABEL: @not_udiv_constant_dividend_known_smaller_than_divisor(
8888
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, 251
8989
; CHECK-NEXT: [[DIV:%.*]] = udiv i32 251, [[OR]]
9090
; CHECK-NEXT: ret i32 [[DIV]]
@@ -96,8 +96,8 @@ define i32 @not_udiv_constant_quotient_known_smaller_than_denom(i32 %x) {
9696

9797
; This would require computing known bits on both x and y. Is it worth doing?
9898

99-
define i32 @udiv_quotient_known_smaller_than_denom(i32 %x, i32 %y) {
100-
; CHECK-LABEL: @udiv_quotient_known_smaller_than_denom(
99+
define i32 @udiv_dividend_known_smaller_than_divisor(i32 %x, i32 %y) {
100+
; CHECK-LABEL: @udiv_dividend_known_smaller_than_divisor(
101101
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 250
102102
; CHECK-NEXT: [[OR:%.*]] = or i32 %y, 251
103103
; CHECK-NEXT: [[DIV:%.*]] = udiv i32 [[AND]], [[OR]]
@@ -109,8 +109,8 @@ define i32 @udiv_quotient_known_smaller_than_denom(i32 %x, i32 %y) {
109109
ret i32 %div
110110
}
111111

112-
define i32 @not_udiv_quotient_known_smaller_than_denom(i32 %x, i32 %y) {
113-
; CHECK-LABEL: @not_udiv_quotient_known_smaller_than_denom(
112+
define i32 @not_udiv_dividend_known_smaller_than_divisor(i32 %x, i32 %y) {
113+
; CHECK-LABEL: @not_udiv_dividend_known_smaller_than_divisor(
114114
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 251
115115
; CHECK-NEXT: [[OR:%.*]] = or i32 %y, 251
116116
; CHECK-NEXT: [[DIV:%.*]] = udiv i32 [[AND]], [[OR]]

test/Transforms/InstSimplify/rem.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ define i32 @rem3(i32 %x, i32 %n) {
104104
ret i32 %mod1
105105
}
106106

107-
define i32 @urem_quotient_known_smaller_than_constant_denom(i32 %x) {
108-
; CHECK-LABEL: @urem_quotient_known_smaller_than_constant_denom(
107+
define i32 @urem_dividend_known_smaller_than_constant_divisor(i32 %x) {
108+
; CHECK-LABEL: @urem_dividend_known_smaller_than_constant_divisor(
109109
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 250
110110
; CHECK-NEXT: ret i32 [[AND]]
111111
;
@@ -114,8 +114,8 @@ define i32 @urem_quotient_known_smaller_than_constant_denom(i32 %x) {
114114
ret i32 %r
115115
}
116116

117-
define i32 @not_urem_quotient_known_smaller_than_constant_denom(i32 %x) {
118-
; CHECK-LABEL: @not_urem_quotient_known_smaller_than_constant_denom(
117+
define i32 @not_urem_dividend_known_smaller_than_constant_divisor(i32 %x) {
118+
; CHECK-LABEL: @not_urem_dividend_known_smaller_than_constant_divisor(
119119
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 251
120120
; CHECK-NEXT: [[R:%.*]] = urem i32 [[AND]], 251
121121
; CHECK-NEXT: ret i32 [[R]]
@@ -125,17 +125,17 @@ define i32 @not_urem_quotient_known_smaller_than_constant_denom(i32 %x) {
125125
ret i32 %r
126126
}
127127

128-
define i32 @urem_constant_quotient_known_smaller_than_denom(i32 %x) {
129-
; CHECK-LABEL: @urem_constant_quotient_known_smaller_than_denom(
128+
define i32 @urem_constant_dividend_known_smaller_than_divisor(i32 %x) {
129+
; CHECK-LABEL: @urem_constant_dividend_known_smaller_than_divisor(
130130
; CHECK-NEXT: ret i32 250
131131
;
132132
%or = or i32 %x, 251
133133
%r = urem i32 250, %or
134134
ret i32 %r
135135
}
136136

137-
define i32 @not_urem_constant_quotient_known_smaller_than_denom(i32 %x) {
138-
; CHECK-LABEL: @not_urem_constant_quotient_known_smaller_than_denom(
137+
define i32 @not_urem_constant_dividend_known_smaller_than_divisor(i32 %x) {
138+
; CHECK-LABEL: @not_urem_constant_dividend_known_smaller_than_divisor(
139139
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, 251
140140
; CHECK-NEXT: [[R:%.*]] = urem i32 251, [[OR]]
141141
; CHECK-NEXT: ret i32 [[R]]
@@ -147,8 +147,8 @@ define i32 @not_urem_constant_quotient_known_smaller_than_denom(i32 %x) {
147147

148148
; This would require computing known bits on both x and y. Is it worth doing?
149149

150-
define i32 @urem_quotient_known_smaller_than_denom(i32 %x, i32 %y) {
151-
; CHECK-LABEL: @urem_quotient_known_smaller_than_denom(
150+
define i32 @urem_dividend_known_smaller_than_divisor(i32 %x, i32 %y) {
151+
; CHECK-LABEL: @urem_dividend_known_smaller_than_divisor(
152152
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 250
153153
; CHECK-NEXT: [[OR:%.*]] = or i32 %y, 251
154154
; CHECK-NEXT: [[R:%.*]] = urem i32 [[AND]], [[OR]]
@@ -160,8 +160,8 @@ define i32 @urem_quotient_known_smaller_than_denom(i32 %x, i32 %y) {
160160
ret i32 %r
161161
}
162162

163-
define i32 @not_urem_quotient_known_smaller_than_denom(i32 %x, i32 %y) {
164-
; CHECK-LABEL: @not_urem_quotient_known_smaller_than_denom(
163+
define i32 @not_urem_dividend_known_smaller_than_divisor(i32 %x, i32 %y) {
164+
; CHECK-LABEL: @not_urem_dividend_known_smaller_than_divisor(
165165
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 251
166166
; CHECK-NEXT: [[OR:%.*]] = or i32 %y, 251
167167
; CHECK-NEXT: [[R:%.*]] = urem i32 [[AND]], [[OR]]

test/Transforms/InstSimplify/signed-div-rem.ll

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ define i32 @not_sdiv_zext_small_divisor(i8 %x) {
8888
ret i32 %div
8989
}
9090

91-
define i32 @sdiv_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
92-
; CHECK-LABEL: @sdiv_quotient_known_smaller_than_pos_divisor_clear_bits(
91+
define i32 @sdiv_dividend_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
92+
; CHECK-LABEL: @sdiv_dividend_known_smaller_than_pos_divisor_clear_bits(
9393
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
9494
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[AND]], 254
9595
; CHECK-NEXT: ret i32 [[DIV]]
@@ -99,8 +99,8 @@ define i32 @sdiv_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
9999
ret i32 %div
100100
}
101101

102-
define i32 @not_sdiv_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
103-
; CHECK-LABEL: @not_sdiv_quotient_known_smaller_than_pos_divisor_clear_bits(
102+
define i32 @not_sdiv_dividend_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
103+
; CHECK-LABEL: @not_sdiv_dividend_known_smaller_than_pos_divisor_clear_bits(
104104
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
105105
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[AND]], 253
106106
; CHECK-NEXT: ret i32 [[DIV]]
@@ -110,8 +110,8 @@ define i32 @not_sdiv_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x)
110110
ret i32 %div
111111
}
112112

113-
define i32 @sdiv_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
114-
; CHECK-LABEL: @sdiv_quotient_known_smaller_than_neg_divisor_clear_bits(
113+
define i32 @sdiv_dividend_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
114+
; CHECK-LABEL: @sdiv_dividend_known_smaller_than_neg_divisor_clear_bits(
115115
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
116116
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[AND]], -254
117117
; CHECK-NEXT: ret i32 [[DIV]]
@@ -121,8 +121,8 @@ define i32 @sdiv_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
121121
ret i32 %div
122122
}
123123

124-
define i32 @not_sdiv_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
125-
; CHECK-LABEL: @not_sdiv_quotient_known_smaller_than_neg_divisor_clear_bits(
124+
define i32 @not_sdiv_dividend_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
125+
; CHECK-LABEL: @not_sdiv_dividend_known_smaller_than_neg_divisor_clear_bits(
126126
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
127127
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[AND]], -253
128128
; CHECK-NEXT: ret i32 [[DIV]]
@@ -132,8 +132,8 @@ define i32 @not_sdiv_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x)
132132
ret i32 %div
133133
}
134134

135-
define i32 @sdiv_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
136-
; CHECK-LABEL: @sdiv_quotient_known_smaller_than_pos_divisor_set_bits(
135+
define i32 @sdiv_dividend_known_smaller_than_pos_divisor_set_bits(i32 %x) {
136+
; CHECK-LABEL: @sdiv_dividend_known_smaller_than_pos_divisor_set_bits(
137137
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
138138
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[OR]], 254
139139
; CHECK-NEXT: ret i32 [[DIV]]
@@ -143,8 +143,8 @@ define i32 @sdiv_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
143143
ret i32 %div
144144
}
145145

146-
define i32 @not_sdiv_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
147-
; CHECK-LABEL: @not_sdiv_quotient_known_smaller_than_pos_divisor_set_bits(
146+
define i32 @not_sdiv_dividend_known_smaller_than_pos_divisor_set_bits(i32 %x) {
147+
; CHECK-LABEL: @not_sdiv_dividend_known_smaller_than_pos_divisor_set_bits(
148148
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
149149
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[OR]], 253
150150
; CHECK-NEXT: ret i32 [[DIV]]
@@ -154,8 +154,8 @@ define i32 @not_sdiv_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
154154
ret i32 %div
155155
}
156156

157-
define i32 @sdiv_quotient_known_smaller_than_neg_divisor_set_bits(i32 %x) {
158-
; CHECK-LABEL: @sdiv_quotient_known_smaller_than_neg_divisor_set_bits(
157+
define i32 @sdiv_dividend_known_smaller_than_neg_divisor_set_bits(i32 %x) {
158+
; CHECK-LABEL: @sdiv_dividend_known_smaller_than_neg_divisor_set_bits(
159159
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
160160
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[OR]], -254
161161
; CHECK-NEXT: ret i32 [[DIV]]
@@ -165,8 +165,8 @@ define i32 @sdiv_quotient_known_smaller_than_neg_divisor_set_bits(i32 %x) {
165165
ret i32 %div
166166
}
167167

168-
define i32 @not_sdiv_quotient_known_smaller_than_neg_divisor_set_bits(i32 %x) {
169-
; CHECK-LABEL: @not_sdiv_quotient_known_smaller_than_neg_divisor_set_bits(
168+
define i32 @not_sdiv_dividend_known_smaller_than_neg_divisor_set_bits(i32 %x) {
169+
; CHECK-LABEL: @not_sdiv_dividend_known_smaller_than_neg_divisor_set_bits(
170170
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
171171
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[OR]], -253
172172
; CHECK-NEXT: ret i32 [[DIV]]
@@ -264,8 +264,8 @@ define i32 @not_srem_zext_small_divisor(i8 %x) {
264264
ret i32 %rem
265265
}
266266

267-
define i32 @srem_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
268-
; CHECK-LABEL: @srem_quotient_known_smaller_than_pos_divisor_clear_bits(
267+
define i32 @srem_dividend_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
268+
; CHECK-LABEL: @srem_dividend_known_smaller_than_pos_divisor_clear_bits(
269269
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
270270
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[AND]], 254
271271
; CHECK-NEXT: ret i32 [[REM]]
@@ -275,8 +275,8 @@ define i32 @srem_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
275275
ret i32 %rem
276276
}
277277

278-
define i32 @not_srem_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
279-
; CHECK-LABEL: @not_srem_quotient_known_smaller_than_pos_divisor_clear_bits(
278+
define i32 @not_srem_dividend_known_smaller_than_pos_divisor_clear_bits(i32 %x) {
279+
; CHECK-LABEL: @not_srem_dividend_known_smaller_than_pos_divisor_clear_bits(
280280
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
281281
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[AND]], 253
282282
; CHECK-NEXT: ret i32 [[REM]]
@@ -286,8 +286,8 @@ define i32 @not_srem_quotient_known_smaller_than_pos_divisor_clear_bits(i32 %x)
286286
ret i32 %rem
287287
}
288288

289-
define i32 @srem_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
290-
; CHECK-LABEL: @srem_quotient_known_smaller_than_neg_divisor_clear_bits(
289+
define i32 @srem_dividend_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
290+
; CHECK-LABEL: @srem_dividend_known_smaller_than_neg_divisor_clear_bits(
291291
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
292292
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[AND]], -254
293293
; CHECK-NEXT: ret i32 [[REM]]
@@ -297,8 +297,8 @@ define i32 @srem_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
297297
ret i32 %rem
298298
}
299299

300-
define i32 @not_srem_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
301-
; CHECK-LABEL: @not_srem_quotient_known_smaller_than_neg_divisor_clear_bits(
300+
define i32 @not_srem_dividend_known_smaller_than_neg_divisor_clear_bits(i32 %x) {
301+
; CHECK-LABEL: @not_srem_dividend_known_smaller_than_neg_divisor_clear_bits(
302302
; CHECK-NEXT: [[AND:%.*]] = and i32 %x, 253
303303
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[AND]], -253
304304
; CHECK-NEXT: ret i32 [[REM]]
@@ -308,8 +308,8 @@ define i32 @not_srem_quotient_known_smaller_than_neg_divisor_clear_bits(i32 %x)
308308
ret i32 %rem
309309
}
310310

311-
define i32 @srem_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
312-
; CHECK-LABEL: @srem_quotient_known_smaller_than_pos_divisor_set_bits(
311+
define i32 @srem_dividend_known_smaller_than_pos_divisor_set_bits(i32 %x) {
312+
; CHECK-LABEL: @srem_dividend_known_smaller_than_pos_divisor_set_bits(
313313
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
314314
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[OR]], 254
315315
; CHECK-NEXT: ret i32 [[REM]]
@@ -319,8 +319,8 @@ define i32 @srem_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
319319
ret i32 %rem
320320
}
321321

322-
define i32 @not_srem_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
323-
; CHECK-LABEL: @not_srem_quotient_known_smaller_than_pos_divisor_set_bits(
322+
define i32 @not_srem_dividend_known_smaller_than_pos_divisor_set_bits(i32 %x) {
323+
; CHECK-LABEL: @not_srem_dividend_known_smaller_than_pos_divisor_set_bits(
324324
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
325325
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[OR]], 253
326326
; CHECK-NEXT: ret i32 [[REM]]
@@ -330,8 +330,8 @@ define i32 @not_srem_quotient_known_smaller_than_pos_divisor_set_bits(i32 %x) {
330330
ret i32 %rem
331331
}
332332

333-
define i32 @srem_quotient_known_smaller_than_neg_divisor_set_bits(i32 %x) {
334-
; CHECK-LABEL: @srem_quotient_known_smaller_than_neg_divisor_set_bits(
333+
define i32 @srem_dividend_known_smaller_than_neg_divisor_set_bits(i32 %x) {
334+
; CHECK-LABEL: @srem_dividend_known_smaller_than_neg_divisor_set_bits(
335335
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
336336
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[OR]], -254
337337
; CHECK-NEXT: ret i32 [[REM]]
@@ -341,8 +341,8 @@ define i32 @srem_quotient_known_smaller_than_neg_divisor_set_bits(i32 %x) {
341341
ret i32 %rem
342342
}
343343

344-
define i32 @not_srem_quotient_known_smaller_than_neg_divisor_set_bits(i32 %x) {
345-
; CHECK-LABEL: @not_srem_quotient_known_smaller_than_neg_divisor_set_bits(
344+
define i32 @not_srem_dividend_known_smaller_than_neg_divisor_set_bits(i32 %x) {
345+
; CHECK-LABEL: @not_srem_dividend_known_smaller_than_neg_divisor_set_bits(
346346
; CHECK-NEXT: [[OR:%.*]] = or i32 %x, -253
347347
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[OR]], -253
348348
; CHECK-NEXT: ret i32 [[REM]]

0 commit comments

Comments
 (0)