Branch data Line data Source code
1 : : /* Generated automatically by the program `genmatch' from
2 : : a IL pattern matching and simplification description. */
3 : : #pragma GCC diagnostic push
4 : : #pragma GCC diagnostic ignored "-Wunused-variable"
5 : : #pragma GCC diagnostic ignored "-Wunused-function"
6 : :
7 : : #include "gimple-match-auto.h"
8 : :
9 : : bool
10 : 1501523511 : gimple_nop_convert (tree t, tree *res_ops, tree (*valueize)(tree) ATTRIBUTE_UNUSED)
11 : : {
12 : 1501523511 : const tree type = TREE_TYPE (t);
13 : 1501523511 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
14 : 1501523511 : switch (TREE_CODE (t))
15 : : {
16 : 1011109554 : case SSA_NAME:
17 : 1011109554 : if (gimple *_d1 = get_def (valueize, t))
18 : : {
19 : 396342590 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
20 : 426215985 : switch (gimple_assign_rhs_code (_a1))
21 : : {
22 : 36764202 : CASE_CONVERT:
23 : 36764202 : {
24 : 36764202 : tree _p0 = gimple_assign_rhs1 (_a1);
25 : 36764202 : _p0 = do_valueize (valueize, _p0);
26 : 36764202 : {
27 : 36764202 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
28 : 36764202 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[0]))
29 : : )
30 : : {
31 : 19177722 : {
32 : 19177722 : res_ops[0] = captures[0];
33 : 19177722 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 0, __FILE__, __LINE__, false);
34 : 19177722 : return true;
35 : : }
36 : : }
37 : : }
38 : : break;
39 : : }
40 : 1645322 : case VIEW_CONVERT_EXPR:
41 : 1645322 : {
42 : 1645322 : tree _p0 = TREE_OPERAND (gimple_assign_rhs1 (_a1), 0);
43 : 1645322 : if ((TREE_CODE (_p0) == SSA_NAME
44 : 1645322 : || is_gimple_min_invariant (_p0)))
45 : : {
46 : 1627778 : _p0 = do_valueize (valueize, _p0);
47 : 1627778 : {
48 : 1627778 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
49 : 342328 : if (VECTOR_TYPE_P (type) && VECTOR_TYPE_P (TREE_TYPE (captures[0]))
50 : 1629909 : && known_eq (TYPE_VECTOR_SUBPARTS (type),
51 : : TYPE_VECTOR_SUBPARTS (TREE_TYPE (captures[0])))
52 : 1881300 : && tree_nop_conversion_p (TREE_TYPE (type), TREE_TYPE (TREE_TYPE (captures[0])))
53 : : )
54 : : {
55 : 251391 : {
56 : 251391 : res_ops[0] = captures[0];
57 : 251391 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1, __FILE__, __LINE__, false);
58 : 251391 : return true;
59 : : }
60 : : }
61 : : }
62 : : }
63 : : break;
64 : : }
65 : : default:;
66 : : }
67 : : }
68 : : break;
69 : : default:;
70 : : }
71 : : return false;
72 : : }
73 : :
74 : : bool
75 : 1436 : gimple_compositional_complex (tree t, tree (*valueize)(tree) ATTRIBUTE_UNUSED)
76 : : {
77 : 1436 : const tree type = TREE_TYPE (t);
78 : 1436 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
79 : 1436 : switch (TREE_CODE (t))
80 : : {
81 : 801 : case SSA_NAME:
82 : 801 : if (gimple *_d1 = get_def (valueize, t))
83 : : {
84 : 497 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
85 : 823 : switch (gimple_assign_rhs_code (_a1))
86 : : {
87 : 0 : CASE_CONVERT:
88 : 0 : {
89 : 0 : tree _p0 = gimple_assign_rhs1 (_a1);
90 : 0 : _p0 = do_valueize (valueize, _p0);
91 : 0 : switch (TREE_CODE (_p0))
92 : : {
93 : 0 : case SSA_NAME:
94 : 0 : if (gimple *_d2 = get_def (valueize, _p0))
95 : : {
96 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
97 : 0 : switch (gimple_assign_rhs_code (_a2))
98 : : {
99 : 0 : case COMPLEX_EXPR:
100 : 0 : {
101 : 0 : tree _q20 = gimple_assign_rhs1 (_a2);
102 : 0 : _q20 = do_valueize (valueize, _q20);
103 : 0 : tree _q21 = gimple_assign_rhs2 (_a2);
104 : 0 : _q21 = do_valueize (valueize, _q21);
105 : 0 : {
106 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
107 : 0 : {
108 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 35, __FILE__, __LINE__, false);
109 : 0 : return true;
110 : : }
111 : : }
112 : : break;
113 : : }
114 : : default:;
115 : : }
116 : : }
117 : : break;
118 : : default:;
119 : : }
120 : : break;
121 : : }
122 : 105 : case COMPLEX_EXPR:
123 : 105 : {
124 : 105 : tree _p0 = gimple_assign_rhs1 (_a1);
125 : 105 : _p0 = do_valueize (valueize, _p0);
126 : 105 : tree _p1 = gimple_assign_rhs2 (_a1);
127 : 105 : _p1 = do_valueize (valueize, _p1);
128 : 105 : {
129 : 105 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
130 : 105 : {
131 : 105 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 35, __FILE__, __LINE__, false);
132 : 105 : return true;
133 : : }
134 : : }
135 : : break;
136 : : }
137 : : default:;
138 : : }
139 : : }
140 : : break;
141 : : default:;
142 : : }
143 : : return false;
144 : : }
145 : :
146 : : bool
147 : 660662 : gimple_simplify_5 (gimple_match_op *res_op, gimple_seq *seq,
148 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
149 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
150 : : const enum tree_code ARG_UNUSED (op))
151 : : {
152 : 660662 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
153 : 660662 : {
154 : 660662 : bool wascmp0, wascmp1;
155 : 660662 : if (bitwise_inverted_equal_p (captures[1], captures[3], wascmp0)
156 : 12614 : && bitwise_inverted_equal_p (captures[0], captures[2], wascmp1)
157 : 660800 : && ((!wascmp0 && !wascmp1)
158 : 137 : || element_precision (type) == 1)
159 : : )
160 : : {
161 : 138 : gimple_seq *lseq = seq;
162 : 138 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail164;
163 : 138 : {
164 : 138 : res_op->set_op (BIT_XOR_EXPR, type, 2);
165 : 138 : res_op->ops[0] = captures[0];
166 : 138 : res_op->ops[1] = captures[3];
167 : 138 : res_op->resimplify (lseq, valueize);
168 : 138 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 58, __FILE__, __LINE__, true);
169 : 138 : return true;
170 : : }
171 : 0 : next_after_fail164:;
172 : : }
173 : : }
174 : 660524 : return false;
175 : : }
176 : :
177 : : bool
178 : 1209 : gimple_simplify_9 (gimple_match_op *res_op, gimple_seq *seq,
179 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
180 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
181 : : {
182 : 1209 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
183 : 1209 : gimple_seq *lseq = seq;
184 : 1209 : if (lseq
185 : 430 : && (!single_use (captures[0])
186 : 398 : || !single_use (captures[1])))
187 : 865 : lseq = NULL;
188 : 1209 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail168;
189 : 1209 : {
190 : 1209 : res_op->set_op (BIT_XOR_EXPR, type, 2);
191 : 1209 : {
192 : 1209 : tree _o1[2], _r1;
193 : 1209 : _o1[0] = captures[2];
194 : 1209 : _o1[1] = captures[3];
195 : 1209 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
196 : 1209 : tem_op.resimplify (lseq, valueize);
197 : 1209 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
198 : 1209 : if (!_r1) goto next_after_fail168;
199 : 350 : res_op->ops[0] = _r1;
200 : : }
201 : 350 : {
202 : 350 : tree _o1[2], _r1;
203 : 350 : _o1[0] = captures[4];
204 : 350 : _o1[1] = captures[3];
205 : 350 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
206 : 350 : tem_op.resimplify (NULL, valueize);
207 : 350 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
208 : 350 : if (!_r1) goto next_after_fail168;
209 : 8 : res_op->ops[1] = _r1;
210 : : }
211 : 8 : res_op->resimplify (lseq, valueize);
212 : 8 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 62, __FILE__, __LINE__, true);
213 : : return true;
214 : : }
215 : : next_after_fail168:;
216 : : return false;
217 : : }
218 : :
219 : : bool
220 : 0 : gimple_simplify_14 (gimple_match_op *res_op, gimple_seq *seq,
221 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
222 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
223 : : {
224 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
225 : 0 : gimple_seq *lseq = seq;
226 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail173;
227 : 0 : {
228 : 0 : res_op->set_op (BIT_XOR_EXPR, type, 2);
229 : 0 : res_op->ops[0] = captures[0];
230 : 0 : res_op->ops[1] = captures[1];
231 : 0 : res_op->resimplify (lseq, valueize);
232 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 67, __FILE__, __LINE__, true);
233 : : return true;
234 : : }
235 : 0 : next_after_fail173:;
236 : 0 : return false;
237 : : }
238 : :
239 : : bool
240 : 50 : gimple_simplify_19 (gimple_match_op *res_op, gimple_seq *seq,
241 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
242 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
243 : : const enum tree_code ARG_UNUSED (op))
244 : : {
245 : 50 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
246 : 50 : gimple_seq *lseq = seq;
247 : 50 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail178;
248 : 50 : {
249 : 50 : res_op->set_op (BIT_IOR_EXPR, type, 2);
250 : 50 : res_op->ops[0] = captures[0];
251 : 50 : res_op->ops[1] = captures[1];
252 : 50 : res_op->resimplify (lseq, valueize);
253 : 50 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 72, __FILE__, __LINE__, true);
254 : : return true;
255 : : }
256 : 0 : next_after_fail178:;
257 : 0 : return false;
258 : : }
259 : :
260 : : bool
261 : 456 : gimple_simplify_23 (gimple_match_op *res_op, gimple_seq *seq,
262 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
263 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
264 : : {
265 : 456 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
266 : 456 : if (tree_nop_conversion_p (type, TREE_TYPE (captures[2]))
267 : : )
268 : : {
269 : 456 : gimple_seq *lseq = seq;
270 : 456 : if (lseq
271 : 220 : && (!single_use (captures[0])
272 : 220 : || !single_use (captures[1])))
273 : 236 : lseq = NULL;
274 : 456 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail182;
275 : 456 : {
276 : 456 : res_op->set_op (BIT_NOT_EXPR, type, 1);
277 : 456 : {
278 : 456 : tree _o1[2], _r1;
279 : 456 : {
280 : 456 : tree _o2[1], _r2;
281 : 456 : _o2[0] = captures[2];
282 : 456 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, type, _o2[0]);
283 : 456 : tem_op.resimplify (lseq, valueize);
284 : 456 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
285 : 456 : if (!_r2) goto next_after_fail182;
286 : 456 : _o1[0] = _r2;
287 : : }
288 : 456 : _o1[1] = captures[3];
289 : 456 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
290 : 456 : tem_op.resimplify (lseq, valueize);
291 : 456 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
292 : 456 : if (!_r1) goto next_after_fail182;
293 : 220 : res_op->ops[0] = _r1;
294 : : }
295 : 220 : res_op->resimplify (lseq, valueize);
296 : 220 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 76, __FILE__, __LINE__, true);
297 : 220 : return true;
298 : : }
299 : : next_after_fail182:;
300 : : }
301 : : return false;
302 : : }
303 : :
304 : : bool
305 : 6763 : gimple_simplify_29 (gimple_match_op *res_op, gimple_seq *seq,
306 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
307 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
308 : : const enum tree_code ARG_UNUSED (bitop))
309 : : {
310 : 6763 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
311 : 6763 : if (!CONSTANT_CLASS_P (captures[0])
312 : : )
313 : : {
314 : 6763 : gimple_seq *lseq = seq;
315 : 6763 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail188;
316 : 6763 : {
317 : 6763 : res_op->set_op (bitop, type, 2);
318 : 6763 : res_op->ops[0] = captures[0];
319 : 6763 : {
320 : 6763 : tree _o1[2], _r1;
321 : 6763 : _o1[0] = captures[1];
322 : 6763 : _o1[1] = captures[2];
323 : 6763 : gimple_match_op tem_op (res_op->cond.any_else (), bitop, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
324 : 6763 : tem_op.resimplify (NULL, valueize);
325 : 6763 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
326 : 6763 : if (!_r1) goto next_after_fail188;
327 : 6763 : res_op->ops[1] = _r1;
328 : : }
329 : 6763 : res_op->resimplify (lseq, valueize);
330 : 6763 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 81, __FILE__, __LINE__, true);
331 : 6763 : return true;
332 : : }
333 : : next_after_fail188:;
334 : : }
335 : : else
336 : : {
337 : 0 : {
338 : 0 : tree cst1 = const_binop (bitop, type, captures[0], captures[2]);
339 : 0 : if (cst1
340 : : )
341 : : {
342 : 0 : gimple_seq *lseq = seq;
343 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail189;
344 : 0 : {
345 : 0 : res_op->set_op (bitop, type, 2);
346 : 0 : res_op->ops[0] = captures[1];
347 : 0 : res_op->ops[1] = cst1;
348 : 0 : res_op->resimplify (lseq, valueize);
349 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 82, __FILE__, __LINE__, true);
350 : 0 : return true;
351 : : }
352 : 0 : next_after_fail189:;
353 : : }
354 : : else
355 : : {
356 : 0 : {
357 : 0 : tree cst2 = const_binop (bitop, type, captures[1], captures[2]);
358 : 0 : if (cst2
359 : : )
360 : : {
361 : 0 : gimple_seq *lseq = seq;
362 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail190;
363 : 0 : {
364 : 0 : res_op->set_op (bitop, type, 2);
365 : 0 : res_op->ops[0] = captures[0];
366 : 0 : res_op->ops[1] = cst2;
367 : 0 : res_op->resimplify (lseq, valueize);
368 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 83, __FILE__, __LINE__, true);
369 : 0 : return true;
370 : : }
371 : 0 : next_after_fail190:;
372 : : }
373 : : }
374 : : }
375 : : }
376 : : }
377 : : return false;
378 : : }
379 : :
380 : : bool
381 : 74 : gimple_simplify_38 (gimple_match_op *res_op, gimple_seq *seq,
382 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
383 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
384 : : {
385 : 74 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
386 : 74 : if (INTEGRAL_TYPE_P (type)
387 : : && (
388 : : 1
389 : : || !TREE_SIDE_EFFECTS (captures[1]))
390 : : )
391 : : {
392 : 74 : gimple_seq *lseq = seq;
393 : 74 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail200;
394 : 74 : {
395 : 74 : res_op->set_op (COND_EXPR, type, 3);
396 : 74 : {
397 : 74 : tree _o1[1], _r1;
398 : 74 : _o1[0] = captures[2];
399 : 74 : if (boolean_type_node != TREE_TYPE (_o1[0])
400 : 74 : && !useless_type_conversion_p (boolean_type_node, TREE_TYPE (_o1[0])))
401 : : {
402 : 74 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, boolean_type_node, _o1[0]);
403 : 74 : tem_op.resimplify (lseq, valueize);
404 : 74 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
405 : 74 : if (!_r1) goto next_after_fail200;
406 : : }
407 : : else
408 : : _r1 = _o1[0];
409 : 62 : res_op->ops[0] = _r1;
410 : : }
411 : 62 : res_op->ops[1] = captures[1];
412 : 62 : res_op->ops[2] = captures[0];
413 : 62 : res_op->resimplify (lseq, valueize);
414 : 62 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 92, __FILE__, __LINE__, true);
415 : 62 : return true;
416 : : }
417 : : next_after_fail200:;
418 : : }
419 : : return false;
420 : : }
421 : :
422 : : bool
423 : 604792 : gimple_simplify_44 (gimple_match_op *res_op, gimple_seq *seq,
424 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
425 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
426 : : {
427 : 604792 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
428 : 604792 : if (fold_real_zero_addition_p (type, captures[0], captures[1], 0)
429 : : )
430 : : {
431 : 15858 : gimple_seq *lseq = seq;
432 : 15858 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail209;
433 : 15858 : {
434 : 15858 : tree tem;
435 : 15858 : tem = captures[0];
436 : 15858 : res_op->set_value (tem);
437 : 15858 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 101, __FILE__, __LINE__, true);
438 : 15858 : return true;
439 : : }
440 : 0 : next_after_fail209:;
441 : : }
442 : : return false;
443 : : }
444 : :
445 : : bool
446 : 59 : gimple_simplify_50 (gimple_match_op *res_op, gimple_seq *seq,
447 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
448 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
449 : : {
450 : 59 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
451 : 59 : gimple_seq *lseq = seq;
452 : 59 : if (lseq
453 : 59 : && (!single_use (captures[1])))
454 : 0 : lseq = NULL;
455 : 59 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail217;
456 : 59 : {
457 : 59 : res_op->set_op (BIT_AND_EXPR, type, 2);
458 : 59 : {
459 : 59 : tree _o1[2], _r1;
460 : 59 : _o1[0] = captures[0];
461 : 59 : _o1[1] = captures[2];
462 : 59 : gimple_match_op tem_op (res_op->cond.any_else (), PLUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
463 : 59 : tem_op.resimplify (lseq, valueize);
464 : 59 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
465 : 59 : if (!_r1) goto next_after_fail217;
466 : 59 : res_op->ops[0] = _r1;
467 : : }
468 : 59 : {
469 : 59 : tree _o1[1], _r1;
470 : 59 : _o1[0] = captures[2];
471 : 59 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_NOT_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
472 : 59 : tem_op.resimplify (lseq, valueize);
473 : 59 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
474 : 59 : if (!_r1) goto next_after_fail217;
475 : 59 : res_op->ops[1] = _r1;
476 : : }
477 : 59 : res_op->resimplify (lseq, valueize);
478 : 59 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 109, __FILE__, __LINE__, true);
479 : : return true;
480 : : }
481 : : next_after_fail217:;
482 : : return false;
483 : : }
484 : :
485 : : bool
486 : 26976 : gimple_simplify_56 (gimple_match_op *res_op, gimple_seq *seq,
487 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
488 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
489 : : const enum tree_code ARG_UNUSED (outer_op))
490 : : {
491 : 26976 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
492 : 26976 : if (!TYPE_SATURATING (type)
493 : : )
494 : : {
495 : 26976 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
496 : 52802 : && !FIXED_POINT_TYPE_P (type)
497 : : )
498 : : {
499 : 25826 : if (!ANY_INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_WRAPS (type)
500 : : )
501 : : {
502 : 17874 : if (!CONSTANT_CLASS_P (captures[1])
503 : : )
504 : : {
505 : 17874 : gimple_seq *lseq = seq;
506 : 17874 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail229;
507 : 17874 : {
508 : 17874 : res_op->set_op (MINUS_EXPR, type, 2);
509 : 17874 : {
510 : 17874 : tree _o1[2], _r1;
511 : 17874 : {
512 : 17874 : tree _o2[1], _r2;
513 : 17874 : _o2[0] = captures[0];
514 : 17874 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, type, _o2[0]);
515 : 17874 : tem_op.resimplify (lseq, valueize);
516 : 17874 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
517 : 17874 : if (!_r2) goto next_after_fail229;
518 : 17874 : _o1[0] = _r2;
519 : : }
520 : 17874 : _o1[1] = captures[2];
521 : 17874 : gimple_match_op tem_op (res_op->cond.any_else (), outer_op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
522 : 17874 : tem_op.resimplify (NULL, valueize);
523 : 17874 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
524 : 17874 : if (!_r1) goto next_after_fail229;
525 : 17874 : res_op->ops[0] = _r1;
526 : : }
527 : 17874 : {
528 : 17874 : tree _o1[1], _r1;
529 : 17874 : _o1[0] = captures[1];
530 : 17874 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, type, _o1[0]);
531 : 17874 : tem_op.resimplify (lseq, valueize);
532 : 17874 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
533 : 17874 : if (!_r1) goto next_after_fail229;
534 : 17577 : res_op->ops[1] = _r1;
535 : : }
536 : 17577 : res_op->resimplify (lseq, valueize);
537 : 17577 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 121, __FILE__, __LINE__, true);
538 : 17577 : return true;
539 : : }
540 : : next_after_fail229:;
541 : : }
542 : : }
543 : : else
544 : : {
545 : 15904 : if (!ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
546 : 15904 : || TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[1]))
547 : : )
548 : : {
549 : 536 : gimple_seq *lseq = seq;
550 : 536 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail230;
551 : 536 : {
552 : 536 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
553 : 536 : {
554 : 536 : tree _o1[2], _r1;
555 : 536 : {
556 : 536 : tree _o2[2], _r2;
557 : 536 : _o2[0] = captures[0];
558 : 536 : {
559 : 536 : tree _o3[1], _r3;
560 : 536 : _o3[0] = captures[2];
561 : 536 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, TREE_TYPE (_o2[0]), _o3[0]);
562 : 536 : tem_op.resimplify (lseq, valueize);
563 : 536 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
564 : 536 : if (!_r3) goto next_after_fail230;
565 : 536 : _o2[1] = _r3;
566 : : }
567 : 536 : gimple_match_op tem_op (res_op->cond.any_else (), outer_op, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
568 : 536 : tem_op.resimplify (NULL, valueize);
569 : 536 : _r2 = maybe_push_res_to_seq (&tem_op, NULL);
570 : 536 : if (!_r2) goto next_after_fail230;
571 : 536 : _o1[0] = _r2;
572 : : }
573 : 536 : _o1[1] = captures[1];
574 : 536 : gimple_match_op tem_op (res_op->cond.any_else (), MINUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
575 : 536 : tem_op.resimplify (lseq, valueize);
576 : 536 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
577 : 536 : if (!_r1) goto next_after_fail230;
578 : 216 : res_op->ops[0] = _r1;
579 : : }
580 : 216 : res_op->resimplify (lseq, valueize);
581 : 216 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 122, __FILE__, __LINE__, true);
582 : 216 : return true;
583 : : }
584 : : next_after_fail230:;
585 : : }
586 : : else
587 : : {
588 : 7416 : if (types_match (type, captures[1]) && !TYPE_OVERFLOW_SANITIZED (type)
589 : : )
590 : : {
591 : 7409 : {
592 : 7409 : tree cst = const_binop (outer_op, type, captures[0], captures[2]);
593 : 7409 : if (cst && !TREE_OVERFLOW (cst)
594 : : )
595 : : {
596 : 7403 : gimple_seq *lseq = seq;
597 : 7403 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail231;
598 : 7403 : {
599 : 7403 : res_op->set_op (MINUS_EXPR, type, 2);
600 : 7403 : res_op->ops[0] = cst;
601 : 7403 : res_op->ops[1] = captures[1];
602 : 7403 : res_op->resimplify (lseq, valueize);
603 : 7403 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 123, __FILE__, __LINE__, true);
604 : 7403 : return true;
605 : : }
606 : 0 : next_after_fail231:;
607 : : }
608 : : }
609 : : }
610 : : }
611 : : }
612 : : }
613 : : }
614 : : return false;
615 : : }
616 : :
617 : : bool
618 : 1581 : gimple_simplify_76 (gimple_match_op *res_op, gimple_seq *seq,
619 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
620 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
621 : : {
622 : 1581 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
623 : 1581 : if (INTEGRAL_TYPE_P (type) || VECTOR_INTEGER_TYPE_P (type)
624 : : )
625 : : {
626 : 1581 : gimple_seq *lseq = seq;
627 : 1581 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail252;
628 : 1581 : {
629 : 1581 : res_op->set_op (NOP_EXPR, type, 1);
630 : 1581 : {
631 : 1581 : tree _o1[2], _r1;
632 : 1581 : _o1[0] = captures[0];
633 : 1581 : _o1[1] = captures[1];
634 : 1581 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
635 : 1581 : tem_op.resimplify (lseq, valueize);
636 : 1581 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
637 : 1581 : if (!_r1) goto next_after_fail252;
638 : 612 : res_op->ops[0] = _r1;
639 : : }
640 : 612 : res_op->resimplify (lseq, valueize);
641 : 612 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 144, __FILE__, __LINE__, true);
642 : 612 : return true;
643 : : }
644 : : next_after_fail252:;
645 : : }
646 : : return false;
647 : : }
648 : :
649 : : bool
650 : 20 : gimple_simplify_80 (gimple_match_op *res_op, gimple_seq *seq,
651 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
652 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
653 : : {
654 : 20 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
655 : 20 : if (!TYPE_OVERFLOW_SANITIZED (type) && !TYPE_OVERFLOW_TRAPS (type)
656 : 20 : && !TYPE_SATURATING (type) && !TYPE_OVERFLOW_SANITIZED (TREE_TYPE (captures[2]))
657 : 20 : && !TYPE_OVERFLOW_TRAPS (TREE_TYPE (captures[2]))
658 : 40 : && !TYPE_SATURATING (TREE_TYPE (captures[2]))
659 : : )
660 : : {
661 : 20 : gimple_seq *lseq = seq;
662 : 20 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail256;
663 : 20 : {
664 : 20 : res_op->set_op (BIT_NOT_EXPR, type, 1);
665 : 20 : {
666 : 20 : tree _o1[1], _r1;
667 : 20 : {
668 : 20 : tree _o2[2], _r2;
669 : 20 : _o2[0] = captures[0];
670 : 20 : _o2[1] = captures[1];
671 : 20 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
672 : 20 : tem_op.resimplify (lseq, valueize);
673 : 20 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
674 : 20 : if (!_r2) goto next_after_fail256;
675 : 10 : _o1[0] = _r2;
676 : : }
677 : 10 : if (type != TREE_TYPE (_o1[0])
678 : 10 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
679 : : {
680 : 6 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
681 : 6 : tem_op.resimplify (lseq, valueize);
682 : 6 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
683 : 6 : if (!_r1) goto next_after_fail256;
684 : : }
685 : : else
686 : : _r1 = _o1[0];
687 : 10 : res_op->ops[0] = _r1;
688 : : }
689 : 10 : res_op->resimplify (lseq, valueize);
690 : 10 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 148, __FILE__, __LINE__, true);
691 : 10 : return true;
692 : : }
693 : : next_after_fail256:;
694 : : }
695 : : return false;
696 : : }
697 : :
698 : : bool
699 : 1928 : gimple_simplify_87 (gimple_match_op *res_op, gimple_seq *seq,
700 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
701 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
702 : : {
703 : 1928 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
704 : 1928 : if (!TYPE_SATURATING (type)
705 : : )
706 : : {
707 : 1928 : if ((!FLOAT_TYPE_P (type) || flag_associative_math)
708 : 3637 : && !FIXED_POINT_TYPE_P (type)
709 : : )
710 : : {
711 : 4 : if (!ANY_INTEGRAL_TYPE_P (type)
712 : 1709 : || TYPE_OVERFLOW_WRAPS (type)
713 : : )
714 : : {
715 : 100 : gimple_seq *lseq = seq;
716 : 100 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail263;
717 : 100 : {
718 : 100 : res_op->set_op (NEGATE_EXPR, type, 1);
719 : 100 : {
720 : 100 : tree _o1[1], _r1;
721 : 100 : _o1[0] = captures[1];
722 : 100 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, type, _o1[0]);
723 : 100 : tem_op.resimplify (lseq, valueize);
724 : 100 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
725 : 100 : if (!_r1) goto next_after_fail263;
726 : 99 : res_op->ops[0] = _r1;
727 : : }
728 : 99 : res_op->resimplify (lseq, valueize);
729 : 99 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 154, __FILE__, __LINE__, true);
730 : 99 : return true;
731 : : }
732 : : next_after_fail263:;
733 : : }
734 : : else
735 : : {
736 : 1609 : gimple_seq *lseq = seq;
737 : 1609 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail264;
738 : 1609 : {
739 : 1609 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
740 : 1609 : {
741 : 1609 : tree _o1[1], _r1;
742 : 1609 : _o1[0] = captures[1];
743 : 1609 : gimple_match_op tem_op (res_op->cond.any_else (), NEGATE_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
744 : 1609 : tem_op.resimplify (lseq, valueize);
745 : 1609 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
746 : 1609 : if (!_r1) goto next_after_fail264;
747 : 494 : res_op->ops[0] = _r1;
748 : : }
749 : 494 : res_op->resimplify (lseq, valueize);
750 : 494 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 155, __FILE__, __LINE__, true);
751 : 494 : return true;
752 : : }
753 : : next_after_fail264:;
754 : : }
755 : : }
756 : : }
757 : : return false;
758 : : }
759 : :
760 : : bool
761 : 18 : gimple_simplify_96 (gimple_match_op *res_op, gimple_seq *seq,
762 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
763 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
764 : : {
765 : 18 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
766 : 18 : if (INTEGRAL_TYPE_P (type)
767 : : && (
768 : : 1
769 : : || !TREE_SIDE_EFFECTS (captures[1]))
770 : : )
771 : : {
772 : 18 : gimple_seq *lseq = seq;
773 : 18 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail278;
774 : 18 : {
775 : 18 : res_op->set_op (COND_EXPR, type, 3);
776 : 18 : {
777 : 18 : tree _o1[1], _r1;
778 : 18 : _o1[0] = captures[2];
779 : 18 : if (boolean_type_node != TREE_TYPE (_o1[0])
780 : 18 : && !useless_type_conversion_p (boolean_type_node, TREE_TYPE (_o1[0])))
781 : : {
782 : 18 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, boolean_type_node, _o1[0]);
783 : 18 : tem_op.resimplify (lseq, valueize);
784 : 18 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
785 : 18 : if (!_r1) goto next_after_fail278;
786 : : }
787 : : else
788 : : _r1 = _o1[0];
789 : 18 : res_op->ops[0] = _r1;
790 : : }
791 : 18 : res_op->ops[1] = captures[1];
792 : 18 : res_op->ops[2] = captures[0];
793 : 18 : res_op->resimplify (lseq, valueize);
794 : 18 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 169, __FILE__, __LINE__, true);
795 : 18 : return true;
796 : : }
797 : : next_after_fail278:;
798 : : }
799 : : return false;
800 : : }
801 : :
802 : : bool
803 : 1033 : gimple_simplify_101 (gimple_match_op *res_op, gimple_seq *seq,
804 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
805 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
806 : : const enum tree_code ARG_UNUSED (bitop),
807 : : const enum tree_code ARG_UNUSED (cmp))
808 : : {
809 : 1033 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
810 : 2066 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
811 : 953 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[2]))
812 : 1986 : && TYPE_PRECISION (TREE_TYPE (captures[0])) == TYPE_PRECISION (TREE_TYPE (captures[2]))
813 : : )
814 : : {
815 : 935 : gimple_seq *lseq = seq;
816 : 935 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail283;
817 : 935 : {
818 : 935 : res_op->set_op (cmp, type, 2);
819 : 935 : {
820 : 935 : tree _o1[2], _r1;
821 : 935 : _o1[0] = captures[0];
822 : 935 : {
823 : 935 : tree _o2[1], _r2;
824 : 935 : _o2[0] = captures[2];
825 : 935 : if (TREE_TYPE (_o1[0]) != TREE_TYPE (_o2[0])
826 : 935 : && !useless_type_conversion_p (TREE_TYPE (_o1[0]), TREE_TYPE (_o2[0])))
827 : : {
828 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, TREE_TYPE (_o1[0]), _o2[0]);
829 : 12 : tem_op.resimplify (lseq, valueize);
830 : 12 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
831 : 12 : if (!_r2) goto next_after_fail283;
832 : : }
833 : : else
834 : : _r2 = _o2[0];
835 : 925 : _o1[1] = _r2;
836 : : }
837 : 925 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
838 : 925 : tem_op.resimplify (lseq, valueize);
839 : 925 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
840 : 925 : if (!_r1) goto next_after_fail283;
841 : 20 : res_op->ops[0] = _r1;
842 : : }
843 : 20 : res_op->ops[1] = captures[1];
844 : 20 : res_op->resimplify (lseq, valueize);
845 : 20 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 174, __FILE__, __LINE__, true);
846 : 20 : return true;
847 : : }
848 : : next_after_fail283:;
849 : : }
850 : : return false;
851 : : }
852 : :
853 : : bool
854 : 0 : gimple_simplify_112 (gimple_match_op *res_op, gimple_seq *seq,
855 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
856 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
857 : : {
858 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
859 : 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
860 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[0])) == 1
861 : : )
862 : : {
863 : 0 : gimple_seq *lseq = seq;
864 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail294;
865 : 0 : {
866 : 0 : tree tem;
867 : 0 : tem = captures[2];
868 : 0 : res_op->set_value (tem);
869 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 183, __FILE__, __LINE__, true);
870 : 0 : return true;
871 : : }
872 : 0 : next_after_fail294:;
873 : : }
874 : : return false;
875 : : }
876 : :
877 : : bool
878 : 0 : gimple_simplify_120 (gimple_match_op *res_op, gimple_seq *seq,
879 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
880 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
881 : : {
882 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
883 : 0 : gimple_seq *lseq = seq;
884 : 0 : if (lseq
885 : 0 : && (!single_use (captures[0])
886 : 0 : || !single_use (captures[3])
887 : 0 : || !single_use (captures[4])))
888 : 0 : lseq = NULL;
889 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail302;
890 : 0 : {
891 : 0 : res_op->set_op (BIT_NOT_EXPR, type, 1);
892 : 0 : {
893 : 0 : tree _o1[2], _r1;
894 : 0 : _o1[0] = captures[1];
895 : 0 : _o1[1] = captures[2];
896 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
897 : 0 : tem_op.resimplify (lseq, valueize);
898 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
899 : 0 : if (!_r1) goto next_after_fail302;
900 : 0 : res_op->ops[0] = _r1;
901 : : }
902 : 0 : res_op->resimplify (lseq, valueize);
903 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 188, __FILE__, __LINE__, true);
904 : : return true;
905 : : }
906 : : next_after_fail302:;
907 : : return false;
908 : : }
909 : :
910 : : bool
911 : 2741 : gimple_simplify_130 (gimple_match_op *res_op, gimple_seq *seq,
912 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
913 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
914 : : const enum tree_code ARG_UNUSED (bitop),
915 : : const enum tree_code ARG_UNUSED (rbitop))
916 : : {
917 : 2741 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
918 : 2741 : gimple_seq *lseq = seq;
919 : 2741 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail316;
920 : 2741 : {
921 : 2741 : tree tem;
922 : 2741 : tem = captures[0];
923 : 2741 : res_op->set_value (tem);
924 : 2741 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 194, __FILE__, __LINE__, true);
925 : : return true;
926 : : }
927 : 0 : next_after_fail316:;
928 : 0 : return false;
929 : : }
930 : :
931 : : bool
932 : 0 : gimple_simplify_133 (gimple_match_op *res_op, gimple_seq *seq,
933 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
934 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
935 : : const enum tree_code ARG_UNUSED (bitop),
936 : : const enum tree_code ARG_UNUSED (rbitop))
937 : : {
938 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
939 : 0 : gimple_seq *lseq = seq;
940 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail319;
941 : 0 : {
942 : 0 : res_op->set_op (bitop, type, 2);
943 : 0 : res_op->ops[0] = captures[0];
944 : 0 : res_op->ops[1] = captures[2];
945 : 0 : res_op->resimplify (lseq, valueize);
946 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 197, __FILE__, __LINE__, true);
947 : : return true;
948 : : }
949 : 0 : next_after_fail319:;
950 : 0 : return false;
951 : : }
952 : :
953 : : bool
954 : 0 : gimple_simplify_137 (gimple_match_op *res_op, gimple_seq *seq,
955 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
956 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
957 : : const enum tree_code ARG_UNUSED (bitop),
958 : : const enum tree_code ARG_UNUSED (rbitop))
959 : : {
960 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
961 : 0 : gimple_seq *lseq = seq;
962 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail323;
963 : 0 : {
964 : 0 : res_op->set_op (bitop, type, 2);
965 : 0 : res_op->ops[0] = captures[0];
966 : 0 : res_op->ops[1] = captures[2];
967 : 0 : res_op->resimplify (lseq, valueize);
968 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 197, __FILE__, __LINE__, true);
969 : : return true;
970 : : }
971 : 0 : next_after_fail323:;
972 : 0 : return false;
973 : : }
974 : :
975 : : bool
976 : 670 : gimple_simplify_143 (gimple_match_op *res_op, gimple_seq *seq,
977 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
978 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
979 : : {
980 : 670 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
981 : 670 : gimple_seq *lseq = seq;
982 : 670 : if (lseq
983 : 308 : && (!single_use (captures[0])
984 : 111 : || !single_use (captures[3])))
985 : 568 : lseq = NULL;
986 : 670 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail333;
987 : 670 : {
988 : 670 : res_op->set_op (BIT_XOR_EXPR, type, 2);
989 : 670 : {
990 : 670 : tree _o1[2], _r1;
991 : 670 : {
992 : 670 : tree _o2[2], _r2;
993 : 670 : _o2[0] = captures[1];
994 : 670 : _o2[1] = captures[4];
995 : 670 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
996 : 670 : tem_op.resimplify (lseq, valueize);
997 : 670 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
998 : 670 : if (!_r2) goto next_after_fail333;
999 : 102 : _o1[0] = _r2;
1000 : : }
1001 : 102 : _o1[1] = captures[2];
1002 : 102 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
1003 : 102 : tem_op.resimplify (lseq, valueize);
1004 : 102 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1005 : 102 : if (!_r1) goto next_after_fail333;
1006 : 102 : res_op->ops[0] = _r1;
1007 : : }
1008 : 102 : res_op->ops[1] = captures[1];
1009 : 102 : res_op->resimplify (lseq, valueize);
1010 : 102 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 206, __FILE__, __LINE__, true);
1011 : : return true;
1012 : : }
1013 : : next_after_fail333:;
1014 : : return false;
1015 : : }
1016 : :
1017 : : bool
1018 : 314147 : gimple_simplify_150 (gimple_match_op *res_op, gimple_seq *seq,
1019 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1020 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1021 : : const enum tree_code ARG_UNUSED (code2),
1022 : : const enum tree_code ARG_UNUSED (code1))
1023 : : {
1024 : 314147 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1025 : 314147 : if ((TREE_CODE (captures[2]) == INTEGER_CST
1026 : 85052 : && TREE_CODE (captures[5]) == INTEGER_CST)
1027 : 329103 : || ((INTEGRAL_TYPE_P (TREE_TYPE (captures[2]))
1028 : 201957 : || POINTER_TYPE_P (TREE_TYPE (captures[2])))
1029 : 82817 : && bitwise_equal_p (captures[2], captures[5]))
1030 : : )
1031 : : {
1032 : 70106 : {
1033 : 70106 : bool one_before = false;
1034 : 70106 : bool one_after = false;
1035 : 70106 : int cmp = 0;
1036 : 70106 : bool allbits = true;
1037 : 70106 : if (TREE_CODE (captures[2]) == INTEGER_CST
1038 : 70096 : && TREE_CODE (captures[5]) == INTEGER_CST)
1039 : : {
1040 : 70096 : allbits = TYPE_PRECISION (TREE_TYPE (captures[2])) <= TYPE_PRECISION (TREE_TYPE (captures[5]));
1041 : 70096 : auto t1 = wi::to_wide (fold_convert (TREE_TYPE (captures[5]), captures[2]));
1042 : 70096 : auto t2 = wi::to_wide (captures[5]);
1043 : 70096 : cmp = wi::cmp (t1, t2, TYPE_SIGN (TREE_TYPE (captures[5])));
1044 : 70096 : if (cmp < 0
1045 : 70096 : && t1 == t2 - 1)
1046 : : one_before = true;
1047 : 70096 : if (cmp > 0
1048 : 70096 : && t1 == t2 + 1)
1049 : : one_after = true;
1050 : : }
1051 : 70106 : bool val;
1052 : 70106 : switch (code2)
1053 : : {
1054 : 66510 : case EQ_EXPR: val = (cmp == 0); break;
1055 : 0 : case NE_EXPR: val = (cmp != 0); break;
1056 : 706 : case LT_EXPR: val = (cmp < 0); break;
1057 : 584 : case GT_EXPR: val = (cmp > 0); break;
1058 : 2276 : case LE_EXPR: val = (cmp <= 0); break;
1059 : 30 : case GE_EXPR: val = (cmp >= 0); break;
1060 : 0 : default: gcc_unreachable ();
1061 : : }
1062 : 70106 : if (code1 == EQ_EXPR && val
1063 : : )
1064 : : {
1065 : 10 : gimple_seq *lseq = seq;
1066 : 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail346;
1067 : 10 : {
1068 : 10 : tree tem;
1069 : 10 : tem = captures[3];
1070 : 10 : res_op->set_value (tem);
1071 : 10 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 212, __FILE__, __LINE__, true);
1072 : 10 : return true;
1073 : : }
1074 : 0 : next_after_fail346:;
1075 : : }
1076 : : else
1077 : : {
1078 : 70096 : if (code1 == NE_EXPR && val && allbits
1079 : : )
1080 : : {
1081 : 4 : gimple_seq *lseq = seq;
1082 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail347;
1083 : 4 : {
1084 : 4 : tree tem;
1085 : 4 : tem = constant_boolean_node (true, type);
1086 : 4 : res_op->set_value (tem);
1087 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 213, __FILE__, __LINE__, true);
1088 : 4 : return true;
1089 : : }
1090 : 0 : next_after_fail347:;
1091 : 0 : }
1092 : : else
1093 : : {
1094 : 70092 : if (code1 == NE_EXPR && !val && allbits
1095 : : )
1096 : : {
1097 : 2 : gimple_seq *lseq = seq;
1098 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail348;
1099 : 2 : {
1100 : 2 : tree tem;
1101 : 2 : tem = captures[0];
1102 : 2 : res_op->set_value (tem);
1103 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 214, __FILE__, __LINE__, true);
1104 : 2 : return true;
1105 : : }
1106 : 0 : next_after_fail348:;
1107 : 0 : }
1108 : : else
1109 : : {
1110 : 70090 : if (code1 == EQ_EXPR
1111 : 70090 : && code2 == GT_EXPR
1112 : 584 : && cmp == 0
1113 : 584 : && allbits
1114 : : )
1115 : : {
1116 : 0 : gimple_seq *lseq = seq;
1117 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail349;
1118 : 0 : {
1119 : 0 : res_op->set_op (GE_EXPR, type, 2);
1120 : 0 : res_op->ops[0] = captures[4];
1121 : 0 : res_op->ops[1] = captures[5];
1122 : 0 : res_op->resimplify (lseq, valueize);
1123 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 215, __FILE__, __LINE__, true);
1124 : 0 : return true;
1125 : : }
1126 : 0 : next_after_fail349:;
1127 : 0 : }
1128 : : else
1129 : : {
1130 : 70090 : if (code1 == EQ_EXPR
1131 : 70090 : && code2 == LT_EXPR
1132 : 706 : && cmp == 0
1133 : 706 : && allbits
1134 : : )
1135 : : {
1136 : 4 : gimple_seq *lseq = seq;
1137 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail350;
1138 : 4 : {
1139 : 4 : res_op->set_op (LE_EXPR, type, 2);
1140 : 4 : res_op->ops[0] = captures[4];
1141 : 4 : res_op->ops[1] = captures[5];
1142 : 4 : res_op->resimplify (lseq, valueize);
1143 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 216, __FILE__, __LINE__, true);
1144 : 4 : return true;
1145 : : }
1146 : 0 : next_after_fail350:;
1147 : 0 : }
1148 : : else
1149 : : {
1150 : 70086 : if (code1 == EQ_EXPR
1151 : 70086 : && code2 == GE_EXPR
1152 : : && one_before
1153 : 30 : && allbits
1154 : : )
1155 : : {
1156 : 0 : gimple_seq *lseq = seq;
1157 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail351;
1158 : 0 : {
1159 : 0 : res_op->set_op (GE_EXPR, type, 2);
1160 : 0 : res_op->ops[0] = captures[4];
1161 : 0 : {
1162 : 0 : tree _o1[1], _r1;
1163 : 0 : _o1[0] = captures[2];
1164 : 0 : if (TREE_TYPE (res_op->ops[0]) != TREE_TYPE (_o1[0])
1165 : 0 : && !useless_type_conversion_p (TREE_TYPE (res_op->ops[0]), TREE_TYPE (_o1[0])))
1166 : : {
1167 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, TREE_TYPE (res_op->ops[0]), _o1[0]);
1168 : 0 : tem_op.resimplify (lseq, valueize);
1169 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1170 : 0 : if (!_r1) goto next_after_fail351;
1171 : : }
1172 : : else
1173 : : _r1 = _o1[0];
1174 : 0 : res_op->ops[1] = _r1;
1175 : : }
1176 : 0 : res_op->resimplify (lseq, valueize);
1177 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 217, __FILE__, __LINE__, true);
1178 : 0 : return true;
1179 : : }
1180 : : next_after_fail351:;
1181 : : }
1182 : : else
1183 : : {
1184 : 70086 : if (code1 == EQ_EXPR
1185 : 70086 : && code2 == LE_EXPR
1186 : : && one_after
1187 : 2260 : && allbits
1188 : : )
1189 : : {
1190 : 13 : gimple_seq *lseq = seq;
1191 : 13 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail352;
1192 : 13 : {
1193 : 13 : res_op->set_op (LE_EXPR, type, 2);
1194 : 13 : res_op->ops[0] = captures[4];
1195 : 13 : {
1196 : 13 : tree _o1[1], _r1;
1197 : 13 : _o1[0] = captures[2];
1198 : 13 : if (TREE_TYPE (res_op->ops[0]) != TREE_TYPE (_o1[0])
1199 : 13 : && !useless_type_conversion_p (TREE_TYPE (res_op->ops[0]), TREE_TYPE (_o1[0])))
1200 : : {
1201 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, TREE_TYPE (res_op->ops[0]), _o1[0]);
1202 : 0 : tem_op.resimplify (lseq, valueize);
1203 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1204 : 0 : if (!_r1) goto next_after_fail352;
1205 : : }
1206 : : else
1207 : : _r1 = _o1[0];
1208 : 13 : res_op->ops[1] = _r1;
1209 : : }
1210 : 13 : res_op->resimplify (lseq, valueize);
1211 : 13 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 218, __FILE__, __LINE__, true);
1212 : 13 : return true;
1213 : : }
1214 : : next_after_fail352:;
1215 : : }
1216 : : }
1217 : : }
1218 : : }
1219 : : }
1220 : : }
1221 : : }
1222 : : }
1223 : : }
1224 : : return false;
1225 : : }
1226 : :
1227 : : bool
1228 : 64 : gimple_simplify_182 (gimple_match_op *res_op, gimple_seq *seq,
1229 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1230 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1231 : : const combined_fn ARG_UNUSED (COPYSIGN_ALL))
1232 : : {
1233 : 64 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1234 : 64 : if (!tree_expr_maybe_nan_p (captures[0]) && !HONOR_SIGNED_ZEROS (type)
1235 : : )
1236 : : {
1237 : 0 : gimple_seq *lseq = seq;
1238 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail404;
1239 : 0 : {
1240 : 0 : res_op->set_op (ABS_EXPR, type, 1);
1241 : 0 : res_op->ops[0] = captures[0];
1242 : 0 : res_op->resimplify (lseq, valueize);
1243 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 234, __FILE__, __LINE__, true);
1244 : 0 : return true;
1245 : : }
1246 : 0 : next_after_fail404:;
1247 : : }
1248 : : return false;
1249 : : }
1250 : :
1251 : : bool
1252 : 0 : gimple_simplify_188 (gimple_match_op *res_op, gimple_seq *seq,
1253 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1254 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
1255 : : {
1256 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1257 : 0 : gimple_seq *lseq = seq;
1258 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail410;
1259 : 0 : {
1260 : 0 : tree tem;
1261 : 0 : tem = build_zero_cst (type);
1262 : 0 : res_op->set_value (tem);
1263 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 239, __FILE__, __LINE__, true);
1264 : : return true;
1265 : : }
1266 : 0 : next_after_fail410:;
1267 : 0 : return false;
1268 : : }
1269 : :
1270 : : bool
1271 : 68045 : gimple_simplify_195 (gimple_match_op *res_op, gimple_seq *seq,
1272 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1273 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
1274 : : {
1275 : 68045 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1276 : 68045 : gimple_seq *lseq = seq;
1277 : 68045 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail419;
1278 : 68045 : {
1279 : 68045 : res_op->set_op (NOP_EXPR, type, 1);
1280 : 68045 : res_op->ops[0] = captures[0];
1281 : 68045 : res_op->resimplify (lseq, valueize);
1282 : 68045 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 244, __FILE__, __LINE__, true);
1283 : : return true;
1284 : : }
1285 : 0 : next_after_fail419:;
1286 : 0 : return false;
1287 : : }
1288 : :
1289 : : bool
1290 : 0 : gimple_simplify_200 (gimple_match_op *res_op, gimple_seq *seq,
1291 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1292 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1293 : : const combined_fn ARG_UNUSED (TAN),
1294 : : const combined_fn ARG_UNUSED (COS),
1295 : : const combined_fn ARG_UNUSED (SIN))
1296 : : {
1297 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1298 : 0 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
1299 : : )
1300 : : {
1301 : 0 : gimple_seq *lseq = seq;
1302 : 0 : if (lseq
1303 : 0 : && (!single_use (captures[0])
1304 : 0 : || !single_use (captures[2])))
1305 : 0 : lseq = NULL;
1306 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail425;
1307 : 0 : {
1308 : 0 : res_op->set_op (SIN, type, 1);
1309 : 0 : res_op->ops[0] = captures[1];
1310 : 0 : res_op->resimplify (lseq, valueize);
1311 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 250, __FILE__, __LINE__, true);
1312 : 0 : return true;
1313 : : }
1314 : 0 : next_after_fail425:;
1315 : : }
1316 : : return false;
1317 : : }
1318 : :
1319 : : bool
1320 : 1441 : gimple_simplify_206 (gimple_match_op *res_op, gimple_seq *seq,
1321 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1322 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
1323 : : {
1324 : 1441 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1325 : 2882 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
1326 : 2882 : && TYPE_PRECISION (TREE_TYPE (captures[1])) == 1
1327 : : )
1328 : : {
1329 : 1441 : gimple_seq *lseq = seq;
1330 : 1441 : if (lseq
1331 : 472 : && (!single_use (captures[0])))
1332 : 991 : lseq = NULL;
1333 : 1441 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail431;
1334 : 1441 : {
1335 : 1441 : res_op->set_op (NOP_EXPR, type, 1);
1336 : 1441 : {
1337 : 1441 : tree _o1[2], _r1;
1338 : 1441 : _o1[0] = captures[1];
1339 : 1441 : _o1[1] = captures[2];
1340 : 1441 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
1341 : 1441 : tem_op.resimplify (lseq, valueize);
1342 : 1441 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1343 : 1441 : if (!_r1) goto next_after_fail431;
1344 : 742 : res_op->ops[0] = _r1;
1345 : : }
1346 : 742 : res_op->resimplify (lseq, valueize);
1347 : 742 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 256, __FILE__, __LINE__, true);
1348 : 742 : return true;
1349 : : }
1350 : : next_after_fail431:;
1351 : : }
1352 : : return false;
1353 : : }
1354 : :
1355 : : bool
1356 : 35902 : gimple_simplify_215 (gimple_match_op *res_op, gimple_seq *seq,
1357 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1358 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1359 : : const enum tree_code ARG_UNUSED (op))
1360 : : {
1361 : 35902 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1362 : 71804 : if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
1363 : 71630 : && (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
1364 : 24176 : || ((op == EQ_EXPR || op == NE_EXPR)
1365 : 10364 : && TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[0]))))
1366 : 93720 : && (CONSTANT_CLASS_P (captures[2]) || single_use (captures[1]))
1367 : : )
1368 : : {
1369 : 1719 : gimple_seq *lseq = seq;
1370 : 1719 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail456;
1371 : 1719 : {
1372 : 1719 : res_op->set_op (op, type, 2);
1373 : 1719 : res_op->ops[0] = captures[2];
1374 : 1719 : res_op->ops[1] = build_zero_cst (TREE_TYPE (captures[2]));
1375 : 1719 : res_op->resimplify (lseq, valueize);
1376 : 1719 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 280, __FILE__, __LINE__, true);
1377 : 1719 : return true;
1378 : : }
1379 : 0 : next_after_fail456:;
1380 : : }
1381 : : return false;
1382 : : }
1383 : :
1384 : : bool
1385 : 40 : gimple_simplify_222 (gimple_match_op *res_op, gimple_seq *seq,
1386 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1387 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1388 : : const enum tree_code ARG_UNUSED (cmp))
1389 : : {
1390 : 40 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1391 : 40 : if (TREE_INT_CST_LOW (captures[1]) & 1
1392 : : )
1393 : : {
1394 : 8 : gimple_seq *lseq = seq;
1395 : 8 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail463;
1396 : 8 : {
1397 : 8 : tree tem;
1398 : 8 : tem = constant_boolean_node (cmp == NE_EXPR, type);
1399 : 8 : res_op->set_value (tem);
1400 : 8 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 286, __FILE__, __LINE__, true);
1401 : 8 : return true;
1402 : : }
1403 : 0 : next_after_fail463:;
1404 : : }
1405 : : return false;
1406 : : }
1407 : :
1408 : : bool
1409 : 1181 : gimple_simplify_227 (gimple_match_op *res_op, gimple_seq *seq,
1410 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1411 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1412 : : const enum tree_code ARG_UNUSED (cmp))
1413 : : {
1414 : 1181 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1415 : 1181 : if (wi::gt_p (wi::to_wide (captures[1]), wi::to_wide (captures[2]),
1416 : 1181 : TYPE_SIGN (TREE_TYPE (captures[0])))
1417 : : )
1418 : : {
1419 : 4 : gimple_seq *lseq = seq;
1420 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail469;
1421 : 4 : {
1422 : 4 : tree tem;
1423 : 4 : tem = constant_boolean_node (cmp == NE_EXPR, type);
1424 : 4 : res_op->set_value (tem);
1425 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 292, __FILE__, __LINE__, true);
1426 : 4 : return true;
1427 : : }
1428 : 0 : next_after_fail469:;
1429 : : }
1430 : : else
1431 : : {
1432 : 1177 : if (wi::lt_p (wi::to_wide (captures[1]), wi::to_wide (captures[2]),
1433 : 1177 : TYPE_SIGN (TREE_TYPE (captures[0])))
1434 : : )
1435 : : {
1436 : 1177 : gimple_seq *lseq = seq;
1437 : 1177 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail470;
1438 : 1177 : {
1439 : 1177 : res_op->set_op (cmp, type, 2);
1440 : 1177 : res_op->ops[0] = captures[0];
1441 : 1177 : res_op->ops[1] = captures[2];
1442 : 1177 : res_op->resimplify (lseq, valueize);
1443 : 1177 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 293, __FILE__, __LINE__, true);
1444 : 1177 : return true;
1445 : : }
1446 : 0 : next_after_fail470:;
1447 : : }
1448 : : }
1449 : : return false;
1450 : : }
1451 : :
1452 : : bool
1453 : 2 : gimple_simplify_235 (gimple_match_op *res_op, gimple_seq *seq,
1454 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1455 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1456 : : const enum tree_code ARG_UNUSED (rotate),
1457 : : const enum tree_code ARG_UNUSED (invrot),
1458 : : const enum tree_code ARG_UNUSED (cmp))
1459 : : {
1460 : 2 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1461 : 2 : gimple_seq *lseq = seq;
1462 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail488;
1463 : 2 : {
1464 : 2 : res_op->set_op (cmp, type, 2);
1465 : 2 : res_op->ops[0] = captures[0];
1466 : 2 : res_op->ops[1] = captures[2];
1467 : 2 : res_op->resimplify (lseq, valueize);
1468 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 311, __FILE__, __LINE__, true);
1469 : : return true;
1470 : : }
1471 : 0 : next_after_fail488:;
1472 : 0 : return false;
1473 : : }
1474 : :
1475 : : bool
1476 : 180 : gimple_simplify_240 (gimple_match_op *res_op, gimple_seq *seq,
1477 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1478 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1479 : : const enum tree_code ARG_UNUSED (cmp),
1480 : : const combined_fn ARG_UNUSED (bswap))
1481 : : {
1482 : 180 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1483 : 180 : {
1484 : 180 : tree ctype = TREE_TYPE (captures[1]);
1485 : 180 : gimple_seq *lseq = seq;
1486 : 180 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail493;
1487 : 180 : {
1488 : 180 : res_op->set_op (cmp, type, 2);
1489 : 180 : {
1490 : 180 : tree _o1[1], _r1;
1491 : 180 : _o1[0] = captures[0];
1492 : 180 : if (ctype != TREE_TYPE (_o1[0])
1493 : 180 : && !useless_type_conversion_p (ctype, TREE_TYPE (_o1[0])))
1494 : : {
1495 : 63 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, ctype, _o1[0]);
1496 : 63 : tem_op.resimplify (lseq, valueize);
1497 : 63 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1498 : 63 : if (!_r1) goto next_after_fail493;
1499 : : }
1500 : : else
1501 : : _r1 = _o1[0];
1502 : 180 : res_op->ops[0] = _r1;
1503 : : }
1504 : 180 : {
1505 : 180 : tree _o1[1], _r1;
1506 : 180 : _o1[0] = captures[1];
1507 : 180 : gimple_match_op tem_op (res_op->cond.any_else (), bswap, TREE_TYPE (_o1[0]), _o1[0]);
1508 : 180 : tem_op.resimplify (NULL, valueize);
1509 : 180 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
1510 : 180 : if (!_r1) goto next_after_fail493;
1511 : 180 : res_op->ops[1] = _r1;
1512 : : }
1513 : 180 : res_op->resimplify (lseq, valueize);
1514 : 180 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 316, __FILE__, __LINE__, true);
1515 : : return true;
1516 : : }
1517 : : next_after_fail493:;
1518 : : }
1519 : : return false;
1520 : : }
1521 : :
1522 : : bool
1523 : 451757 : gimple_simplify_250 (gimple_match_op *res_op, gimple_seq *seq,
1524 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1525 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1526 : : const enum tree_code ARG_UNUSED (cmp),
1527 : : const enum tree_code ARG_UNUSED (scmp))
1528 : : {
1529 : 451757 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1530 : 451757 : if (single_use (captures[0])
1531 : 411629 : && (TREE_CODE (captures[2]) == INTEGER_CST || TREE_CODE (captures[2]) == VECTOR_CST)
1532 : : )
1533 : : {
1534 : 411629 : {
1535 : 411629 : tree otype = TREE_TYPE (captures[2]);
1536 : 411629 : gimple_seq *lseq = seq;
1537 : 411629 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail509;
1538 : 411629 : {
1539 : 411629 : res_op->set_op (scmp, type, 2);
1540 : 411629 : {
1541 : 411629 : tree _o1[1], _r1;
1542 : 411629 : _o1[0] = captures[1];
1543 : 411629 : if (otype != TREE_TYPE (_o1[0])
1544 : 411629 : && !useless_type_conversion_p (otype, TREE_TYPE (_o1[0])))
1545 : : {
1546 : 511 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, otype, _o1[0]);
1547 : 511 : tem_op.resimplify (lseq, valueize);
1548 : 511 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1549 : 511 : if (!_r1) goto next_after_fail509;
1550 : : }
1551 : : else
1552 : : _r1 = _o1[0];
1553 : 411280 : res_op->ops[0] = _r1;
1554 : : }
1555 : 411280 : {
1556 : 411280 : tree _o1[1], _r1;
1557 : 411280 : _o1[0] = captures[2];
1558 : 411280 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_NOT_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
1559 : 411280 : tem_op.resimplify (lseq, valueize);
1560 : 411280 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1561 : 411280 : if (!_r1) goto next_after_fail509;
1562 : 411280 : res_op->ops[1] = _r1;
1563 : : }
1564 : 411280 : res_op->resimplify (lseq, valueize);
1565 : 411280 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 331, __FILE__, __LINE__, true);
1566 : 411280 : return true;
1567 : : }
1568 : : next_after_fail509:;
1569 : : }
1570 : : }
1571 : : return false;
1572 : : }
1573 : :
1574 : : bool
1575 : 1066 : gimple_simplify_255 (gimple_match_op *res_op, gimple_seq *seq,
1576 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
1577 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
1578 : : const combined_fn ARG_UNUSED (sq),
1579 : : const enum tree_code ARG_UNUSED (cmp))
1580 : : {
1581 : 1066 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
1582 : 1066 : if (flag_unsafe_math_optimizations && ! flag_errno_math
1583 : : )
1584 : : {
1585 : 211 : if (REAL_VALUE_NEGATIVE (TREE_REAL_CST (captures[1]))
1586 : : )
1587 : : {
1588 : 0 : if (cmp == EQ_EXPR || cmp == LT_EXPR || cmp == LE_EXPR
1589 : : )
1590 : : {
1591 : 0 : gimple_seq *lseq = seq;
1592 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail528;
1593 : 0 : {
1594 : 0 : tree tem;
1595 : 0 : tem = constant_boolean_node (false, type);
1596 : 0 : res_op->set_value (tem);
1597 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 349, __FILE__, __LINE__, true);
1598 : 0 : return true;
1599 : : }
1600 : 0 : next_after_fail528:;
1601 : 0 : }
1602 : : else
1603 : : {
1604 : 0 : if (cmp == NE_EXPR || !HONOR_NANS (captures[0])
1605 : : )
1606 : : {
1607 : 0 : gimple_seq *lseq = seq;
1608 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail529;
1609 : 0 : {
1610 : 0 : tree tem;
1611 : 0 : tem = constant_boolean_node (true, type);
1612 : 0 : res_op->set_value (tem);
1613 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 350, __FILE__, __LINE__, true);
1614 : 0 : return true;
1615 : : }
1616 : 0 : next_after_fail529:;
1617 : : }
1618 : : else
1619 : : {
1620 : 0 : gimple_seq *lseq = seq;
1621 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail530;
1622 : 0 : {
1623 : 0 : res_op->set_op (GE_EXPR, type, 2);
1624 : 0 : res_op->ops[0] = captures[0];
1625 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), dconst0);
1626 : 0 : res_op->resimplify (lseq, valueize);
1627 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 351, __FILE__, __LINE__, true);
1628 : 0 : return true;
1629 : : }
1630 : 0 : next_after_fail530:;
1631 : : }
1632 : : }
1633 : : }
1634 : : else
1635 : : {
1636 : 211 : if (real_equal (TREE_REAL_CST_PTR (captures[1]), &dconst0)
1637 : : )
1638 : : {
1639 : 180 : if (cmp == LT_EXPR
1640 : : )
1641 : : {
1642 : 18 : gimple_seq *lseq = seq;
1643 : 18 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail531;
1644 : 18 : {
1645 : 18 : tree tem;
1646 : 18 : tem = constant_boolean_node (false, type);
1647 : 18 : res_op->set_value (tem);
1648 : 18 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 352, __FILE__, __LINE__, true);
1649 : 18 : return true;
1650 : : }
1651 : 0 : next_after_fail531:;
1652 : : }
1653 : : else
1654 : : {
1655 : 162 : if (cmp == GE_EXPR && !HONOR_NANS (captures[0])
1656 : : )
1657 : : {
1658 : 18 : gimple_seq *lseq = seq;
1659 : 18 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail532;
1660 : 18 : {
1661 : 18 : tree tem;
1662 : 18 : tem = constant_boolean_node (true, type);
1663 : 18 : res_op->set_value (tem);
1664 : 18 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 353, __FILE__, __LINE__, true);
1665 : 18 : return true;
1666 : : }
1667 : 0 : next_after_fail532:;
1668 : : }
1669 : : else
1670 : : {
1671 : 144 : if (cmp == LE_EXPR
1672 : : )
1673 : : {
1674 : 36 : gimple_seq *lseq = seq;
1675 : 36 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail533;
1676 : 36 : {
1677 : 36 : res_op->set_op (EQ_EXPR, type, 2);
1678 : 36 : res_op->ops[0] = captures[0];
1679 : 36 : res_op->ops[1] = captures[1];
1680 : 36 : res_op->resimplify (lseq, valueize);
1681 : 36 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 354, __FILE__, __LINE__, true);
1682 : 36 : return true;
1683 : : }
1684 : 0 : next_after_fail533:;
1685 : : }
1686 : : else
1687 : : {
1688 : 108 : gimple_seq *lseq = seq;
1689 : 108 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail534;
1690 : 108 : {
1691 : 108 : res_op->set_op (cmp, type, 2);
1692 : 108 : res_op->ops[0] = captures[0];
1693 : 108 : res_op->ops[1] = captures[1];
1694 : 108 : res_op->resimplify (lseq, valueize);
1695 : 108 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 355, __FILE__, __LINE__, true);
1696 : 108 : return true;
1697 : : }
1698 : 0 : next_after_fail534:;
1699 : : }
1700 : : }
1701 : : }
1702 : : }
1703 : : else
1704 : : {
1705 : 31 : if ((cmp == LT_EXPR
1706 : : || cmp == LE_EXPR
1707 : : || cmp == GT_EXPR
1708 : 31 : || cmp == GE_EXPR)
1709 : 31 : && !REAL_VALUE_ISNAN (TREE_REAL_CST (captures[1]))
1710 : 62 : && !HONOR_SIGN_DEPENDENT_ROUNDING (TREE_TYPE (captures[0]))
1711 : : )
1712 : : {
1713 : 31 : {
1714 : 31 : REAL_VALUE_TYPE c2;
1715 : 31 : enum tree_code ncmp = cmp;
1716 : 31 : const real_format *fmt
1717 : 31 : = REAL_MODE_FORMAT (TYPE_MODE (TREE_TYPE (captures[0])));
1718 : 62 : real_arithmetic (&c2, MULT_EXPR,
1719 : 31 : &TREE_REAL_CST (captures[1]), &TREE_REAL_CST (captures[1]));
1720 : 31 : real_convert (&c2, fmt, &c2);
1721 : 31 : if (!REAL_VALUE_ISINF (c2))
1722 : : {
1723 : 17 : tree c3 = fold_const_call (CFN_SQRT, TREE_TYPE (captures[0]),
1724 : 17 : build_real (TREE_TYPE (captures[0]), c2));
1725 : 17 : if (c3 == NULL_TREE || TREE_CODE (c3) != REAL_CST)
1726 : : ncmp = ERROR_MARK;
1727 : 17 : else if ((cmp == LT_EXPR || cmp == GE_EXPR)
1728 : 17 : && real_less (&TREE_REAL_CST (c3), &TREE_REAL_CST (captures[1])))
1729 : 0 : ncmp = cmp == LT_EXPR ? LE_EXPR : GT_EXPR;
1730 : 17 : else if ((cmp == LE_EXPR || cmp == GT_EXPR)
1731 : 20 : && real_less (&TREE_REAL_CST (captures[1]), &TREE_REAL_CST (c3)))
1732 : 0 : ncmp = cmp == LE_EXPR ? LT_EXPR : GE_EXPR;
1733 : : else
1734 : : {
1735 : 17 : REAL_VALUE_TYPE c2alt, tow;
1736 : 17 : if (cmp == LT_EXPR || cmp == GE_EXPR)
1737 : 14 : tow = dconst0;
1738 : : else
1739 : 3 : tow = dconstinf;
1740 : 17 : real_nextafter (&c2alt, fmt, &c2, &tow);
1741 : 17 : real_convert (&c2alt, fmt, &c2alt);
1742 : 17 : if (REAL_VALUE_ISINF (c2alt))
1743 : : ncmp = ERROR_MARK;
1744 : : else
1745 : : {
1746 : 17 : c3 = fold_const_call (CFN_SQRT, TREE_TYPE (captures[0]),
1747 : 17 : build_real (TREE_TYPE (captures[0]), c2alt));
1748 : 17 : if (c3 == NULL_TREE || TREE_CODE (c3) != REAL_CST)
1749 : : ncmp = ERROR_MARK;
1750 : 17 : else if (real_equal (&TREE_REAL_CST (c3),
1751 : 17 : &TREE_REAL_CST (captures[1])))
1752 : 17 : c2 = c2alt;
1753 : : }
1754 : : }
1755 : : }
1756 : 31 : if (cmp == GT_EXPR || cmp == GE_EXPR
1757 : : )
1758 : : {
1759 : 3 : if (REAL_VALUE_ISINF (c2)
1760 : : )
1761 : : {
1762 : 0 : if (HONOR_INFINITIES (captures[0])
1763 : : )
1764 : : {
1765 : 0 : gimple_seq *lseq = seq;
1766 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail535;
1767 : 0 : {
1768 : 0 : res_op->set_op (EQ_EXPR, type, 2);
1769 : 0 : res_op->ops[0] = captures[0];
1770 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), c2);
1771 : 0 : res_op->resimplify (lseq, valueize);
1772 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 356, __FILE__, __LINE__, true);
1773 : 3 : return true;
1774 : : }
1775 : 0 : next_after_fail535:;
1776 : : }
1777 : : else
1778 : : {
1779 : 0 : gimple_seq *lseq = seq;
1780 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail536;
1781 : 0 : {
1782 : 0 : tree tem;
1783 : 0 : tem = constant_boolean_node (false, type);
1784 : 0 : res_op->set_value (tem);
1785 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 357, __FILE__, __LINE__, true);
1786 : 0 : return true;
1787 : : }
1788 : 0 : next_after_fail536:;
1789 : : }
1790 : : }
1791 : : else
1792 : : {
1793 : 3 : if (ncmp != ERROR_MARK
1794 : : )
1795 : : {
1796 : 3 : if (ncmp == GE_EXPR
1797 : : )
1798 : : {
1799 : 0 : gimple_seq *lseq = seq;
1800 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail537;
1801 : 0 : {
1802 : 0 : res_op->set_op (GE_EXPR, type, 2);
1803 : 0 : res_op->ops[0] = captures[0];
1804 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), c2);
1805 : 0 : res_op->resimplify (lseq, valueize);
1806 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 358, __FILE__, __LINE__, true);
1807 : 0 : return true;
1808 : : }
1809 : 0 : next_after_fail537:;
1810 : : }
1811 : : else
1812 : : {
1813 : 3 : gimple_seq *lseq = seq;
1814 : 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail538;
1815 : 3 : {
1816 : 3 : res_op->set_op (GT_EXPR, type, 2);
1817 : 3 : res_op->ops[0] = captures[0];
1818 : 3 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), c2);
1819 : 3 : res_op->resimplify (lseq, valueize);
1820 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 359, __FILE__, __LINE__, true);
1821 : 3 : return true;
1822 : : }
1823 : 0 : next_after_fail538:;
1824 : : }
1825 : : }
1826 : : }
1827 : : }
1828 : : else
1829 : : {
1830 : 28 : if (REAL_VALUE_ISINF (c2)
1831 : : )
1832 : : {
1833 : 14 : if (! HONOR_NANS (captures[0]) && ! HONOR_INFINITIES (captures[0])
1834 : : )
1835 : : {
1836 : 0 : gimple_seq *lseq = seq;
1837 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail539;
1838 : 0 : {
1839 : 0 : tree tem;
1840 : 0 : tem = constant_boolean_node (true, type);
1841 : 0 : res_op->set_value (tem);
1842 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 360, __FILE__, __LINE__, true);
1843 : 0 : return true;
1844 : : }
1845 : 0 : next_after_fail539:;
1846 : : }
1847 : : else
1848 : : {
1849 : 14 : if (! HONOR_NANS (captures[0])
1850 : : )
1851 : : {
1852 : 0 : gimple_seq *lseq = seq;
1853 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail540;
1854 : 0 : {
1855 : 0 : res_op->set_op (NE_EXPR, type, 2);
1856 : 0 : res_op->ops[0] = captures[0];
1857 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), c2);
1858 : 0 : res_op->resimplify (lseq, valueize);
1859 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 361, __FILE__, __LINE__, true);
1860 : 0 : return true;
1861 : : }
1862 : 0 : next_after_fail540:;
1863 : : }
1864 : : else
1865 : : {
1866 : 14 : if (! HONOR_INFINITIES (captures[0])
1867 : : )
1868 : : {
1869 : 0 : gimple_seq *lseq = seq;
1870 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail541;
1871 : 0 : {
1872 : 0 : res_op->set_op (GE_EXPR, type, 2);
1873 : 0 : res_op->ops[0] = captures[0];
1874 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), dconst0);
1875 : 0 : res_op->resimplify (lseq, valueize);
1876 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 362, __FILE__, __LINE__, true);
1877 : 0 : return true;
1878 : : }
1879 : 0 : next_after_fail541:;
1880 : : }
1881 : : else
1882 : : {
1883 : : if (0
1884 : : )
1885 : : {
1886 : : gimple_seq *lseq = seq;
1887 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail542;
1888 : : {
1889 : : res_op->set_op (TRUTH_ANDIF_EXPR, type, 2);
1890 : : {
1891 : : tree _o1[2], _r1;
1892 : : _o1[0] = captures[0];
1893 : : _o1[1] = build_real (TREE_TYPE (captures[0]), dconst0);
1894 : : gimple_match_op tem_op (res_op->cond.any_else (), GE_EXPR, type, _o1[0], _o1[1]);
1895 : : tem_op.resimplify (lseq, valueize);
1896 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1897 : : if (!_r1) goto next_after_fail542;
1898 : : res_op->ops[0] = _r1;
1899 : : }
1900 : : {
1901 : : tree _o1[2], _r1;
1902 : : _o1[0] = captures[0];
1903 : : _o1[1] = build_real (TREE_TYPE (captures[0]), c2);
1904 : : gimple_match_op tem_op (res_op->cond.any_else (), NE_EXPR, type, _o1[0], _o1[1]);
1905 : : tem_op.resimplify (lseq, valueize);
1906 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1907 : : if (!_r1) goto next_after_fail542;
1908 : : res_op->ops[1] = _r1;
1909 : : }
1910 : : res_op->resimplify (lseq, valueize);
1911 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 363, __FILE__, __LINE__, true);
1912 : : return true;
1913 : : }
1914 : : next_after_fail542:;
1915 : : }
1916 : : }
1917 : : }
1918 : : }
1919 : : }
1920 : : else
1921 : : {
1922 : 14 : if (ncmp != ERROR_MARK && ! HONOR_NANS (captures[0])
1923 : : )
1924 : : {
1925 : 0 : if (ncmp == LT_EXPR
1926 : : )
1927 : : {
1928 : 0 : gimple_seq *lseq = seq;
1929 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail543;
1930 : 0 : {
1931 : 0 : res_op->set_op (LT_EXPR, type, 2);
1932 : 0 : res_op->ops[0] = captures[0];
1933 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), c2);
1934 : 0 : res_op->resimplify (lseq, valueize);
1935 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 364, __FILE__, __LINE__, true);
1936 : 0 : return true;
1937 : : }
1938 : 0 : next_after_fail543:;
1939 : : }
1940 : : else
1941 : : {
1942 : 0 : gimple_seq *lseq = seq;
1943 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail544;
1944 : 0 : {
1945 : 0 : res_op->set_op (LE_EXPR, type, 2);
1946 : 0 : res_op->ops[0] = captures[0];
1947 : 0 : res_op->ops[1] = build_real (TREE_TYPE (captures[0]), c2);
1948 : 0 : res_op->resimplify (lseq, valueize);
1949 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 365, __FILE__, __LINE__, true);
1950 : 0 : return true;
1951 : : }
1952 : 0 : next_after_fail544:;
1953 : : }
1954 : : }
1955 : : else
1956 : : {
1957 : : if (ncmp != ERROR_MARK &&
1958 : :
1959 : : )
1960 : : {
1961 : : if (ncmp == LT_EXPR
1962 : : )
1963 : : {
1964 : : gimple_seq *lseq = seq;
1965 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail545;
1966 : : {
1967 : : res_op->set_op (TRUTH_ANDIF_EXPR, type, 2);
1968 : : {
1969 : : tree _o1[2], _r1;
1970 : : _o1[0] = captures[0];
1971 : : _o1[1] = build_real (TREE_TYPE (captures[0]), dconst0);
1972 : : gimple_match_op tem_op (res_op->cond.any_else (), GE_EXPR, type, _o1[0], _o1[1]);
1973 : : tem_op.resimplify (lseq, valueize);
1974 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1975 : : if (!_r1) goto next_after_fail545;
1976 : : res_op->ops[0] = _r1;
1977 : : }
1978 : : {
1979 : : tree _o1[2], _r1;
1980 : : _o1[0] = captures[0];
1981 : : _o1[1] = build_real (TREE_TYPE (captures[0]), c2);
1982 : : gimple_match_op tem_op (res_op->cond.any_else (), LT_EXPR, type, _o1[0], _o1[1]);
1983 : : tem_op.resimplify (lseq, valueize);
1984 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
1985 : : if (!_r1) goto next_after_fail545;
1986 : : res_op->ops[1] = _r1;
1987 : : }
1988 : : res_op->resimplify (lseq, valueize);
1989 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 366, __FILE__, __LINE__, true);
1990 : : return true;
1991 : : }
1992 : : next_after_fail545:;
1993 : : }
1994 : : else
1995 : : {
1996 : : gimple_seq *lseq = seq;
1997 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail546;
1998 : : {
1999 : : res_op->set_op (TRUTH_ANDIF_EXPR, type, 2);
2000 : : {
2001 : : tree _o1[2], _r1;
2002 : : _o1[0] = captures[0];
2003 : : _o1[1] = build_real (TREE_TYPE (captures[0]), dconst0);
2004 : : gimple_match_op tem_op (res_op->cond.any_else (), GE_EXPR, type, _o1[0], _o1[1]);
2005 : : tem_op.resimplify (lseq, valueize);
2006 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2007 : : if (!_r1) goto next_after_fail546;
2008 : : res_op->ops[0] = _r1;
2009 : : }
2010 : : {
2011 : : tree _o1[2], _r1;
2012 : : _o1[0] = captures[0];
2013 : : _o1[1] = build_real (TREE_TYPE (captures[0]), c2);
2014 : : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
2015 : : tem_op.resimplify (lseq, valueize);
2016 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2017 : : if (!_r1) goto next_after_fail546;
2018 : : res_op->ops[1] = _r1;
2019 : : }
2020 : : res_op->resimplify (lseq, valueize);
2021 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 367, __FILE__, __LINE__, true);
2022 : : return true;
2023 : : }
2024 : : next_after_fail546:;
2025 : : }
2026 : : }
2027 : : }
2028 : : }
2029 : : }
2030 : : }
2031 : : }
2032 : : }
2033 : : }
2034 : : }
2035 : : return false;
2036 : : }
2037 : :
2038 : : bool
2039 : 8584 : gimple_simplify_313 (gimple_match_op *res_op, gimple_seq *seq,
2040 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2041 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2042 : : const enum tree_code ARG_UNUSED (div))
2043 : : {
2044 : 8584 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2045 : 8584 : if (ANY_INTEGRAL_TYPE_P (type)
2046 : : )
2047 : : {
2048 : 8584 : if (TYPE_OVERFLOW_UNDEFINED (type) && !TYPE_OVERFLOW_SANITIZED (type)
2049 : : )
2050 : : {
2051 : 4075 : gimple_seq *lseq = seq;
2052 : 4075 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail658;
2053 : 4075 : {
2054 : 4075 : tree tem;
2055 : 4075 : tem = captures[0];
2056 : 4075 : res_op->set_value (tem);
2057 : 4075 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 460, __FILE__, __LINE__, true);
2058 : 4075 : return true;
2059 : : }
2060 : 0 : next_after_fail658:;
2061 : : }
2062 : : else
2063 : : {
2064 : 4509 : {
2065 : 4509 : value_range vr0, vr1;
2066 : 4509 : if (INTEGRAL_TYPE_P (type)
2067 : 8986 : && get_range_query (cfun)->range_of_expr (vr0, captures[0])
2068 : 8986 : && get_range_query (cfun)->range_of_expr (vr1, captures[1])
2069 : 9002 : && range_op_handler (MULT_EXPR).overflow_free_p (vr0, vr1)
2070 : : )
2071 : : {
2072 : 45 : gimple_seq *lseq = seq;
2073 : 45 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail659;
2074 : 45 : {
2075 : 45 : tree tem;
2076 : 45 : tem = captures[0];
2077 : 45 : res_op->set_value (tem);
2078 : 45 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 461, __FILE__, __LINE__, true);
2079 : 45 : return true;
2080 : : }
2081 : 0 : next_after_fail659:;
2082 : : }
2083 : 4509 : }
2084 : : }
2085 : : }
2086 : : return false;
2087 : : }
2088 : :
2089 : : bool
2090 : 407 : gimple_simplify_322 (gimple_match_op *res_op, gimple_seq *seq,
2091 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2092 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2093 : : const enum tree_code ARG_UNUSED (mod))
2094 : : {
2095 : 407 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2096 : 407 : if (!integer_zerop (captures[0])
2097 : : )
2098 : : {
2099 : 33 : gimple_seq *lseq = seq;
2100 : 33 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail670;
2101 : 33 : {
2102 : 33 : tree tem;
2103 : 33 : tem = build_zero_cst (type);
2104 : 33 : res_op->set_value (tem);
2105 : 33 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 472, __FILE__, __LINE__, true);
2106 : 33 : return true;
2107 : : }
2108 : 0 : next_after_fail670:;
2109 : : }
2110 : : return false;
2111 : : }
2112 : :
2113 : : bool
2114 : 31 : gimple_simplify_327 (gimple_match_op *res_op, gimple_seq *seq,
2115 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2116 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
2117 : : {
2118 : 31 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2119 : 31 : if (SCALAR_FLOAT_TYPE_P (type)
2120 : 31 : && ! HONOR_NANS (type)
2121 : 47 : && ! HONOR_INFINITIES (type)
2122 : : )
2123 : : {
2124 : 16 : if (types_match (type, float_type_node)
2125 : : )
2126 : : {
2127 : 4 : gimple_seq *lseq = seq;
2128 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail675;
2129 : 4 : {
2130 : 4 : res_op->set_op (CFN_BUILT_IN_COPYSIGNF, type, 2);
2131 : 4 : res_op->ops[0] = build_one_cst (type);
2132 : 4 : {
2133 : 4 : tree _o1[1], _r1;
2134 : 4 : _o1[0] = captures[0];
2135 : 4 : if (type != TREE_TYPE (_o1[0])
2136 : 4 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
2137 : : {
2138 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
2139 : 0 : tem_op.resimplify (lseq, valueize);
2140 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2141 : 0 : if (!_r1) goto next_after_fail675;
2142 : : }
2143 : : else
2144 : : _r1 = _o1[0];
2145 : 4 : res_op->ops[1] = _r1;
2146 : : }
2147 : 4 : res_op->resimplify (lseq, valueize);
2148 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 477, __FILE__, __LINE__, true);
2149 : 4 : return true;
2150 : : }
2151 : : next_after_fail675:;
2152 : : }
2153 : : else
2154 : : {
2155 : 12 : if (types_match (type, double_type_node)
2156 : : )
2157 : : {
2158 : 8 : gimple_seq *lseq = seq;
2159 : 8 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail676;
2160 : 8 : {
2161 : 8 : res_op->set_op (CFN_BUILT_IN_COPYSIGN, type, 2);
2162 : 8 : res_op->ops[0] = build_one_cst (type);
2163 : 8 : {
2164 : 8 : tree _o1[1], _r1;
2165 : 8 : _o1[0] = captures[0];
2166 : 8 : if (type != TREE_TYPE (_o1[0])
2167 : 8 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
2168 : : {
2169 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
2170 : 2 : tem_op.resimplify (lseq, valueize);
2171 : 2 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2172 : 2 : if (!_r1) goto next_after_fail676;
2173 : : }
2174 : : else
2175 : : _r1 = _o1[0];
2176 : 7 : res_op->ops[1] = _r1;
2177 : : }
2178 : 7 : res_op->resimplify (lseq, valueize);
2179 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 478, __FILE__, __LINE__, true);
2180 : 7 : return true;
2181 : : }
2182 : : next_after_fail676:;
2183 : : }
2184 : : else
2185 : : {
2186 : 4 : if (types_match (type, long_double_type_node)
2187 : : )
2188 : : {
2189 : 4 : gimple_seq *lseq = seq;
2190 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail677;
2191 : 4 : {
2192 : 4 : res_op->set_op (CFN_BUILT_IN_COPYSIGNL, type, 2);
2193 : 4 : res_op->ops[0] = build_one_cst (type);
2194 : 4 : {
2195 : 4 : tree _o1[1], _r1;
2196 : 4 : _o1[0] = captures[0];
2197 : 4 : if (type != TREE_TYPE (_o1[0])
2198 : 4 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
2199 : : {
2200 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
2201 : 0 : tem_op.resimplify (lseq, valueize);
2202 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2203 : 0 : if (!_r1) goto next_after_fail677;
2204 : : }
2205 : : else
2206 : : _r1 = _o1[0];
2207 : 4 : res_op->ops[1] = _r1;
2208 : : }
2209 : 4 : res_op->resimplify (lseq, valueize);
2210 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 479, __FILE__, __LINE__, true);
2211 : 4 : return true;
2212 : : }
2213 : : next_after_fail677:;
2214 : : }
2215 : : }
2216 : : }
2217 : : }
2218 : : return false;
2219 : : }
2220 : :
2221 : : bool
2222 : 37046 : gimple_simplify_350 (gimple_match_op *res_op, gimple_seq *seq,
2223 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2224 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2225 : : const enum tree_code ARG_UNUSED (cmp),
2226 : : const enum tree_code ARG_UNUSED (cmp2))
2227 : : {
2228 : 37046 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2229 : 37046 : if (tree_nop_conversion_p (TREE_TYPE (captures[0]), TREE_TYPE (captures[2]))
2230 : 35453 : && TYPE_UNSIGNED (TREE_TYPE (captures[2])) && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
2231 : 72499 : && wi::gt_p (wi::to_wide (captures[1]), 0, TYPE_SIGN (TREE_TYPE (captures[1])))
2232 : : )
2233 : : {
2234 : 35453 : {
2235 : 35453 : tree utype = TREE_TYPE (captures[2]);
2236 : 35453 : wide_int denom = wi::to_wide (captures[1]);
2237 : 35453 : wide_int right = wi::to_wide (captures[2]);
2238 : 35453 : wide_int smax = wi::sdiv_trunc (wi::max_value (TREE_TYPE (captures[0])), denom);
2239 : 35453 : wide_int smin = wi::sdiv_trunc (wi::min_value (TREE_TYPE (captures[0])), denom);
2240 : 35453 : bool small = wi::leu_p (right, smax);
2241 : 35453 : bool large = wi::geu_p (right, smin);
2242 : 35453 : if (small || large
2243 : : )
2244 : : {
2245 : 25165 : gimple_seq *lseq = seq;
2246 : 25165 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail704;
2247 : 25165 : {
2248 : 25165 : res_op->set_op (cmp, type, 2);
2249 : 25165 : {
2250 : 25165 : tree _o1[1], _r1;
2251 : 25165 : _o1[0] = captures[0];
2252 : 25165 : if (utype != TREE_TYPE (_o1[0])
2253 : 25165 : && !useless_type_conversion_p (utype, TREE_TYPE (_o1[0])))
2254 : : {
2255 : 25165 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, utype, _o1[0]);
2256 : 25165 : tem_op.resimplify (lseq, valueize);
2257 : 25165 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2258 : 25165 : if (!_r1) goto next_after_fail704;
2259 : : }
2260 : : else
2261 : : _r1 = _o1[0];
2262 : 7030 : res_op->ops[0] = _r1;
2263 : : }
2264 : 7030 : {
2265 : 7030 : tree _o1[2], _r1;
2266 : 7030 : _o1[0] = captures[2];
2267 : 7030 : {
2268 : 7030 : tree _o2[1], _r2;
2269 : 7030 : _o2[0] = captures[1];
2270 : 7030 : if (TREE_TYPE (res_op->ops[0]) != TREE_TYPE (_o2[0])
2271 : 7030 : && !useless_type_conversion_p (TREE_TYPE (res_op->ops[0]), TREE_TYPE (_o2[0])))
2272 : : {
2273 : 7030 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, TREE_TYPE (res_op->ops[0]), _o2[0]);
2274 : 7030 : tem_op.resimplify (lseq, valueize);
2275 : 7030 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2276 : 7030 : if (!_r2) goto next_after_fail704;
2277 : : }
2278 : : else
2279 : : _r2 = _o2[0];
2280 : 7030 : _o1[1] = _r2;
2281 : : }
2282 : 7030 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2283 : 7030 : tem_op.resimplify (lseq, valueize);
2284 : 7030 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2285 : 7030 : if (!_r1) goto next_after_fail704;
2286 : 7030 : res_op->ops[1] = _r1;
2287 : : }
2288 : 7030 : res_op->resimplify (lseq, valueize);
2289 : 7030 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 506, __FILE__, __LINE__, true);
2290 : 7030 : return true;
2291 : : }
2292 : 18135 : next_after_fail704:;
2293 : : }
2294 : : else
2295 : : {
2296 : 10288 : gimple_seq *lseq = seq;
2297 : 10288 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail705;
2298 : 10288 : {
2299 : 10288 : res_op->set_op (cmp2, type, 2);
2300 : 10288 : res_op->ops[0] = captures[0];
2301 : 10288 : res_op->ops[1] = build_zero_cst (TREE_TYPE (captures[0]));
2302 : 10288 : res_op->resimplify (lseq, valueize);
2303 : 10288 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 507, __FILE__, __LINE__, true);
2304 : 10288 : return true;
2305 : : }
2306 : 18135 : next_after_fail705:;
2307 : : }
2308 : 35453 : }
2309 : : }
2310 : : return false;
2311 : : }
2312 : :
2313 : : bool
2314 : 35614 : gimple_simplify_365 (gimple_match_op *res_op, gimple_seq *seq,
2315 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2316 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2317 : : const enum tree_code ARG_UNUSED (cmp),
2318 : : const enum tree_code ARG_UNUSED (eqcmp))
2319 : : {
2320 : 35614 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2321 : 35614 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
2322 : : )
2323 : : {
2324 : 35614 : {
2325 : 35614 : tree ty = TREE_TYPE (captures[0]);
2326 : 35614 : unsigned prec = TYPE_PRECISION (ty);
2327 : 35614 : wide_int mask = wi::to_wide (captures[2], prec);
2328 : 35614 : wide_int rhs = wi::to_wide (captures[3], prec);
2329 : 35614 : signop sgn = TYPE_SIGN (ty);
2330 : 93411 : if ((mask & (mask + 1)) == 0 && wi::gt_p (rhs, 0, sgn)
2331 : 136110 : && (rhs & (rhs + 1)) == 0 && wi::ge_p (mask, rhs, sgn)
2332 : : )
2333 : : {
2334 : 914 : gimple_seq *lseq = seq;
2335 : 914 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail756;
2336 : 914 : {
2337 : 914 : res_op->set_op (eqcmp, type, 2);
2338 : 914 : {
2339 : 914 : tree _o1[2], _r1;
2340 : 914 : _o1[0] = captures[1];
2341 : 914 : _o1[1] = wide_int_to_tree (ty, mask - rhs);
2342 : 914 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2343 : 914 : tem_op.resimplify (lseq, valueize);
2344 : 914 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2345 : 914 : if (!_r1) goto next_after_fail756;
2346 : 227 : res_op->ops[0] = _r1;
2347 : : }
2348 : 227 : res_op->ops[1] = build_zero_cst (ty);
2349 : 227 : res_op->resimplify (lseq, valueize);
2350 : 227 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 541, __FILE__, __LINE__, true);
2351 : 227 : return true;
2352 : : }
2353 : 35387 : next_after_fail756:;
2354 : : }
2355 : 35614 : }
2356 : : }
2357 : : return false;
2358 : : }
2359 : :
2360 : : bool
2361 : 470 : gimple_simplify_372 (gimple_match_op *res_op, gimple_seq *seq,
2362 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2363 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2364 : : const enum tree_code ARG_UNUSED (shift),
2365 : : const enum tree_code ARG_UNUSED (mod))
2366 : : {
2367 : 470 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2368 : 470 : if (integer_pow2p (captures[3]) && tree_int_cst_sgn (captures[3]) > 0
2369 : : )
2370 : : {
2371 : 412 : gimple_seq *lseq = seq;
2372 : 412 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail767;
2373 : 412 : {
2374 : 412 : res_op->set_op (shift, type, 2);
2375 : 412 : res_op->ops[0] = captures[0];
2376 : 412 : {
2377 : 412 : tree _o1[2], _r1;
2378 : 412 : _o1[0] = captures[1];
2379 : 412 : {
2380 : 412 : tree _o2[2], _r2;
2381 : 412 : _o2[0] = captures[2];
2382 : 412 : _o2[1] = build_int_cst (TREE_TYPE (captures[2]),
2383 : 412 : 1);
2384 : 412 : gimple_match_op tem_op (res_op->cond.any_else (), MINUS_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
2385 : 412 : tem_op.resimplify (lseq, valueize);
2386 : 412 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2387 : 412 : if (!_r2) goto next_after_fail767;
2388 : 412 : _o1[1] = _r2;
2389 : : }
2390 : 412 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_AND_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2391 : 412 : tem_op.resimplify (lseq, valueize);
2392 : 412 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2393 : 412 : if (!_r1) goto next_after_fail767;
2394 : 200 : res_op->ops[1] = _r1;
2395 : : }
2396 : 200 : res_op->resimplify (lseq, valueize);
2397 : 200 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 548, __FILE__, __LINE__, true);
2398 : 200 : return true;
2399 : : }
2400 : : next_after_fail767:;
2401 : : }
2402 : : return false;
2403 : : }
2404 : :
2405 : : bool
2406 : 13350 : gimple_simplify_380 (gimple_match_op *res_op, gimple_seq *seq,
2407 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2408 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2409 : : const enum tree_code ARG_UNUSED (op))
2410 : : {
2411 : 13350 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2412 : 13350 : {
2413 : 13350 : unsigned int prec = element_precision (type);
2414 : 13350 : if (wi::ge_p (wi::to_wide (captures[1]), 0, TYPE_SIGN (TREE_TYPE (captures[1])))
2415 : 13350 : && wi::lt_p (wi::to_wide (captures[1]), prec, TYPE_SIGN (TREE_TYPE (captures[1])))
2416 : 13350 : && wi::ge_p (wi::to_wide (captures[2]), 0, TYPE_SIGN (TREE_TYPE (captures[2])))
2417 : 26700 : && wi::lt_p (wi::to_wide (captures[2]), prec, TYPE_SIGN (TREE_TYPE (captures[2])))
2418 : : )
2419 : : {
2420 : 13350 : {
2421 : 13350 : unsigned int low = (tree_to_uhwi (captures[1])
2422 : 13350 : + tree_to_uhwi (captures[2]));
2423 : 13350 : if (low >= prec
2424 : : )
2425 : : {
2426 : 152 : if (op == LROTATE_EXPR || op == RROTATE_EXPR
2427 : : )
2428 : : {
2429 : 13 : gimple_seq *lseq = seq;
2430 : 13 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail775;
2431 : 13 : {
2432 : 13 : res_op->set_op (op, type, 2);
2433 : 13 : res_op->ops[0] = captures[0];
2434 : 13 : res_op->ops[1] = build_int_cst (TREE_TYPE (captures[1]), low % prec);
2435 : 13 : res_op->resimplify (lseq, valueize);
2436 : 13 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 555, __FILE__, __LINE__, true);
2437 : 13350 : return true;
2438 : : }
2439 : 0 : next_after_fail775:;
2440 : : }
2441 : : else
2442 : : {
2443 : 139 : if (TYPE_UNSIGNED (type) || op == LSHIFT_EXPR
2444 : : )
2445 : : {
2446 : 115 : gimple_seq *lseq = seq;
2447 : 115 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail776;
2448 : 115 : {
2449 : 115 : tree tem;
2450 : 115 : tem = build_zero_cst (type);
2451 : 115 : res_op->set_value (tem);
2452 : 115 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 556, __FILE__, __LINE__, true);
2453 : 115 : return true;
2454 : : }
2455 : 0 : next_after_fail776:;
2456 : : }
2457 : : else
2458 : : {
2459 : 24 : gimple_seq *lseq = seq;
2460 : 24 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail777;
2461 : 24 : {
2462 : 24 : res_op->set_op (op, type, 2);
2463 : 24 : res_op->ops[0] = captures[0];
2464 : 24 : res_op->ops[1] = build_int_cst (TREE_TYPE (captures[1]), prec - 1);
2465 : 24 : res_op->resimplify (lseq, valueize);
2466 : 24 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 557, __FILE__, __LINE__, true);
2467 : 24 : return true;
2468 : : }
2469 : 0 : next_after_fail777:;
2470 : : }
2471 : : }
2472 : : }
2473 : : else
2474 : : {
2475 : 13198 : gimple_seq *lseq = seq;
2476 : 13198 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail778;
2477 : 13198 : {
2478 : 13198 : res_op->set_op (op, type, 2);
2479 : 13198 : res_op->ops[0] = captures[0];
2480 : 13198 : res_op->ops[1] = build_int_cst (TREE_TYPE (captures[1]), low);
2481 : 13198 : res_op->resimplify (lseq, valueize);
2482 : 13198 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 558, __FILE__, __LINE__, true);
2483 : 13198 : return true;
2484 : : }
2485 : 0 : next_after_fail778:;
2486 : : }
2487 : : }
2488 : : }
2489 : : }
2490 : 0 : return false;
2491 : : }
2492 : :
2493 : : bool
2494 : 918 : gimple_simplify_389 (gimple_match_op *res_op, gimple_seq *seq,
2495 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2496 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2497 : : const combined_fn ARG_UNUSED (froms),
2498 : : const combined_fn ARG_UNUSED (tos))
2499 : : {
2500 : 918 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2501 : 918 : if (optimize
2502 : 918 : && types_match (type, TREE_TYPE (captures[0]))
2503 : 1836 : && direct_internal_fn_supported_p (as_internal_fn (tos),
2504 : : type, OPTIMIZE_FOR_BOTH)
2505 : : )
2506 : : {
2507 : 78 : gimple_seq *lseq = seq;
2508 : 78 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail793;
2509 : 78 : {
2510 : 78 : res_op->set_op (tos, type, 1);
2511 : 78 : res_op->ops[0] = captures[0];
2512 : 78 : res_op->resimplify (lseq, valueize);
2513 : 78 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 572, __FILE__, __LINE__, true);
2514 : 78 : return true;
2515 : : }
2516 : 0 : next_after_fail793:;
2517 : : }
2518 : : return false;
2519 : : }
2520 : :
2521 : : bool
2522 : 1284252 : gimple_simplify_394 (gimple_match_op *res_op, gimple_seq *seq,
2523 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2524 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2525 : : const enum tree_code ARG_UNUSED (op))
2526 : : {
2527 : 1284252 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2528 : 1284252 : if (INTEGRAL_TYPE_P (type)
2529 : 924144 : && op != MULT_EXPR
2530 : 924144 : && op != RDIV_EXPR
2531 : 704362 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[2]))
2532 : 651115 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
2533 : 651115 : && type_has_mode_precision_p (TREE_TYPE (captures[2]))
2534 : 589356 : && type_has_mode_precision_p (TREE_TYPE (captures[4]))
2535 : 589247 : && type_has_mode_precision_p (type)
2536 : 586493 : && TYPE_PRECISION (TREE_TYPE (captures[1])) > TYPE_PRECISION (TREE_TYPE (captures[2]))
2537 : 105499 : && types_match (captures[2], type)
2538 : 1304182 : && (types_match (captures[2], captures[4])
2539 : 19930 : || poly_int_tree_p (captures[3]))
2540 : : )
2541 : : {
2542 : 12556 : if (TYPE_OVERFLOW_WRAPS (TREE_TYPE (captures[2]))
2543 : : )
2544 : : {
2545 : 274 : gimple_seq *lseq = seq;
2546 : 274 : if (lseq
2547 : 112 : && (!single_use (captures[0])))
2548 : 191 : lseq = NULL;
2549 : 274 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail801;
2550 : 274 : {
2551 : 274 : res_op->set_op (op, type, 2);
2552 : 274 : res_op->ops[0] = captures[2];
2553 : 274 : {
2554 : 274 : tree _o1[1], _r1;
2555 : 274 : _o1[0] = captures[4];
2556 : 274 : if (type != TREE_TYPE (_o1[0])
2557 : 274 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
2558 : : {
2559 : 274 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
2560 : 274 : tem_op.resimplify (lseq, valueize);
2561 : 274 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2562 : 274 : if (!_r1) goto next_after_fail801;
2563 : : }
2564 : : else
2565 : : _r1 = _o1[0];
2566 : 274 : res_op->ops[1] = _r1;
2567 : : }
2568 : 274 : res_op->resimplify (lseq, valueize);
2569 : 274 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 576, __FILE__, __LINE__, true);
2570 : 274 : return true;
2571 : : }
2572 : : next_after_fail801:;
2573 : : }
2574 : : else
2575 : : {
2576 : 12282 : {
2577 : 12282 : tree utype = unsigned_type_for (TREE_TYPE (captures[2]));
2578 : 12282 : gimple_seq *lseq = seq;
2579 : 12282 : if (lseq
2580 : 4304 : && (!single_use (captures[0])))
2581 : 11346 : lseq = NULL;
2582 : 12282 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail802;
2583 : 12282 : {
2584 : 12282 : res_op->set_op (NOP_EXPR, type, 1);
2585 : 12282 : {
2586 : 12282 : tree _o1[2], _r1;
2587 : 12282 : {
2588 : 12282 : tree _o2[1], _r2;
2589 : 12282 : _o2[0] = captures[2];
2590 : 12282 : if (utype != TREE_TYPE (_o2[0])
2591 : 12282 : && !useless_type_conversion_p (utype, TREE_TYPE (_o2[0])))
2592 : : {
2593 : 12282 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, utype, _o2[0]);
2594 : 12282 : tem_op.resimplify (lseq, valueize);
2595 : 12282 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2596 : 12282 : if (!_r2) goto next_after_fail802;
2597 : : }
2598 : : else
2599 : : _r2 = _o2[0];
2600 : 1189 : _o1[0] = _r2;
2601 : : }
2602 : 1189 : {
2603 : 1189 : tree _o2[1], _r2;
2604 : 1189 : _o2[0] = captures[4];
2605 : 1189 : if (utype != TREE_TYPE (_o2[0])
2606 : 1189 : && !useless_type_conversion_p (utype, TREE_TYPE (_o2[0])))
2607 : : {
2608 : 1189 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, utype, _o2[0]);
2609 : 1189 : tem_op.resimplify (lseq, valueize);
2610 : 1189 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2611 : 1189 : if (!_r2) goto next_after_fail802;
2612 : : }
2613 : : else
2614 : : _r2 = _o2[0];
2615 : 1189 : _o1[1] = _r2;
2616 : : }
2617 : 1189 : gimple_match_op tem_op (res_op->cond.any_else (), op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2618 : 1189 : tem_op.resimplify (lseq, valueize);
2619 : 1189 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2620 : 1189 : if (!_r1) goto next_after_fail802;
2621 : 1186 : res_op->ops[0] = _r1;
2622 : : }
2623 : 1186 : res_op->resimplify (lseq, valueize);
2624 : 1186 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 577, __FILE__, __LINE__, true);
2625 : 1186 : return true;
2626 : : }
2627 : : next_after_fail802:;
2628 : : }
2629 : : }
2630 : : }
2631 : : else
2632 : : {
2633 : 1169410 : if (FLOAT_TYPE_P (type)
2634 : 1373998 : && DECIMAL_FLOAT_TYPE_P (TREE_TYPE (captures[0]))
2635 : 102294 : == DECIMAL_FLOAT_TYPE_P (type)
2636 : : )
2637 : : {
2638 : 102234 : {
2639 : 102234 : tree arg0 = strip_float_extensions (captures[2]);
2640 : 102234 : tree arg1 = strip_float_extensions (captures[4]);
2641 : 102234 : tree itype = TREE_TYPE (captures[0]);
2642 : 102234 : tree ty1 = TREE_TYPE (arg0);
2643 : 102234 : tree ty2 = TREE_TYPE (arg1);
2644 : 102234 : enum tree_code code = TREE_CODE (itype);
2645 : 8 : if (FLOAT_TYPE_P (ty1)
2646 : 102242 : && FLOAT_TYPE_P (ty2)
2647 : : )
2648 : : {
2649 : 102234 : {
2650 : 102234 : tree newtype = type;
2651 : 102234 : if (TYPE_MODE (ty1) == SDmode
2652 : 102130 : || TYPE_MODE (ty2) == SDmode
2653 : 204364 : || TYPE_MODE (type) == SDmode)
2654 : 104 : newtype = dfloat32_type_node;
2655 : 102234 : if (TYPE_MODE (ty1) == DDmode
2656 : 102186 : || TYPE_MODE (ty2) == DDmode
2657 : 204364 : || TYPE_MODE (type) == DDmode)
2658 : 104 : newtype = dfloat64_type_node;
2659 : 102234 : if (TYPE_MODE (ty1) == TDmode
2660 : 102234 : || TYPE_MODE (ty2) == TDmode
2661 : 204372 : || TYPE_MODE (type) == TDmode)
2662 : 96 : newtype = dfloat128_type_node;
2663 : 102234 : if ((newtype == dfloat32_type_node
2664 : 102234 : || newtype == dfloat64_type_node
2665 : 102178 : || newtype == dfloat128_type_node)
2666 : 152 : && newtype == type
2667 : 102234 : && types_match (newtype, type)
2668 : : )
2669 : : {
2670 : 0 : gimple_seq *lseq = seq;
2671 : 0 : if (lseq
2672 : 0 : && (!single_use (captures[0])))
2673 : 0 : lseq = NULL;
2674 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail803;
2675 : 0 : {
2676 : 0 : res_op->set_op (op, type, 2);
2677 : 0 : {
2678 : 0 : tree _o1[1], _r1;
2679 : 0 : _o1[0] = captures[2];
2680 : 0 : if (newtype != TREE_TYPE (_o1[0])
2681 : 0 : && !useless_type_conversion_p (newtype, TREE_TYPE (_o1[0])))
2682 : : {
2683 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, newtype, _o1[0]);
2684 : 0 : tem_op.resimplify (lseq, valueize);
2685 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2686 : 0 : if (!_r1) goto next_after_fail803;
2687 : : }
2688 : : else
2689 : : _r1 = _o1[0];
2690 : 0 : res_op->ops[0] = _r1;
2691 : : }
2692 : 0 : {
2693 : 0 : tree _o1[1], _r1;
2694 : 0 : _o1[0] = captures[4];
2695 : 0 : if (newtype != TREE_TYPE (_o1[0])
2696 : 0 : && !useless_type_conversion_p (newtype, TREE_TYPE (_o1[0])))
2697 : : {
2698 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, newtype, _o1[0]);
2699 : 0 : tem_op.resimplify (lseq, valueize);
2700 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2701 : 0 : if (!_r1) goto next_after_fail803;
2702 : : }
2703 : : else
2704 : : _r1 = _o1[0];
2705 : 0 : res_op->ops[1] = _r1;
2706 : : }
2707 : 0 : res_op->resimplify (lseq, valueize);
2708 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 578, __FILE__, __LINE__, true);
2709 : 0 : return true;
2710 : : }
2711 : : next_after_fail803:;
2712 : : }
2713 : : else
2714 : : {
2715 : 102234 : {
2716 : 102234 : if (element_precision (ty1) > element_precision (newtype))
2717 : 120 : newtype = ty1;
2718 : 102234 : if (element_precision (ty2) > element_precision (newtype))
2719 : 75563 : newtype = ty2;
2720 : 102234 : if (element_precision (newtype) < element_precision (itype)
2721 : 26501 : && (!VECTOR_MODE_P (TYPE_MODE (newtype))
2722 : 0 : || target_supports_op_p (newtype, op, optab_default))
2723 : 26501 : && (flag_unsafe_math_optimizations
2724 : 26501 : || (element_precision (newtype) == element_precision (type)
2725 : 26261 : && real_can_shorten_arithmetic (element_mode (itype),
2726 : : element_mode (type))
2727 : 523 : && !excess_precision_type (newtype)))
2728 : 102742 : && !types_match (itype, newtype)
2729 : : )
2730 : : {
2731 : 508 : gimple_seq *lseq = seq;
2732 : 508 : if (lseq
2733 : 279 : && (!single_use (captures[0])))
2734 : 233 : lseq = NULL;
2735 : 508 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail804;
2736 : 508 : {
2737 : 508 : res_op->set_op (NOP_EXPR, type, 1);
2738 : 508 : {
2739 : 508 : tree _o1[2], _r1;
2740 : 508 : {
2741 : 508 : tree _o2[1], _r2;
2742 : 508 : _o2[0] = captures[2];
2743 : 508 : if (newtype != TREE_TYPE (_o2[0])
2744 : 508 : && !useless_type_conversion_p (newtype, TREE_TYPE (_o2[0])))
2745 : : {
2746 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, newtype, _o2[0]);
2747 : 0 : tem_op.resimplify (lseq, valueize);
2748 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2749 : 0 : if (!_r2) goto next_after_fail804;
2750 : : }
2751 : : else
2752 : : _r2 = _o2[0];
2753 : 508 : _o1[0] = _r2;
2754 : : }
2755 : 508 : {
2756 : 508 : tree _o2[1], _r2;
2757 : 508 : _o2[0] = captures[4];
2758 : 508 : if (newtype != TREE_TYPE (_o2[0])
2759 : 508 : && !useless_type_conversion_p (newtype, TREE_TYPE (_o2[0])))
2760 : : {
2761 : 508 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, newtype, _o2[0]);
2762 : 508 : tem_op.resimplify (lseq, valueize);
2763 : 508 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2764 : 508 : if (!_r2) goto next_after_fail804;
2765 : : }
2766 : : else
2767 : : _r2 = _o2[0];
2768 : 508 : _o1[1] = _r2;
2769 : : }
2770 : 508 : gimple_match_op tem_op (res_op->cond.any_else (), op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
2771 : 508 : tem_op.resimplify (lseq, valueize);
2772 : 508 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2773 : 508 : if (!_r1) goto next_after_fail804;
2774 : 275 : res_op->ops[0] = _r1;
2775 : : }
2776 : 275 : res_op->resimplify (lseq, valueize);
2777 : 275 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 579, __FILE__, __LINE__, true);
2778 : 275 : return true;
2779 : : }
2780 : : next_after_fail804:;
2781 : : }
2782 : : }
2783 : : }
2784 : : }
2785 : : }
2786 : : }
2787 : : }
2788 : : }
2789 : : return false;
2790 : : }
2791 : :
2792 : : bool
2793 : 16 : gimple_simplify_429 (gimple_match_op *res_op, gimple_seq *seq,
2794 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2795 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
2796 : : {
2797 : 16 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2798 : 16 : gimple_seq *lseq = seq;
2799 : 16 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail847;
2800 : 16 : {
2801 : 16 : res_op->set_op (BIT_XOR_EXPR, type, 2);
2802 : 16 : res_op->ops[0] = captures[0];
2803 : 16 : res_op->ops[1] = captures[1];
2804 : 16 : res_op->resimplify (lseq, valueize);
2805 : 16 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 613, __FILE__, __LINE__, true);
2806 : : return true;
2807 : : }
2808 : 0 : next_after_fail847:;
2809 : 0 : return false;
2810 : : }
2811 : :
2812 : : bool
2813 : 75883 : gimple_simplify_432 (gimple_match_op *res_op, gimple_seq *seq,
2814 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2815 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
2816 : : {
2817 : 75883 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2818 : 75883 : {
2819 : 75883 : bool wascmp;
2820 : 75883 : if (bitwise_inverted_equal_p (captures[0], captures[2], wascmp)
2821 : 75883 : || bitwise_inverted_equal_p (captures[1], captures[2], wascmp)
2822 : : )
2823 : : {
2824 : 119 : gimple_seq *lseq = seq;
2825 : 119 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail850;
2826 : 119 : {
2827 : 119 : tree tem;
2828 : 119 : tem = wascmp ? constant_boolean_node (false, type) : build_zero_cst (type);
2829 : 119 : res_op->set_value (tem);
2830 : 119 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 616, __FILE__, __LINE__, true);
2831 : 119 : return true;
2832 : : }
2833 : 0 : next_after_fail850:;
2834 : : }
2835 : : }
2836 : 75764 : return false;
2837 : : }
2838 : :
2839 : : bool
2840 : 5194 : gimple_simplify_437 (gimple_match_op *res_op, gimple_seq *seq,
2841 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
2842 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
2843 : : const enum tree_code ARG_UNUSED (shift))
2844 : : {
2845 : 5194 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
2846 : 5194 : if (tree_nop_conversion_p (TREE_TYPE (captures[0]), TREE_TYPE (captures[1]))
2847 : 171 : && TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT
2848 : 171 : && tree_fits_uhwi_p (captures[4])
2849 : 171 : && tree_to_uhwi (captures[4]) > 0
2850 : 5365 : && tree_to_uhwi (captures[4]) < TYPE_PRECISION (type)
2851 : : )
2852 : : {
2853 : 171 : {
2854 : 171 : unsigned int shiftc = tree_to_uhwi (captures[4]);
2855 : 171 : unsigned HOST_WIDE_INT mask = TREE_INT_CST_LOW (captures[5]);
2856 : 171 : unsigned HOST_WIDE_INT newmask, zerobits = 0;
2857 : 171 : tree shift_type = TREE_TYPE (captures[2]);
2858 : 171 : unsigned int prec;
2859 : 171 : if (shift == LSHIFT_EXPR)
2860 : 0 : zerobits = ((HOST_WIDE_INT_1U << shiftc) - 1);
2861 : 171 : else if (shift == RSHIFT_EXPR
2862 : 171 : && type_has_mode_precision_p (shift_type))
2863 : : {
2864 : 171 : prec = TYPE_PRECISION (TREE_TYPE (captures[2]));
2865 : 171 : tree arg00 = captures[3];
2866 : 171 : if (captures[2] != captures[3]
2867 : 171 : && TYPE_UNSIGNED (TREE_TYPE (captures[3])))
2868 : : {
2869 : 94 : tree inner_type = TREE_TYPE (captures[3]);
2870 : 94 : if (type_has_mode_precision_p (inner_type)
2871 : 94 : && TYPE_PRECISION (inner_type) < prec)
2872 : : {
2873 : 11 : prec = TYPE_PRECISION (inner_type);
2874 : 11 : if (shiftc < prec)
2875 : 11 : shift_type = inner_type;
2876 : : }
2877 : : }
2878 : 171 : zerobits = HOST_WIDE_INT_M1U;
2879 : 171 : if (shiftc < prec)
2880 : : {
2881 : 171 : zerobits >>= HOST_BITS_PER_WIDE_INT - shiftc;
2882 : 171 : zerobits <<= prec - shiftc;
2883 : : }
2884 : 171 : if (!TYPE_UNSIGNED (TREE_TYPE (captures[2]))
2885 : 171 : && prec == TYPE_PRECISION (TREE_TYPE (captures[2])))
2886 : : {
2887 : 110 : if ((mask & zerobits) == 0)
2888 : 5 : shift_type = unsigned_type_for (TREE_TYPE (captures[2]));
2889 : : else
2890 : : zerobits = 0;
2891 : : }
2892 : : }
2893 : 171 : if ((mask & zerobits) == mask
2894 : : )
2895 : : {
2896 : 0 : gimple_seq *lseq = seq;
2897 : 0 : if (lseq
2898 : : && (!single_use (captures[0])
2899 : : || !single_use (captures[1])))
2900 : 0 : lseq = NULL;
2901 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail855;
2902 : 0 : {
2903 : 0 : tree tem;
2904 : 0 : tem = build_int_cst (type, 0);
2905 : 0 : res_op->set_value (tem);
2906 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 620, __FILE__, __LINE__, true);
2907 : 0 : return true;
2908 : : }
2909 : 0 : next_after_fail855:;
2910 : : }
2911 : : else
2912 : : {
2913 : 171 : {
2914 : 171 : newmask = mask | zerobits;
2915 : 171 : if (newmask != mask && (newmask & (newmask + 1)) == 0
2916 : : )
2917 : : {
2918 : : {
2919 : 10 : for (prec = BITS_PER_UNIT;
2920 : 16 : prec < HOST_BITS_PER_WIDE_INT; prec <<= 1)
2921 : 14 : if (newmask == (HOST_WIDE_INT_1U << prec) - 1)
2922 : : break;
2923 : 6 : if (prec < HOST_BITS_PER_WIDE_INT
2924 : 2 : || newmask == HOST_WIDE_INT_M1U
2925 : : )
2926 : : {
2927 : 6 : {
2928 : 6 : tree newmaskt = build_int_cst_type (TREE_TYPE (captures[5]), newmask);
2929 : 6 : if (!tree_int_cst_equal (newmaskt, captures[5])
2930 : : )
2931 : : {
2932 : 6 : if (shift_type != TREE_TYPE (captures[2])
2933 : : )
2934 : : {
2935 : 6 : gimple_seq *lseq = seq;
2936 : 6 : if (lseq
2937 : 0 : && (!single_use (captures[0])
2938 : 0 : || !single_use (captures[1])))
2939 : 6 : lseq = NULL;
2940 : 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail856;
2941 : 6 : {
2942 : 6 : res_op->set_op (BIT_AND_EXPR, type, 2);
2943 : 6 : {
2944 : 6 : tree _o1[1], _r1;
2945 : 6 : {
2946 : 6 : tree _o2[2], _r2;
2947 : 6 : {
2948 : 6 : tree _o3[1], _r3;
2949 : 6 : _o3[0] = captures[2];
2950 : 6 : if (shift_type != TREE_TYPE (_o3[0])
2951 : 6 : && !useless_type_conversion_p (shift_type, TREE_TYPE (_o3[0])))
2952 : : {
2953 : 6 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, shift_type, _o3[0]);
2954 : 6 : tem_op.resimplify (lseq, valueize);
2955 : 6 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
2956 : 6 : if (!_r3) goto next_after_fail856;
2957 : : }
2958 : : else
2959 : : _r3 = _o3[0];
2960 : 6 : _o2[0] = _r3;
2961 : : }
2962 : 6 : _o2[1] = captures[4];
2963 : 6 : gimple_match_op tem_op (res_op->cond.any_else (), shift, shift_type, _o2[0], _o2[1]);
2964 : 6 : tem_op.resimplify (lseq, valueize);
2965 : 6 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
2966 : 6 : if (!_r2) goto next_after_fail856;
2967 : 0 : _o1[0] = _r2;
2968 : : }
2969 : 0 : if (type != TREE_TYPE (_o1[0])
2970 : 0 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
2971 : : {
2972 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
2973 : 0 : tem_op.resimplify (lseq, valueize);
2974 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
2975 : 0 : if (!_r1) goto next_after_fail856;
2976 : : }
2977 : : else
2978 : : _r1 = _o1[0];
2979 : 0 : res_op->ops[0] = _r1;
2980 : : }
2981 : 0 : res_op->ops[1] = newmaskt;
2982 : 0 : res_op->resimplify (lseq, valueize);
2983 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 621, __FILE__, __LINE__, true);
2984 : 0 : return true;
2985 : : }
2986 : : next_after_fail856:;
2987 : : }
2988 : : else
2989 : : {
2990 : 0 : gimple_seq *lseq = seq;
2991 : 0 : if (lseq
2992 : 0 : && (!single_use (captures[0])
2993 : 0 : || !single_use (captures[1])))
2994 : 0 : lseq = NULL;
2995 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail857;
2996 : 0 : {
2997 : 0 : res_op->set_op (BIT_AND_EXPR, type, 2);
2998 : 0 : res_op->ops[0] = captures[0];
2999 : 0 : res_op->ops[1] = newmaskt;
3000 : 0 : res_op->resimplify (lseq, valueize);
3001 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 622, __FILE__, __LINE__, true);
3002 : 0 : return true;
3003 : : }
3004 : 0 : next_after_fail857:;
3005 : : }
3006 : : }
3007 : : }
3008 : : }
3009 : : }
3010 : : }
3011 : : }
3012 : : }
3013 : : }
3014 : : }
3015 : : return false;
3016 : : }
3017 : :
3018 : : bool
3019 : 174646 : gimple_simplify_458 (gimple_match_op *res_op, gimple_seq *seq,
3020 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3021 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3022 : : const enum tree_code ARG_UNUSED (shift))
3023 : : {
3024 : 174646 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3025 : 174646 : if (tree_nop_conversion_p (TREE_TYPE (captures[0]), TREE_TYPE (captures[1]))
3026 : 174646 : && TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT
3027 : 168183 : && tree_fits_uhwi_p (captures[4])
3028 : 168099 : && tree_to_uhwi (captures[4]) > 0
3029 : 342738 : && tree_to_uhwi (captures[4]) < TYPE_PRECISION (type)
3030 : : )
3031 : : {
3032 : 168088 : {
3033 : 168088 : unsigned int shiftc = tree_to_uhwi (captures[4]);
3034 : 168088 : unsigned HOST_WIDE_INT mask = TREE_INT_CST_LOW (captures[5]);
3035 : 168088 : unsigned HOST_WIDE_INT newmask, zerobits = 0;
3036 : 168088 : tree shift_type = TREE_TYPE (captures[2]);
3037 : 168088 : unsigned int prec;
3038 : 168088 : if (shift == LSHIFT_EXPR)
3039 : 24693 : zerobits = ((HOST_WIDE_INT_1U << shiftc) - 1);
3040 : 143395 : else if (shift == RSHIFT_EXPR
3041 : 143395 : && type_has_mode_precision_p (shift_type))
3042 : : {
3043 : 143395 : prec = TYPE_PRECISION (TREE_TYPE (captures[2]));
3044 : 143395 : tree arg00 = captures[3];
3045 : 143395 : if (captures[2] != captures[3]
3046 : 143395 : && TYPE_UNSIGNED (TREE_TYPE (captures[3])))
3047 : : {
3048 : 0 : tree inner_type = TREE_TYPE (captures[3]);
3049 : 0 : if (type_has_mode_precision_p (inner_type)
3050 : 0 : && TYPE_PRECISION (inner_type) < prec)
3051 : : {
3052 : 0 : prec = TYPE_PRECISION (inner_type);
3053 : 0 : if (shiftc < prec)
3054 : 0 : shift_type = inner_type;
3055 : : }
3056 : : }
3057 : 143395 : zerobits = HOST_WIDE_INT_M1U;
3058 : 143395 : if (shiftc < prec)
3059 : : {
3060 : 143395 : zerobits >>= HOST_BITS_PER_WIDE_INT - shiftc;
3061 : 143395 : zerobits <<= prec - shiftc;
3062 : : }
3063 : 143395 : if (!TYPE_UNSIGNED (TREE_TYPE (captures[2]))
3064 : 143395 : && prec == TYPE_PRECISION (TREE_TYPE (captures[2])))
3065 : : {
3066 : 17200 : if ((mask & zerobits) == 0)
3067 : 15701 : shift_type = unsigned_type_for (TREE_TYPE (captures[2]));
3068 : : else
3069 : : zerobits = 0;
3070 : : }
3071 : : }
3072 : 168088 : if ((mask & zerobits) == mask
3073 : : )
3074 : : {
3075 : 114 : gimple_seq *lseq = seq;
3076 : 114 : if (lseq
3077 : : && (!single_use (captures[0])
3078 : : || !single_use (captures[1])))
3079 : 114 : lseq = NULL;
3080 : 114 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail917;
3081 : 114 : {
3082 : 114 : tree tem;
3083 : 114 : tem = build_int_cst (type, 0);
3084 : 114 : res_op->set_value (tem);
3085 : 114 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 620, __FILE__, __LINE__, true);
3086 : 114 : return true;
3087 : : }
3088 : 0 : next_after_fail917:;
3089 : : }
3090 : : else
3091 : : {
3092 : 167974 : {
3093 : 167974 : newmask = mask | zerobits;
3094 : 167974 : if (newmask != mask && (newmask & (newmask + 1)) == 0
3095 : : )
3096 : : {
3097 : : {
3098 : 29599 : for (prec = BITS_PER_UNIT;
3099 : 39734 : prec < HOST_BITS_PER_WIDE_INT; prec <<= 1)
3100 : 30027 : if (newmask == (HOST_WIDE_INT_1U << prec) - 1)
3101 : : break;
3102 : 10135 : if (prec < HOST_BITS_PER_WIDE_INT
3103 : 9707 : || newmask == HOST_WIDE_INT_M1U
3104 : : )
3105 : : {
3106 : 994 : {
3107 : 994 : tree newmaskt = build_int_cst_type (TREE_TYPE (captures[5]), newmask);
3108 : 994 : if (!tree_int_cst_equal (newmaskt, captures[5])
3109 : : )
3110 : : {
3111 : 994 : if (shift_type != TREE_TYPE (captures[2])
3112 : : )
3113 : : {
3114 : 122 : gimple_seq *lseq = seq;
3115 : 122 : if (lseq
3116 : 43 : && (!single_use (captures[0])
3117 : 19 : || !single_use (captures[1])))
3118 : 103 : lseq = NULL;
3119 : 122 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail918;
3120 : 122 : {
3121 : 122 : res_op->set_op (BIT_AND_EXPR, type, 2);
3122 : 122 : {
3123 : 122 : tree _o1[1], _r1;
3124 : 122 : {
3125 : 122 : tree _o2[2], _r2;
3126 : 122 : {
3127 : 122 : tree _o3[1], _r3;
3128 : 122 : _o3[0] = captures[2];
3129 : 122 : if (shift_type != TREE_TYPE (_o3[0])
3130 : 122 : && !useless_type_conversion_p (shift_type, TREE_TYPE (_o3[0])))
3131 : : {
3132 : 122 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, shift_type, _o3[0]);
3133 : 122 : tem_op.resimplify (lseq, valueize);
3134 : 122 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
3135 : 122 : if (!_r3) goto next_after_fail918;
3136 : : }
3137 : : else
3138 : : _r3 = _o3[0];
3139 : 27 : _o2[0] = _r3;
3140 : : }
3141 : 27 : _o2[1] = captures[4];
3142 : 27 : gimple_match_op tem_op (res_op->cond.any_else (), shift, shift_type, _o2[0], _o2[1]);
3143 : 27 : tem_op.resimplify (lseq, valueize);
3144 : 27 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
3145 : 27 : if (!_r2) goto next_after_fail918;
3146 : 19 : _o1[0] = _r2;
3147 : : }
3148 : 19 : if (type != TREE_TYPE (_o1[0])
3149 : 19 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
3150 : : {
3151 : 19 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
3152 : 19 : tem_op.resimplify (lseq, valueize);
3153 : 19 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3154 : 19 : if (!_r1) goto next_after_fail918;
3155 : : }
3156 : : else
3157 : : _r1 = _o1[0];
3158 : 19 : res_op->ops[0] = _r1;
3159 : : }
3160 : 19 : res_op->ops[1] = newmaskt;
3161 : 19 : res_op->resimplify (lseq, valueize);
3162 : 19 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 621, __FILE__, __LINE__, true);
3163 : 19 : return true;
3164 : : }
3165 : : next_after_fail918:;
3166 : : }
3167 : : else
3168 : : {
3169 : 872 : gimple_seq *lseq = seq;
3170 : 872 : if (lseq
3171 : 73 : && (!single_use (captures[0])
3172 : 73 : || !single_use (captures[1])))
3173 : 799 : lseq = NULL;
3174 : 872 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail919;
3175 : 872 : {
3176 : 872 : res_op->set_op (BIT_AND_EXPR, type, 2);
3177 : 872 : res_op->ops[0] = captures[0];
3178 : 872 : res_op->ops[1] = newmaskt;
3179 : 872 : res_op->resimplify (lseq, valueize);
3180 : 872 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 622, __FILE__, __LINE__, true);
3181 : 872 : return true;
3182 : : }
3183 : 0 : next_after_fail919:;
3184 : : }
3185 : : }
3186 : : }
3187 : : }
3188 : : }
3189 : : }
3190 : : }
3191 : : }
3192 : : }
3193 : : }
3194 : : return false;
3195 : : }
3196 : :
3197 : : bool
3198 : 38 : gimple_simplify_481 (gimple_match_op *res_op, gimple_seq *seq,
3199 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3200 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3201 : : const enum tree_code ARG_UNUSED (minmax))
3202 : : {
3203 : 38 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3204 : 38 : gimple_seq *lseq = seq;
3205 : 38 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail946;
3206 : 38 : {
3207 : 38 : tree tem;
3208 : 38 : tem = captures[0];
3209 : 38 : res_op->set_value (tem);
3210 : 38 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 668, __FILE__, __LINE__, true);
3211 : : return true;
3212 : : }
3213 : 0 : next_after_fail946:;
3214 : 0 : return false;
3215 : : }
3216 : :
3217 : : bool
3218 : 0 : gimple_simplify_485 (gimple_match_op *res_op, gimple_seq *seq,
3219 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3220 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3221 : : const enum tree_code ARG_UNUSED (minmax),
3222 : : const enum tree_code ARG_UNUSED (cmp))
3223 : : {
3224 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3225 : 0 : {
3226 : 0 : poly_int64 off0, off1;
3227 : 0 : tree base0, base1;
3228 : 0 : int equal = address_compare (cmp, TREE_TYPE (captures[0]), captures[1], captures[3], base0, base1,
3229 : : off0, off1,
3230 : :
3231 : : );
3232 : 0 : if (equal == 1
3233 : : )
3234 : : {
3235 : 0 : if (minmax == MIN_EXPR
3236 : : )
3237 : : {
3238 : 0 : if (known_le (off0, off1)
3239 : : )
3240 : : {
3241 : 0 : gimple_seq *lseq = seq;
3242 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail953;
3243 : 0 : {
3244 : 0 : tree tem;
3245 : 0 : tem = captures[0];
3246 : 0 : res_op->set_value (tem);
3247 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 671, __FILE__, __LINE__, true);
3248 : 0 : return true;
3249 : : }
3250 : 0 : next_after_fail953:;
3251 : : }
3252 : : else
3253 : : {
3254 : 0 : if (known_gt (off0, off1)
3255 : : )
3256 : : {
3257 : 0 : gimple_seq *lseq = seq;
3258 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail954;
3259 : 0 : {
3260 : 0 : tree tem;
3261 : 0 : tem = captures[2];
3262 : 0 : res_op->set_value (tem);
3263 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 672, __FILE__, __LINE__, true);
3264 : 0 : return true;
3265 : : }
3266 : 0 : next_after_fail954:;
3267 : : }
3268 : : }
3269 : : }
3270 : : else
3271 : : {
3272 : 0 : if (known_ge (off0, off1)
3273 : : )
3274 : : {
3275 : 0 : gimple_seq *lseq = seq;
3276 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail955;
3277 : 0 : {
3278 : 0 : tree tem;
3279 : 0 : tem = captures[0];
3280 : 0 : res_op->set_value (tem);
3281 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 673, __FILE__, __LINE__, true);
3282 : 0 : return true;
3283 : : }
3284 : 0 : next_after_fail955:;
3285 : : }
3286 : : else
3287 : : {
3288 : 0 : if (known_lt (off0, off1)
3289 : : )
3290 : : {
3291 : 0 : gimple_seq *lseq = seq;
3292 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail956;
3293 : 0 : {
3294 : 0 : tree tem;
3295 : 0 : tem = captures[2];
3296 : 0 : res_op->set_value (tem);
3297 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 674, __FILE__, __LINE__, true);
3298 : 0 : return true;
3299 : : }
3300 : 0 : next_after_fail956:;
3301 : : }
3302 : : }
3303 : : }
3304 : : }
3305 : : }
3306 : 0 : return false;
3307 : : }
3308 : :
3309 : : bool
3310 : 1 : gimple_simplify_502 (gimple_match_op *res_op, gimple_seq *seq,
3311 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3312 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3313 : : const enum tree_code ARG_UNUSED (op))
3314 : : {
3315 : 1 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3316 : 1 : gimple_seq *lseq = seq;
3317 : 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail979;
3318 : 1 : {
3319 : 1 : tree tem;
3320 : 1 : tem = captures[2];
3321 : 1 : res_op->set_value (tem);
3322 : 1 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 689, __FILE__, __LINE__, true);
3323 : : return true;
3324 : : }
3325 : 0 : next_after_fail979:;
3326 : 0 : return false;
3327 : : }
3328 : :
3329 : : bool
3330 : 61313 : gimple_simplify_510 (gimple_match_op *res_op, gimple_seq *seq,
3331 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3332 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3333 : : const enum tree_code ARG_UNUSED (cmp))
3334 : : {
3335 : 61313 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3336 : 61313 : if (!HONOR_SIGNED_ZEROS (type)
3337 : 61313 : && (
3338 : 26163 : (INTEGRAL_TYPE_P (type)
3339 : 25697 : && types_match (TREE_TYPE (captures[0]), TREE_TYPE (captures[1]))
3340 : 25697 : && types_match (TREE_TYPE (captures[2]), TREE_TYPE (captures[3]))
3341 : 25697 : && TYPE_PRECISION (TREE_TYPE (captures[1])) <= TYPE_PRECISION (type)
3342 : 25697 : && TYPE_PRECISION (TREE_TYPE (captures[3])) <= TYPE_PRECISION (type))
3343 : 466 : || (types_match (type, TREE_TYPE (captures[1]))
3344 : 466 : && types_match (type, TREE_TYPE (captures[3]))))
3345 : : )
3346 : : {
3347 : 26163 : if (cmp == EQ_EXPR
3348 : : )
3349 : : {
3350 : 57 : if (VECTOR_TYPE_P (type)
3351 : : )
3352 : : {
3353 : 0 : gimple_seq *lseq = seq;
3354 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1023;
3355 : 0 : {
3356 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3357 : 0 : res_op->ops[0] = captures[2];
3358 : 0 : res_op->resimplify (lseq, valueize);
3359 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 697, __FILE__, __LINE__, true);
3360 : 0 : return true;
3361 : : }
3362 : 0 : next_after_fail1023:;
3363 : : }
3364 : : else
3365 : : {
3366 : 57 : gimple_seq *lseq = seq;
3367 : 57 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1024;
3368 : 57 : {
3369 : 57 : res_op->set_op (NOP_EXPR, type, 1);
3370 : 57 : res_op->ops[0] = captures[2];
3371 : 57 : res_op->resimplify (lseq, valueize);
3372 : 57 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 698, __FILE__, __LINE__, true);
3373 : 57 : return true;
3374 : : }
3375 : 0 : next_after_fail1024:;
3376 : : }
3377 : : }
3378 : : else
3379 : : {
3380 : : if (cmp == NE_EXPR
3381 : : )
3382 : : {
3383 : 329 : if (VECTOR_TYPE_P (type)
3384 : : )
3385 : : {
3386 : 0 : gimple_seq *lseq = seq;
3387 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1025;
3388 : 0 : {
3389 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3390 : 0 : res_op->ops[0] = captures[0];
3391 : 0 : res_op->resimplify (lseq, valueize);
3392 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 699, __FILE__, __LINE__, true);
3393 : 0 : return true;
3394 : : }
3395 : 0 : next_after_fail1025:;
3396 : : }
3397 : : else
3398 : : {
3399 : 329 : gimple_seq *lseq = seq;
3400 : 329 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1026;
3401 : 329 : {
3402 : 329 : res_op->set_op (NOP_EXPR, type, 1);
3403 : 329 : res_op->ops[0] = captures[0];
3404 : 329 : res_op->resimplify (lseq, valueize);
3405 : 329 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 700, __FILE__, __LINE__, true);
3406 : 329 : return true;
3407 : : }
3408 : 0 : next_after_fail1026:;
3409 : : }
3410 : : }
3411 : : else
3412 : : {
3413 : : if (cmp == LE_EXPR || cmp == UNLE_EXPR || cmp == LT_EXPR || cmp == UNLT_EXPR
3414 : : )
3415 : : {
3416 : 8408 : if (!HONOR_NANS (type)
3417 : : )
3418 : : {
3419 : 8396 : if (VECTOR_TYPE_P (type)
3420 : : )
3421 : : {
3422 : 0 : gimple_seq *lseq = seq;
3423 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1027;
3424 : 0 : {
3425 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3426 : 0 : {
3427 : 0 : tree _o1[2], _r1;
3428 : 0 : _o1[0] = captures[0];
3429 : 0 : _o1[1] = captures[2];
3430 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3431 : 0 : tem_op.resimplify (lseq, valueize);
3432 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3433 : 0 : if (!_r1) goto next_after_fail1027;
3434 : 0 : res_op->ops[0] = _r1;
3435 : : }
3436 : 0 : res_op->resimplify (lseq, valueize);
3437 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 701, __FILE__, __LINE__, true);
3438 : 0 : return true;
3439 : : }
3440 : : next_after_fail1027:;
3441 : : }
3442 : : else
3443 : : {
3444 : 8396 : gimple_seq *lseq = seq;
3445 : 8396 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1028;
3446 : 8396 : {
3447 : 8396 : res_op->set_op (NOP_EXPR, type, 1);
3448 : 8396 : {
3449 : 8396 : tree _o1[2], _r1;
3450 : 8396 : _o1[0] = captures[0];
3451 : 8396 : _o1[1] = captures[2];
3452 : 8396 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3453 : 8396 : tem_op.resimplify (lseq, valueize);
3454 : 8396 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3455 : 8396 : if (!_r1) goto next_after_fail1028;
3456 : 8118 : res_op->ops[0] = _r1;
3457 : : }
3458 : 8118 : res_op->resimplify (lseq, valueize);
3459 : 8118 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 702, __FILE__, __LINE__, true);
3460 : 8118 : return true;
3461 : : }
3462 : : next_after_fail1028:;
3463 : : }
3464 : : }
3465 : : }
3466 : : else
3467 : : {
3468 : : if (cmp == GE_EXPR || cmp == UNGE_EXPR || cmp == GT_EXPR || cmp == UNGT_EXPR
3469 : : )
3470 : : {
3471 : 17369 : if (!HONOR_NANS (type)
3472 : : )
3473 : : {
3474 : 17369 : if (VECTOR_TYPE_P (type)
3475 : : )
3476 : : {
3477 : 0 : gimple_seq *lseq = seq;
3478 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1029;
3479 : 0 : {
3480 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3481 : 0 : {
3482 : 0 : tree _o1[2], _r1;
3483 : 0 : _o1[0] = captures[0];
3484 : 0 : _o1[1] = captures[2];
3485 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MAX_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3486 : 0 : tem_op.resimplify (lseq, valueize);
3487 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3488 : 0 : if (!_r1) goto next_after_fail1029;
3489 : 0 : res_op->ops[0] = _r1;
3490 : : }
3491 : 0 : res_op->resimplify (lseq, valueize);
3492 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 703, __FILE__, __LINE__, true);
3493 : 0 : return true;
3494 : : }
3495 : : next_after_fail1029:;
3496 : : }
3497 : : else
3498 : : {
3499 : 17369 : gimple_seq *lseq = seq;
3500 : 17369 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1030;
3501 : 17369 : {
3502 : 17369 : res_op->set_op (NOP_EXPR, type, 1);
3503 : 17369 : {
3504 : 17369 : tree _o1[2], _r1;
3505 : 17369 : _o1[0] = captures[0];
3506 : 17369 : _o1[1] = captures[2];
3507 : 17369 : gimple_match_op tem_op (res_op->cond.any_else (), MAX_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3508 : 17369 : tem_op.resimplify (lseq, valueize);
3509 : 17369 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3510 : 17369 : if (!_r1) goto next_after_fail1030;
3511 : 13723 : res_op->ops[0] = _r1;
3512 : : }
3513 : 13723 : res_op->resimplify (lseq, valueize);
3514 : 13723 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 704, __FILE__, __LINE__, true);
3515 : 13723 : return true;
3516 : : }
3517 : : next_after_fail1030:;
3518 : : }
3519 : : }
3520 : : }
3521 : : else
3522 : : {
3523 : : if (cmp == UNEQ_EXPR
3524 : : )
3525 : : {
3526 : 0 : if (!HONOR_NANS (type)
3527 : : )
3528 : : {
3529 : 0 : if (VECTOR_TYPE_P (type)
3530 : : )
3531 : : {
3532 : 0 : gimple_seq *lseq = seq;
3533 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1031;
3534 : 0 : {
3535 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3536 : 0 : res_op->ops[0] = captures[2];
3537 : 0 : res_op->resimplify (lseq, valueize);
3538 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 705, __FILE__, __LINE__, true);
3539 : 0 : return true;
3540 : : }
3541 : 0 : next_after_fail1031:;
3542 : : }
3543 : : else
3544 : : {
3545 : 0 : gimple_seq *lseq = seq;
3546 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1032;
3547 : 0 : {
3548 : 0 : res_op->set_op (NOP_EXPR, type, 1);
3549 : 0 : res_op->ops[0] = captures[2];
3550 : 0 : res_op->resimplify (lseq, valueize);
3551 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 706, __FILE__, __LINE__, true);
3552 : 0 : return true;
3553 : : }
3554 : 0 : next_after_fail1032:;
3555 : : }
3556 : : }
3557 : : }
3558 : : else
3559 : : {
3560 : : if (cmp == LTGT_EXPR
3561 : : )
3562 : : {
3563 : 0 : if (!HONOR_NANS (type)
3564 : : )
3565 : : {
3566 : 0 : if (VECTOR_TYPE_P (type)
3567 : : )
3568 : : {
3569 : 0 : gimple_seq *lseq = seq;
3570 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1033;
3571 : 0 : {
3572 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3573 : 0 : res_op->ops[0] = captures[0];
3574 : 0 : res_op->resimplify (lseq, valueize);
3575 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 707, __FILE__, __LINE__, true);
3576 : 0 : return true;
3577 : : }
3578 : 0 : next_after_fail1033:;
3579 : : }
3580 : : else
3581 : : {
3582 : 0 : gimple_seq *lseq = seq;
3583 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1034;
3584 : 0 : {
3585 : 0 : res_op->set_op (NOP_EXPR, type, 1);
3586 : 0 : res_op->ops[0] = captures[0];
3587 : 0 : res_op->resimplify (lseq, valueize);
3588 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 708, __FILE__, __LINE__, true);
3589 : 0 : return true;
3590 : : }
3591 : 0 : next_after_fail1034:;
3592 : : }
3593 : : }
3594 : : }
3595 : : }
3596 : : }
3597 : : }
3598 : : }
3599 : : }
3600 : : }
3601 : : return false;
3602 : : }
3603 : :
3604 : : bool
3605 : 68 : gimple_simplify_547 (gimple_match_op *res_op, gimple_seq *seq,
3606 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3607 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3608 : : const enum tree_code ARG_UNUSED (cmp))
3609 : : {
3610 : 68 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3611 : 68 : if (INTEGRAL_TYPE_P (type)
3612 : 68 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
3613 : 68 : && !TYPE_UNSIGNED (TREE_TYPE (captures[0]))
3614 : 136 : && TYPE_PRECISION (TREE_TYPE (captures[0])) == TYPE_PRECISION (type)
3615 : : )
3616 : : {
3617 : 62 : {
3618 : 62 : tree shifter = build_int_cst (integer_type_node, TYPE_PRECISION (type) - 1);
3619 : 62 : if (cmp == LT_EXPR
3620 : : )
3621 : : {
3622 : 60 : gimple_seq *lseq = seq;
3623 : 60 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1078;
3624 : 60 : {
3625 : 60 : res_op->set_op (BIT_XOR_EXPR, type, 2);
3626 : 60 : {
3627 : 60 : tree _o1[1], _r1;
3628 : 60 : {
3629 : 60 : tree _o2[2], _r2;
3630 : 60 : _o2[0] = captures[0];
3631 : 60 : _o2[1] = shifter;
3632 : 60 : gimple_match_op tem_op (res_op->cond.any_else (), RSHIFT_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
3633 : 60 : tem_op.resimplify (lseq, valueize);
3634 : 60 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
3635 : 60 : if (!_r2) goto next_after_fail1078;
3636 : 60 : _o1[0] = _r2;
3637 : : }
3638 : 60 : if (type != TREE_TYPE (_o1[0])
3639 : 60 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
3640 : : {
3641 : 28 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
3642 : 28 : tem_op.resimplify (lseq, valueize);
3643 : 28 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3644 : 28 : if (!_r1) goto next_after_fail1078;
3645 : : }
3646 : : else
3647 : : _r1 = _o1[0];
3648 : 60 : res_op->ops[0] = _r1;
3649 : : }
3650 : 60 : res_op->ops[1] = captures[1];
3651 : 60 : res_op->resimplify (lseq, valueize);
3652 : 60 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 738, __FILE__, __LINE__, true);
3653 : 60 : return true;
3654 : : }
3655 : : next_after_fail1078:;
3656 : : }
3657 : : else
3658 : : {
3659 : 2 : gimple_seq *lseq = seq;
3660 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1079;
3661 : 2 : {
3662 : 2 : res_op->set_op (BIT_NOT_EXPR, type, 1);
3663 : 2 : {
3664 : 2 : tree _o1[2], _r1;
3665 : 2 : {
3666 : 2 : tree _o2[1], _r2;
3667 : 2 : {
3668 : 2 : tree _o3[2], _r3;
3669 : 2 : _o3[0] = captures[0];
3670 : 2 : _o3[1] = shifter;
3671 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), RSHIFT_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
3672 : 2 : tem_op.resimplify (lseq, valueize);
3673 : 2 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
3674 : 2 : if (!_r3) goto next_after_fail1079;
3675 : 2 : _o2[0] = _r3;
3676 : : }
3677 : 2 : if (type != TREE_TYPE (_o2[0])
3678 : 2 : && !useless_type_conversion_p (type, TREE_TYPE (_o2[0])))
3679 : : {
3680 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o2[0]);
3681 : 2 : tem_op.resimplify (lseq, valueize);
3682 : 2 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
3683 : 2 : if (!_r2) goto next_after_fail1079;
3684 : : }
3685 : : else
3686 : : _r2 = _o2[0];
3687 : 2 : _o1[0] = _r2;
3688 : : }
3689 : 2 : _o1[1] = captures[1];
3690 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_XOR_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
3691 : 2 : tem_op.resimplify (lseq, valueize);
3692 : 2 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3693 : 2 : if (!_r1) goto next_after_fail1079;
3694 : 2 : res_op->ops[0] = _r1;
3695 : : }
3696 : 2 : res_op->resimplify (lseq, valueize);
3697 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 739, __FILE__, __LINE__, true);
3698 : 2 : return true;
3699 : : }
3700 : : next_after_fail1079:;
3701 : : }
3702 : : }
3703 : : }
3704 : : return false;
3705 : : }
3706 : :
3707 : : bool
3708 : 58 : gimple_simplify_564 (gimple_match_op *res_op, gimple_seq *seq,
3709 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3710 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3711 : : const combined_fn ARG_UNUSED (func))
3712 : : {
3713 : 58 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3714 : 58 : {
3715 : 58 : int val;
3716 : 58 : internal_fn ifn = IFN_LAST;
3717 : 58 : if (TREE_CODE (TREE_TYPE (captures[2])) == BITINT_TYPE)
3718 : : {
3719 : 0 : if (tree_fits_shwi_p (captures[3]))
3720 : : {
3721 : 0 : HOST_WIDE_INT valw = tree_to_shwi (captures[3]);
3722 : 0 : if ((int) valw == valw)
3723 : : {
3724 : 0 : val = valw;
3725 : 0 : ifn = IFN_CTZ;
3726 : : }
3727 : : }
3728 : : }
3729 : 58 : else if (direct_internal_fn_supported_p (IFN_CTZ, TREE_TYPE (captures[2]),
3730 : : OPTIMIZE_FOR_BOTH)
3731 : 116 : && CTZ_DEFINED_VALUE_AT_ZERO
3732 : : (SCALAR_INT_TYPE_MODE (TREE_TYPE (captures[2])), val) == 2)
3733 : 0 : ifn = IFN_CTZ;
3734 : 58 : if (ifn == IFN_CTZ && wi::to_widest (captures[3]) == val
3735 : : )
3736 : : {
3737 : 0 : gimple_seq *lseq = seq;
3738 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1104;
3739 : 0 : {
3740 : 0 : res_op->set_op (CFN_CTZ, type, 2);
3741 : 0 : res_op->ops[0] = captures[2];
3742 : 0 : res_op->ops[1] = captures[3];
3743 : 0 : res_op->resimplify (lseq, valueize);
3744 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 754, __FILE__, __LINE__, true);
3745 : 0 : return true;
3746 : : }
3747 : 0 : next_after_fail1104:;
3748 : : }
3749 : : }
3750 : 58 : return false;
3751 : : }
3752 : :
3753 : : bool
3754 : 494 : gimple_simplify_576 (gimple_match_op *res_op, gimple_seq *seq,
3755 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3756 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3757 : : const enum tree_code ARG_UNUSED (cmp),
3758 : : const enum tree_code ARG_UNUSED (minmax),
3759 : : const enum tree_code ARG_UNUSED (MINMAX))
3760 : : {
3761 : 494 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3762 : 494 : if (VECTOR_INTEGER_TYPE_P (type)
3763 : 498 : && target_supports_op_p (type, MINMAX, optab_vector)
3764 : : )
3765 : : {
3766 : 4 : gimple_seq *lseq = seq;
3767 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1118;
3768 : 4 : {
3769 : 4 : res_op->set_op (minmax, type, 2);
3770 : 4 : res_op->ops[0] = captures[0];
3771 : 4 : res_op->ops[1] = captures[1];
3772 : 4 : res_op->resimplify (lseq, valueize);
3773 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 766, __FILE__, __LINE__, true);
3774 : 4 : return true;
3775 : : }
3776 : 0 : next_after_fail1118:;
3777 : : }
3778 : : return false;
3779 : : }
3780 : :
3781 : : bool
3782 : 36 : gimple_simplify_585 (gimple_match_op *res_op, gimple_seq *seq,
3783 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3784 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3785 : : const combined_fn ARG_UNUSED (cond_op))
3786 : : {
3787 : 36 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3788 : 36 : {
3789 : 36 : tree op_type = TREE_TYPE (captures[5]);
3790 : 36 : if (inverse_conditions_p (captures[0], captures[2])
3791 : 36 : && element_precision (type) == element_precision (op_type)
3792 : : )
3793 : : {
3794 : 0 : gimple_seq *lseq = seq;
3795 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1127;
3796 : 0 : {
3797 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3798 : 0 : {
3799 : 0 : tree _o1[4], _r1;
3800 : 0 : _o1[0] = captures[2];
3801 : 0 : _o1[1] = captures[3];
3802 : 0 : _o1[2] = captures[4];
3803 : 0 : {
3804 : 0 : tree _o2[1], _r2;
3805 : 0 : _o2[0] = captures[1];
3806 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, op_type, _o2[0]);
3807 : 0 : tem_op.resimplify (lseq, valueize);
3808 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
3809 : 0 : if (!_r2) goto next_after_fail1127;
3810 : 0 : _o1[3] = _r2;
3811 : : }
3812 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), cond_op, TREE_TYPE (_o1[1]), _o1[0], _o1[1], _o1[2], _o1[3]);
3813 : 0 : tem_op.resimplify (lseq, valueize);
3814 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3815 : 0 : if (!_r1) goto next_after_fail1127;
3816 : 0 : res_op->ops[0] = _r1;
3817 : : }
3818 : 0 : res_op->resimplify (lseq, valueize);
3819 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 770, __FILE__, __LINE__, true);
3820 : 0 : return true;
3821 : : }
3822 : : next_after_fail1127:;
3823 : : }
3824 : : }
3825 : : return false;
3826 : : }
3827 : :
3828 : : bool
3829 : 0 : gimple_simplify_591 (gimple_match_op *res_op, gimple_seq *seq,
3830 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3831 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3832 : : const combined_fn ARG_UNUSED (cond_len_op))
3833 : : {
3834 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3835 : 0 : {
3836 : 0 : tree op_type = TREE_TYPE (captures[6]);
3837 : 0 : if (inverse_conditions_p (captures[0], captures[2])
3838 : 0 : && element_precision (type) == element_precision (op_type)
3839 : : )
3840 : : {
3841 : 0 : gimple_seq *lseq = seq;
3842 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1133;
3843 : 0 : {
3844 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
3845 : 0 : {
3846 : 0 : tree _o1[7], _r1;
3847 : 0 : _o1[0] = captures[2];
3848 : 0 : _o1[1] = captures[3];
3849 : 0 : _o1[2] = captures[4];
3850 : 0 : _o1[3] = captures[5];
3851 : 0 : {
3852 : 0 : tree _o2[1], _r2;
3853 : 0 : _o2[0] = captures[1];
3854 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, op_type, _o2[0]);
3855 : 0 : tem_op.resimplify (lseq, valueize);
3856 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
3857 : 0 : if (!_r2) goto next_after_fail1133;
3858 : 0 : _o1[4] = _r2;
3859 : : }
3860 : 0 : _o1[5] = captures[7];
3861 : 0 : _o1[6] = captures[8];
3862 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), cond_len_op, TREE_TYPE (_o1[1]), _o1[0], _o1[1], _o1[2], _o1[3], _o1[4], _o1[5], _o1[6]);
3863 : 0 : tem_op.resimplify (lseq, valueize);
3864 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3865 : 0 : if (!_r1) goto next_after_fail1133;
3866 : 0 : res_op->ops[0] = _r1;
3867 : : }
3868 : 0 : res_op->resimplify (lseq, valueize);
3869 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 776, __FILE__, __LINE__, true);
3870 : 0 : return true;
3871 : : }
3872 : : next_after_fail1133:;
3873 : : }
3874 : : }
3875 : : return false;
3876 : : }
3877 : :
3878 : : bool
3879 : 624 : gimple_simplify_604 (gimple_match_op *res_op, gimple_seq *seq,
3880 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3881 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3882 : : const combined_fn ARG_UNUSED (fns))
3883 : : {
3884 : 624 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3885 : 624 : gimple_seq *lseq = seq;
3886 : 624 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1146;
3887 : 624 : {
3888 : 624 : tree tem;
3889 : 624 : tem = captures[0];
3890 : 624 : res_op->set_value (tem);
3891 : 624 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 789, __FILE__, __LINE__, true);
3892 : : return true;
3893 : : }
3894 : 0 : next_after_fail1146:;
3895 : 0 : return false;
3896 : : }
3897 : :
3898 : : bool
3899 : 1588 : gimple_simplify_611 (gimple_match_op *res_op, gimple_seq *seq,
3900 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3901 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3902 : : const combined_fn ARG_UNUSED (froms),
3903 : : const combined_fn ARG_UNUSED (tos))
3904 : : {
3905 : 1588 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3906 : 1588 : if (optimize && canonicalize_math_p ()
3907 : : )
3908 : : {
3909 : 1588 : gimple_seq *lseq = seq;
3910 : 1588 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1153;
3911 : 1588 : {
3912 : 1588 : res_op->set_op (tos, type, 1);
3913 : 1588 : res_op->ops[0] = captures[0];
3914 : 1588 : res_op->resimplify (lseq, valueize);
3915 : 1588 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 796, __FILE__, __LINE__, true);
3916 : 1588 : return true;
3917 : : }
3918 : 0 : next_after_fail1153:;
3919 : : }
3920 : : return false;
3921 : : }
3922 : :
3923 : : bool
3924 : 38718 : gimple_simplify_618 (gimple_match_op *res_op, gimple_seq *seq,
3925 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3926 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3927 : : const combined_fn ARG_UNUSED (SIGNBIT))
3928 : : {
3929 : 38718 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3930 : 38718 : if (!HONOR_SIGNED_ZEROS (captures[0])
3931 : : )
3932 : : {
3933 : 10 : gimple_seq *lseq = seq;
3934 : 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1160;
3935 : 10 : {
3936 : 10 : res_op->set_op (NOP_EXPR, type, 1);
3937 : 10 : {
3938 : 10 : tree _o1[2], _r1;
3939 : 10 : _o1[0] = captures[0];
3940 : 10 : _o1[1] = build_real (TREE_TYPE (captures[0]), dconst0);
3941 : 10 : gimple_match_op tem_op (res_op->cond.any_else (), LT_EXPR, boolean_type_node, _o1[0], _o1[1]);
3942 : 10 : tem_op.resimplify (lseq, valueize);
3943 : 10 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
3944 : 10 : if (!_r1) goto next_after_fail1160;
3945 : 10 : res_op->ops[0] = _r1;
3946 : : }
3947 : 10 : res_op->resimplify (lseq, valueize);
3948 : 10 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 803, __FILE__, __LINE__, true);
3949 : 10 : return true;
3950 : : }
3951 : : next_after_fail1160:;
3952 : : }
3953 : : return false;
3954 : : }
3955 : :
3956 : : bool
3957 : 16 : gimple_simplify_626 (gimple_match_op *res_op, gimple_seq *seq,
3958 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3959 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures))
3960 : : {
3961 : 16 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3962 : 16 : if (canonicalize_math_after_vectorization_p ()
3963 : : )
3964 : : {
3965 : 16 : gimple_seq *lseq = seq;
3966 : 16 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1168;
3967 : 16 : {
3968 : 16 : res_op->set_op (CFN_FMS, type, 3);
3969 : 16 : res_op->ops[0] = captures[0];
3970 : 16 : res_op->ops[1] = captures[1];
3971 : 16 : res_op->ops[2] = captures[2];
3972 : 16 : res_op->resimplify (lseq, valueize);
3973 : 16 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 811, __FILE__, __LINE__, true);
3974 : 16 : return true;
3975 : : }
3976 : 0 : next_after_fail1168:;
3977 : : }
3978 : : return false;
3979 : : }
3980 : :
3981 : : bool
3982 : 6 : gimple_simplify_635 (gimple_match_op *res_op, gimple_seq *seq,
3983 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
3984 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
3985 : : const combined_fn ARG_UNUSED (PARITY))
3986 : : {
3987 : 6 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
3988 : 6 : gimple_seq *lseq = seq;
3989 : 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1182;
3990 : 6 : {
3991 : 6 : res_op->set_op (PARITY, type, 1);
3992 : 6 : res_op->ops[0] = captures[0];
3993 : 6 : res_op->resimplify (lseq, valueize);
3994 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 823, __FILE__, __LINE__, true);
3995 : : return true;
3996 : : }
3997 : 0 : next_after_fail1182:;
3998 : 0 : return false;
3999 : : }
4000 : :
4001 : : bool
4002 : 0 : gimple_simplify_637 (gimple_match_op *res_op, gimple_seq *seq,
4003 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4004 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
4005 : : const enum tree_code ARG_UNUSED (rot),
4006 : : const combined_fn ARG_UNUSED (parity))
4007 : : {
4008 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4009 : 0 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
4010 : 0 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
4011 : : && (
4012 : : 1
4013 : : || !TREE_SIDE_EFFECTS (captures[3]))
4014 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[0]))
4015 : 0 : >= TYPE_PRECISION (TREE_TYPE (captures[1]))
4016 : : )
4017 : : {
4018 : 0 : {
4019 : 0 : tree type0 = TREE_TYPE (captures[0]);
4020 : 0 : gimple_seq *lseq = seq;
4021 : 0 : if (lseq
4022 : 0 : && (!single_use (captures[1])))
4023 : 0 : lseq = NULL;
4024 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1184;
4025 : 0 : {
4026 : 0 : res_op->set_op (parity, type, 1);
4027 : 0 : {
4028 : 0 : tree _o1[1], _r1;
4029 : 0 : _o1[0] = captures[2];
4030 : 0 : if (type0 != TREE_TYPE (_o1[0])
4031 : 0 : && !useless_type_conversion_p (type0, TREE_TYPE (_o1[0])))
4032 : : {
4033 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type0, _o1[0]);
4034 : 0 : tem_op.resimplify (lseq, valueize);
4035 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4036 : 0 : if (!_r1) goto next_after_fail1184;
4037 : : }
4038 : : else
4039 : : _r1 = _o1[0];
4040 : 0 : res_op->ops[0] = _r1;
4041 : : }
4042 : 0 : res_op->resimplify (lseq, valueize);
4043 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 825, __FILE__, __LINE__, true);
4044 : 0 : return true;
4045 : : }
4046 : : next_after_fail1184:;
4047 : : }
4048 : : }
4049 : : return false;
4050 : : }
4051 : :
4052 : : bool
4053 : 0 : gimple_simplify_644 (gimple_match_op *res_op, gimple_seq *seq,
4054 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4055 : : const tree ARG_UNUSED (type), tree *ARG_UNUSED (captures),
4056 : : const combined_fn ARG_UNUSED (uncond_op),
4057 : : const combined_fn ARG_UNUSED (cond_op))
4058 : : {
4059 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4060 : 0 : {
4061 : 0 : tree op_type = TREE_TYPE (captures[2]);
4062 : 0 : if (vectorized_internal_fn_supported_p (as_internal_fn (cond_op), op_type)
4063 : 0 : && is_truth_type_for (op_type, TREE_TYPE (captures[0]))
4064 : 0 : && single_use (captures[2])
4065 : : )
4066 : : {
4067 : 0 : gimple_seq *lseq = seq;
4068 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1195;
4069 : 0 : {
4070 : 0 : res_op->set_op (VIEW_CONVERT_EXPR, type, 1);
4071 : 0 : {
4072 : 0 : tree _o1[7], _r1;
4073 : 0 : {
4074 : 0 : tree _o2[1], _r2;
4075 : 0 : _o2[0] = captures[0];
4076 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), BIT_NOT_EXPR, TREE_TYPE (_o2[0]), _o2[0]);
4077 : 0 : tem_op.resimplify (lseq, valueize);
4078 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4079 : 0 : if (!_r2) goto next_after_fail1195;
4080 : 0 : _o1[0] = _r2;
4081 : : }
4082 : 0 : _o1[1] = captures[3];
4083 : 0 : _o1[2] = captures[4];
4084 : 0 : _o1[3] = captures[5];
4085 : 0 : {
4086 : 0 : tree _o2[1], _r2;
4087 : 0 : _o2[0] = captures[1];
4088 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), VIEW_CONVERT_EXPR, op_type, _o2[0]);
4089 : 0 : tem_op.resimplify (lseq, valueize);
4090 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4091 : 0 : if (!_r2) goto next_after_fail1195;
4092 : 0 : _o1[4] = _r2;
4093 : : }
4094 : 0 : _o1[5] = captures[6];
4095 : 0 : _o1[6] = captures[7];
4096 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), cond_op, TREE_TYPE (_o1[1]), _o1[0], _o1[1], _o1[2], _o1[3], _o1[4], _o1[5], _o1[6]);
4097 : 0 : tem_op.resimplify (lseq, valueize);
4098 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4099 : 0 : if (!_r1) goto next_after_fail1195;
4100 : 0 : res_op->ops[0] = _r1;
4101 : : }
4102 : 0 : res_op->resimplify (lseq, valueize);
4103 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 834, __FILE__, __LINE__, true);
4104 : 0 : return true;
4105 : : }
4106 : : next_after_fail1195:;
4107 : : }
4108 : : }
4109 : : return false;
4110 : : }
4111 : :
4112 : : bool
4113 : 2468 : gimple_simplify_CFN_BUILT_IN_COSL (gimple_match_op *res_op, gimple_seq *seq,
4114 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4115 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
4116 : : {
4117 : 2468 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4118 : 2468 : switch (TREE_CODE (_p0))
4119 : : {
4120 : 2355 : case SSA_NAME:
4121 : 2355 : if (gimple *_d1 = get_def (valueize, _p0))
4122 : : {
4123 : 1279 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
4124 : 802 : switch (gimple_assign_rhs_code (_a1))
4125 : : {
4126 : 29 : case NEGATE_EXPR:
4127 : 29 : {
4128 : 29 : tree _q20 = gimple_assign_rhs1 (_a1);
4129 : 29 : _q20 = do_valueize (valueize, _q20);
4130 : 29 : {
4131 : 29 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4132 : 29 : const combined_fn coss = CFN_BUILT_IN_COSL;
4133 : 29 : gimple_seq *lseq = seq;
4134 : 29 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1232;
4135 : 29 : {
4136 : 29 : res_op->set_op (coss, type, 1);
4137 : 29 : res_op->ops[0] = captures[0];
4138 : 29 : res_op->resimplify (lseq, valueize);
4139 : 29 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 860, __FILE__, __LINE__, true);
4140 : 29 : return true;
4141 : : }
4142 : 0 : next_after_fail1232:;
4143 : : }
4144 : 0 : break;
4145 : : }
4146 : 9 : case ABS_EXPR:
4147 : 9 : {
4148 : 9 : tree _q20 = gimple_assign_rhs1 (_a1);
4149 : 9 : _q20 = do_valueize (valueize, _q20);
4150 : 9 : {
4151 : 9 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4152 : 9 : const combined_fn coss = CFN_BUILT_IN_COSL;
4153 : 9 : gimple_seq *lseq = seq;
4154 : 9 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1233;
4155 : 9 : {
4156 : 9 : res_op->set_op (coss, type, 1);
4157 : 9 : res_op->ops[0] = captures[0];
4158 : 9 : res_op->resimplify (lseq, valueize);
4159 : 9 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 860, __FILE__, __LINE__, true);
4160 : 9 : return true;
4161 : : }
4162 : 0 : next_after_fail1233:;
4163 : : }
4164 : 0 : break;
4165 : : }
4166 : : default:;
4167 : : }
4168 : 537 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
4169 : 193 : switch (gimple_call_combined_fn (_c1))
4170 : : {
4171 : 0 : case CFN_BUILT_IN_COPYSIGN:
4172 : 0 : if (gimple_call_num_args (_c1) == 2)
4173 : : {
4174 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
4175 : 0 : _q20 = do_valueize (valueize, _q20);
4176 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
4177 : 0 : _q21 = do_valueize (valueize, _q21);
4178 : 0 : {
4179 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4180 : 0 : if (gimple_simplify_398 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN, CFN_BUILT_IN_COSL))
4181 : 0 : return true;
4182 : : }
4183 : : }
4184 : : break;
4185 : 0 : case CFN_BUILT_IN_COPYSIGNF:
4186 : 0 : if (gimple_call_num_args (_c1) == 2)
4187 : : {
4188 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
4189 : 0 : _q20 = do_valueize (valueize, _q20);
4190 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
4191 : 0 : _q21 = do_valueize (valueize, _q21);
4192 : 0 : {
4193 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4194 : 0 : if (gimple_simplify_398 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF, CFN_BUILT_IN_COSL))
4195 : 0 : return true;
4196 : : }
4197 : : }
4198 : : break;
4199 : 4 : case CFN_BUILT_IN_COPYSIGNL:
4200 : 4 : if (gimple_call_num_args (_c1) == 2)
4201 : : {
4202 : 4 : tree _q20 = gimple_call_arg (_c1, 0);
4203 : 4 : _q20 = do_valueize (valueize, _q20);
4204 : 4 : tree _q21 = gimple_call_arg (_c1, 1);
4205 : 4 : _q21 = do_valueize (valueize, _q21);
4206 : 4 : {
4207 : 4 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4208 : 4 : if (gimple_simplify_398 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL, CFN_BUILT_IN_COSL))
4209 : 4 : return true;
4210 : : }
4211 : : }
4212 : : break;
4213 : 12 : case CFN_BUILT_IN_ATANL:
4214 : 12 : if (gimple_call_num_args (_c1) == 1)
4215 : : {
4216 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
4217 : 12 : _q20 = do_valueize (valueize, _q20);
4218 : 12 : {
4219 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
4220 : 12 : if (gimple_simplify_399 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COSL, CFN_BUILT_IN_ATANL, CFN_BUILT_IN_SQRTL, CFN_BUILT_IN_COPYSIGNL))
4221 : 2 : return true;
4222 : : }
4223 : : }
4224 : : break;
4225 : 0 : case CFN_COPYSIGN:
4226 : 0 : if (gimple_call_num_args (_c1) == 2)
4227 : : {
4228 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
4229 : 0 : _q20 = do_valueize (valueize, _q20);
4230 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
4231 : 0 : _q21 = do_valueize (valueize, _q21);
4232 : 0 : {
4233 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4234 : 0 : if (gimple_simplify_398 (res_op, seq, valueize, type, captures, CFN_COPYSIGN, CFN_BUILT_IN_COSL))
4235 : 0 : return true;
4236 : : }
4237 : : }
4238 : : break;
4239 : : default:;
4240 : : }
4241 : : }
4242 : : break;
4243 : : default:;
4244 : : }
4245 : : return false;
4246 : : }
4247 : :
4248 : : bool
4249 : 571 : gimple_simplify_CFN_BUILT_IN_CCOSF (gimple_match_op *res_op, gimple_seq *seq,
4250 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4251 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
4252 : : {
4253 : 571 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4254 : 571 : switch (TREE_CODE (_p0))
4255 : : {
4256 : 556 : case SSA_NAME:
4257 : 556 : if (gimple *_d1 = get_def (valueize, _p0))
4258 : : {
4259 : 337 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
4260 : 397 : switch (gimple_assign_rhs_code (_a1))
4261 : : {
4262 : 18 : case NEGATE_EXPR:
4263 : 18 : {
4264 : 18 : tree _q20 = gimple_assign_rhs1 (_a1);
4265 : 18 : _q20 = do_valueize (valueize, _q20);
4266 : 18 : {
4267 : 18 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4268 : 18 : gimple_seq *lseq = seq;
4269 : 18 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1257;
4270 : 18 : {
4271 : 18 : res_op->set_op (CFN_BUILT_IN_CCOSF, type, 1);
4272 : 18 : res_op->ops[0] = captures[0];
4273 : 18 : res_op->resimplify (lseq, valueize);
4274 : 18 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 872, __FILE__, __LINE__, true);
4275 : 18 : return true;
4276 : : }
4277 : 0 : next_after_fail1257:;
4278 : : }
4279 : 0 : break;
4280 : : }
4281 : : default:;
4282 : : }
4283 : : }
4284 : : break;
4285 : : default:;
4286 : : }
4287 : : return false;
4288 : : }
4289 : :
4290 : : bool
4291 : 437 : gimple_simplify_CFN_BUILT_IN_CCOSHF (gimple_match_op *res_op, gimple_seq *seq,
4292 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4293 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
4294 : : {
4295 : 437 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4296 : 437 : switch (TREE_CODE (_p0))
4297 : : {
4298 : 429 : case SSA_NAME:
4299 : 429 : if (gimple *_d1 = get_def (valueize, _p0))
4300 : : {
4301 : 258 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
4302 : 378 : switch (gimple_assign_rhs_code (_a1))
4303 : : {
4304 : 14 : case NEGATE_EXPR:
4305 : 14 : {
4306 : 14 : tree _q20 = gimple_assign_rhs1 (_a1);
4307 : 14 : _q20 = do_valueize (valueize, _q20);
4308 : 14 : {
4309 : 14 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4310 : 14 : gimple_seq *lseq = seq;
4311 : 14 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1260;
4312 : 14 : {
4313 : 14 : res_op->set_op (CFN_BUILT_IN_CCOSHF, type, 1);
4314 : 14 : res_op->ops[0] = captures[0];
4315 : 14 : res_op->resimplify (lseq, valueize);
4316 : 14 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 872, __FILE__, __LINE__, true);
4317 : 14 : return true;
4318 : : }
4319 : 0 : next_after_fail1260:;
4320 : : }
4321 : 0 : break;
4322 : : }
4323 : : default:;
4324 : : }
4325 : : }
4326 : : break;
4327 : : default:;
4328 : : }
4329 : : return false;
4330 : : }
4331 : :
4332 : : bool
4333 : 4475 : gimple_simplify_CFN_BUILT_IN_CABS (gimple_match_op *res_op, gimple_seq *seq,
4334 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4335 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
4336 : : {
4337 : 4475 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4338 : 4475 : switch (TREE_CODE (_p0))
4339 : : {
4340 : 4423 : case SSA_NAME:
4341 : 4423 : if (gimple *_d1 = get_def (valueize, _p0))
4342 : : {
4343 : 2441 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
4344 : 2447 : switch (gimple_assign_rhs_code (_a1))
4345 : : {
4346 : 2 : case CONJ_EXPR:
4347 : 2 : {
4348 : 2 : tree _q20 = gimple_assign_rhs1 (_a1);
4349 : 2 : _q20 = do_valueize (valueize, _q20);
4350 : 2 : {
4351 : 2 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4352 : 2 : gimple_seq *lseq = seq;
4353 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1268;
4354 : 2 : {
4355 : 2 : res_op->set_op (CFN_BUILT_IN_CABS, type, 1);
4356 : 2 : res_op->ops[0] = captures[0];
4357 : 2 : res_op->resimplify (lseq, valueize);
4358 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 873, __FILE__, __LINE__, true);
4359 : 2 : return true;
4360 : : }
4361 : 0 : next_after_fail1268:;
4362 : : }
4363 : 0 : break;
4364 : : }
4365 : 16 : case NEGATE_EXPR:
4366 : 16 : {
4367 : 16 : tree _q20 = gimple_assign_rhs1 (_a1);
4368 : 16 : _q20 = do_valueize (valueize, _q20);
4369 : 16 : {
4370 : 16 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4371 : 16 : gimple_seq *lseq = seq;
4372 : 16 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1269;
4373 : 16 : {
4374 : 16 : res_op->set_op (CFN_BUILT_IN_CABS, type, 1);
4375 : 16 : res_op->ops[0] = captures[0];
4376 : 16 : res_op->resimplify (lseq, valueize);
4377 : 16 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 873, __FILE__, __LINE__, true);
4378 : 16 : return true;
4379 : : }
4380 : 0 : next_after_fail1269:;
4381 : : }
4382 : 0 : break;
4383 : : }
4384 : 1204 : case COMPLEX_EXPR:
4385 : 1204 : {
4386 : 1204 : tree _q20 = gimple_assign_rhs1 (_a1);
4387 : 1204 : _q20 = do_valueize (valueize, _q20);
4388 : 1204 : tree _q21 = gimple_assign_rhs2 (_a1);
4389 : 1204 : _q21 = do_valueize (valueize, _q21);
4390 : 1204 : if (real_zerop (_q21))
4391 : : {
4392 : 14 : {
4393 : 14 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4394 : 14 : gimple_seq *lseq = seq;
4395 : 14 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1270;
4396 : 14 : {
4397 : 14 : res_op->set_op (ABS_EXPR, type, 1);
4398 : 14 : res_op->ops[0] = captures[0];
4399 : 14 : res_op->resimplify (lseq, valueize);
4400 : 14 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 874, __FILE__, __LINE__, true);
4401 : 14 : return true;
4402 : : }
4403 : 0 : next_after_fail1270:;
4404 : : }
4405 : : }
4406 : 1190 : if (real_zerop (_q20))
4407 : : {
4408 : 0 : {
4409 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
4410 : 0 : gimple_seq *lseq = seq;
4411 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1271;
4412 : 0 : {
4413 : 0 : res_op->set_op (ABS_EXPR, type, 1);
4414 : 0 : res_op->ops[0] = captures[0];
4415 : 0 : res_op->resimplify (lseq, valueize);
4416 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 874, __FILE__, __LINE__, true);
4417 : 0 : return true;
4418 : : }
4419 : 0 : next_after_fail1271:;
4420 : : }
4421 : : }
4422 : 1190 : if ((_q21 == _q20 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q20, 0) && types_match (_q21, _q20)))
4423 : : {
4424 : 6 : {
4425 : 6 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
4426 : 6 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
4427 : : )
4428 : : {
4429 : 6 : gimple_seq *lseq = seq;
4430 : 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1272;
4431 : 6 : {
4432 : 6 : res_op->set_op (MULT_EXPR, type, 2);
4433 : 6 : {
4434 : 6 : tree _o1[1], _r1;
4435 : 6 : _o1[0] = captures[0];
4436 : 6 : gimple_match_op tem_op (res_op->cond.any_else (), ABS_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
4437 : 6 : tem_op.resimplify (lseq, valueize);
4438 : 6 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4439 : 6 : if (!_r1) goto next_after_fail1272;
4440 : 4 : res_op->ops[0] = _r1;
4441 : : }
4442 : 4 : res_op->ops[1] = build_real_truncate (type, dconst_sqrt2 ());
4443 : 4 : res_op->resimplify (lseq, valueize);
4444 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 875, __FILE__, __LINE__, true);
4445 : 4 : return true;
4446 : : }
4447 : : next_after_fail1272:;
4448 : : }
4449 : : }
4450 : : }
4451 : : break;
4452 : : }
4453 : : default:;
4454 : : }
4455 : : }
4456 : : break;
4457 : : default:;
4458 : : }
4459 : : return false;
4460 : : }
4461 : :
4462 : : bool
4463 : 60297 : gimple_simplify_PAREN_EXPR (gimple_match_op *res_op, gimple_seq *seq,
4464 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4465 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
4466 : : {
4467 : 60297 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4468 : 60297 : switch (TREE_CODE (_p0))
4469 : : {
4470 : 55598 : case SSA_NAME:
4471 : 55598 : if (gimple *_d1 = get_def (valueize, _p0))
4472 : : {
4473 : 42743 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
4474 : 40242 : switch (gimple_assign_rhs_code (_a1))
4475 : : {
4476 : 0 : case PAREN_EXPR:
4477 : 0 : {
4478 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
4479 : 0 : _q20 = do_valueize (valueize, _q20);
4480 : 0 : {
4481 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
4482 : 0 : gimple_seq *lseq = seq;
4483 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1328;
4484 : 0 : {
4485 : 0 : tree tem;
4486 : 0 : tem = captures[0];
4487 : 0 : res_op->set_value (tem);
4488 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 893, __FILE__, __LINE__, true);
4489 : 0 : return true;
4490 : : }
4491 : 0 : next_after_fail1328:;
4492 : : }
4493 : 0 : break;
4494 : : }
4495 : : default:;
4496 : : }
4497 : : }
4498 : : break;
4499 : 60297 : default:;
4500 : : }
4501 : 60297 : if (CONSTANT_CLASS_P (_p0))
4502 : : {
4503 : 4308 : {
4504 : 4308 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
4505 : 4308 : gimple_seq *lseq = seq;
4506 : 4308 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1329;
4507 : 4308 : {
4508 : 4308 : tree tem;
4509 : 4308 : tem = captures[0];
4510 : 4308 : res_op->set_value (tem);
4511 : 4308 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 894, __FILE__, __LINE__, true);
4512 : 4308 : return true;
4513 : : }
4514 : 0 : next_after_fail1329:;
4515 : : }
4516 : : }
4517 : : return false;
4518 : : }
4519 : :
4520 : : bool
4521 : 1821368 : gimple_simplify_IMAGPART_EXPR (gimple_match_op *res_op, gimple_seq *seq,
4522 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
4523 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
4524 : : {
4525 : 1821368 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
4526 : 1821368 : switch (TREE_CODE (_p0))
4527 : : {
4528 : 1402565 : case SSA_NAME:
4529 : 1402565 : if (gimple *_d1 = get_def (valueize, _p0))
4530 : : {
4531 : 1019497 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
4532 : 352929 : switch (gimple_assign_rhs_code (_a1))
4533 : : {
4534 : 6872 : case COMPLEX_EXPR:
4535 : 6872 : {
4536 : 6872 : tree _q20 = gimple_assign_rhs1 (_a1);
4537 : 6872 : _q20 = do_valueize (valueize, _q20);
4538 : 6872 : tree _q21 = gimple_assign_rhs2 (_a1);
4539 : 6872 : _q21 = do_valueize (valueize, _q21);
4540 : 6872 : {
4541 : 6872 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
4542 : 6872 : gimple_seq *lseq = seq;
4543 : 6872 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1343;
4544 : 6872 : {
4545 : 6872 : tree tem;
4546 : 6872 : tem = captures[1];
4547 : 6872 : res_op->set_value (tem);
4548 : 6872 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 899, __FILE__, __LINE__, true);
4549 : 6872 : return true;
4550 : : }
4551 : 0 : next_after_fail1343:;
4552 : : }
4553 : 0 : break;
4554 : : }
4555 : 0 : CASE_CONVERT:
4556 : 0 : {
4557 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
4558 : 0 : _q20 = do_valueize (valueize, _q20);
4559 : 0 : switch (TREE_CODE (_q20))
4560 : : {
4561 : 0 : case SSA_NAME:
4562 : 0 : if (gimple *_d2 = get_def (valueize, _q20))
4563 : : {
4564 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
4565 : 0 : switch (gimple_assign_rhs_code (_a2))
4566 : : {
4567 : 0 : case CONJ_EXPR:
4568 : 0 : {
4569 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
4570 : 0 : _q30 = do_valueize (valueize, _q30);
4571 : 0 : {
4572 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
4573 : 0 : gimple_seq *lseq = seq;
4574 : 0 : if (lseq
4575 : 0 : && (!single_use (captures[0])
4576 : 0 : || !single_use (captures[1])))
4577 : 0 : lseq = NULL;
4578 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1344;
4579 : 0 : {
4580 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4581 : 0 : {
4582 : 0 : tree _o1[1], _r1;
4583 : 0 : {
4584 : 0 : tree _o2[1], _r2;
4585 : 0 : _o2[0] = captures[2];
4586 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4587 : 0 : tem_op.resimplify (lseq, valueize);
4588 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4589 : 0 : if (!_r2) goto next_after_fail1344;
4590 : 0 : _o1[0] = _r2;
4591 : : }
4592 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NEGATE_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
4593 : 0 : tem_op.resimplify (lseq, valueize);
4594 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4595 : 0 : if (!_r1) goto next_after_fail1344;
4596 : 0 : res_op->ops[0] = _r1;
4597 : : }
4598 : 0 : res_op->resimplify (lseq, valueize);
4599 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 900, __FILE__, __LINE__, true);
4600 : 0 : return true;
4601 : : }
4602 : 0 : next_after_fail1344:;
4603 : : }
4604 : 0 : break;
4605 : : }
4606 : 0 : case PLUS_EXPR:
4607 : 0 : {
4608 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
4609 : 0 : _q30 = do_valueize (valueize, _q30);
4610 : 0 : tree _q31 = gimple_assign_rhs2 (_a2);
4611 : 0 : _q31 = do_valueize (valueize, _q31);
4612 : 0 : if (tree_swap_operands_p (_q30, _q31))
4613 : 0 : std::swap (_q30, _q31);
4614 : 0 : {
4615 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31 };
4616 : 0 : const enum tree_code op = PLUS_EXPR;
4617 : 0 : gimple_seq *lseq = seq;
4618 : 0 : if (lseq
4619 : 0 : && (!single_use (captures[0])
4620 : 0 : || !single_use (captures[1])))
4621 : 0 : lseq = NULL;
4622 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1345;
4623 : 0 : {
4624 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4625 : 0 : {
4626 : 0 : tree _o1[2], _r1;
4627 : 0 : {
4628 : 0 : tree _o2[1], _r2;
4629 : 0 : _o2[0] = captures[2];
4630 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4631 : 0 : tem_op.resimplify (lseq, valueize);
4632 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4633 : 0 : if (!_r2) goto next_after_fail1345;
4634 : 0 : _o1[0] = _r2;
4635 : : }
4636 : 0 : {
4637 : 0 : tree _o2[1], _r2;
4638 : 0 : _o2[0] = captures[3];
4639 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4640 : 0 : tem_op.resimplify (lseq, valueize);
4641 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4642 : 0 : if (!_r2) goto next_after_fail1345;
4643 : 0 : _o1[1] = _r2;
4644 : : }
4645 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
4646 : 0 : tem_op.resimplify (lseq, valueize);
4647 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4648 : 0 : if (!_r1) goto next_after_fail1345;
4649 : 0 : res_op->ops[0] = _r1;
4650 : : }
4651 : 0 : res_op->resimplify (lseq, valueize);
4652 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 897, __FILE__, __LINE__, true);
4653 : 0 : return true;
4654 : : }
4655 : 0 : next_after_fail1345:;
4656 : : }
4657 : 0 : break;
4658 : : }
4659 : 0 : case MINUS_EXPR:
4660 : 0 : {
4661 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
4662 : 0 : _q30 = do_valueize (valueize, _q30);
4663 : 0 : tree _q31 = gimple_assign_rhs2 (_a2);
4664 : 0 : _q31 = do_valueize (valueize, _q31);
4665 : 0 : {
4666 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31 };
4667 : 0 : const enum tree_code op = MINUS_EXPR;
4668 : 0 : gimple_seq *lseq = seq;
4669 : 0 : if (lseq
4670 : 0 : && (!single_use (captures[0])
4671 : 0 : || !single_use (captures[1])))
4672 : 0 : lseq = NULL;
4673 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1346;
4674 : 0 : {
4675 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4676 : 0 : {
4677 : 0 : tree _o1[2], _r1;
4678 : 0 : {
4679 : 0 : tree _o2[1], _r2;
4680 : 0 : _o2[0] = captures[2];
4681 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4682 : 0 : tem_op.resimplify (lseq, valueize);
4683 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4684 : 0 : if (!_r2) goto next_after_fail1346;
4685 : 0 : _o1[0] = _r2;
4686 : : }
4687 : 0 : {
4688 : 0 : tree _o2[1], _r2;
4689 : 0 : _o2[0] = captures[3];
4690 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4691 : 0 : tem_op.resimplify (lseq, valueize);
4692 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4693 : 0 : if (!_r2) goto next_after_fail1346;
4694 : 0 : _o1[1] = _r2;
4695 : : }
4696 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
4697 : 0 : tem_op.resimplify (lseq, valueize);
4698 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4699 : 0 : if (!_r1) goto next_after_fail1346;
4700 : 0 : res_op->ops[0] = _r1;
4701 : : }
4702 : 0 : res_op->resimplify (lseq, valueize);
4703 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 897, __FILE__, __LINE__, true);
4704 : 0 : return true;
4705 : : }
4706 : 0 : next_after_fail1346:;
4707 : : }
4708 : 0 : break;
4709 : : }
4710 : : default:;
4711 : : }
4712 : 0 : else if (gcall *_c2 = dyn_cast <gcall *> (_d2))
4713 : 0 : switch (gimple_call_combined_fn (_c2))
4714 : : {
4715 : 0 : case CFN_BUILT_IN_CEXPIF:
4716 : 0 : if (gimple_call_num_args (_c2) == 1)
4717 : : {
4718 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
4719 : 0 : _q30 = do_valueize (valueize, _q30);
4720 : 0 : {
4721 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
4722 : 0 : gimple_seq *lseq = seq;
4723 : 0 : if (lseq
4724 : 0 : && (!single_use (captures[0])
4725 : 0 : || !single_use (captures[1])))
4726 : 0 : lseq = NULL;
4727 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1347;
4728 : 0 : {
4729 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4730 : 0 : {
4731 : 0 : tree _o1[1], _r1;
4732 : 0 : _o1[0] = captures[2];
4733 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_BUILT_IN_SINF, TREE_TYPE (_o1[0]), _o1[0]);
4734 : 0 : tem_op.resimplify (lseq, valueize);
4735 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4736 : 0 : if (!_r1) goto next_after_fail1347;
4737 : 0 : res_op->ops[0] = _r1;
4738 : : }
4739 : 0 : res_op->resimplify (lseq, valueize);
4740 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 901, __FILE__, __LINE__, true);
4741 : 0 : return true;
4742 : : }
4743 : 0 : next_after_fail1347:;
4744 : : }
4745 : : }
4746 : : break;
4747 : 0 : case CFN_BUILT_IN_CEXPIL:
4748 : 0 : if (gimple_call_num_args (_c2) == 1)
4749 : : {
4750 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
4751 : 0 : _q30 = do_valueize (valueize, _q30);
4752 : 0 : {
4753 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
4754 : 0 : gimple_seq *lseq = seq;
4755 : 0 : if (lseq
4756 : 0 : && (!single_use (captures[0])
4757 : 0 : || !single_use (captures[1])))
4758 : 0 : lseq = NULL;
4759 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1348;
4760 : 0 : {
4761 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4762 : 0 : {
4763 : 0 : tree _o1[1], _r1;
4764 : 0 : _o1[0] = captures[2];
4765 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_BUILT_IN_SINL, TREE_TYPE (_o1[0]), _o1[0]);
4766 : 0 : tem_op.resimplify (lseq, valueize);
4767 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4768 : 0 : if (!_r1) goto next_after_fail1348;
4769 : 0 : res_op->ops[0] = _r1;
4770 : : }
4771 : 0 : res_op->resimplify (lseq, valueize);
4772 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 901, __FILE__, __LINE__, true);
4773 : 0 : return true;
4774 : : }
4775 : 0 : next_after_fail1348:;
4776 : : }
4777 : : }
4778 : : break;
4779 : 0 : case CFN_BUILT_IN_CEXPI:
4780 : 0 : if (gimple_call_num_args (_c2) == 1)
4781 : : {
4782 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
4783 : 0 : _q30 = do_valueize (valueize, _q30);
4784 : 0 : {
4785 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
4786 : 0 : gimple_seq *lseq = seq;
4787 : 0 : if (lseq
4788 : 0 : && (!single_use (captures[0])
4789 : 0 : || !single_use (captures[1])))
4790 : 0 : lseq = NULL;
4791 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1349;
4792 : 0 : {
4793 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4794 : 0 : {
4795 : 0 : tree _o1[1], _r1;
4796 : 0 : _o1[0] = captures[2];
4797 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_BUILT_IN_SIN, TREE_TYPE (_o1[0]), _o1[0]);
4798 : 0 : tem_op.resimplify (lseq, valueize);
4799 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4800 : 0 : if (!_r1) goto next_after_fail1349;
4801 : 0 : res_op->ops[0] = _r1;
4802 : : }
4803 : 0 : res_op->resimplify (lseq, valueize);
4804 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 901, __FILE__, __LINE__, true);
4805 : 0 : return true;
4806 : : }
4807 : 0 : next_after_fail1349:;
4808 : : }
4809 : : }
4810 : : break;
4811 : : default:;
4812 : : }
4813 : : }
4814 : : break;
4815 : : default:;
4816 : : }
4817 : : break;
4818 : : }
4819 : 0 : case CONJ_EXPR:
4820 : 0 : {
4821 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
4822 : 0 : _q20 = do_valueize (valueize, _q20);
4823 : 0 : {
4824 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
4825 : 0 : gimple_seq *lseq = seq;
4826 : 0 : if (lseq
4827 : 0 : && (!single_use (captures[0])
4828 : : || !single_use (captures[1])))
4829 : : lseq = NULL;
4830 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1350;
4831 : 0 : {
4832 : 0 : res_op->set_op (NOP_EXPR, type, 1);
4833 : 0 : {
4834 : 0 : tree _o1[1], _r1;
4835 : 0 : {
4836 : 0 : tree _o2[1], _r2;
4837 : 0 : _o2[0] = captures[2];
4838 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4839 : 0 : tem_op.resimplify (lseq, valueize);
4840 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4841 : 0 : if (!_r2) goto next_after_fail1350;
4842 : 0 : _o1[0] = _r2;
4843 : : }
4844 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NEGATE_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
4845 : 0 : tem_op.resimplify (lseq, valueize);
4846 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4847 : 0 : if (!_r1) goto next_after_fail1350;
4848 : 0 : res_op->ops[0] = _r1;
4849 : : }
4850 : 0 : res_op->resimplify (lseq, valueize);
4851 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 900, __FILE__, __LINE__, true);
4852 : 0 : return true;
4853 : : }
4854 : 0 : next_after_fail1350:;
4855 : : }
4856 : 0 : break;
4857 : : }
4858 : 1078 : case PLUS_EXPR:
4859 : 1078 : {
4860 : 1078 : tree _q20 = gimple_assign_rhs1 (_a1);
4861 : 1078 : _q20 = do_valueize (valueize, _q20);
4862 : 1078 : tree _q21 = gimple_assign_rhs2 (_a1);
4863 : 1078 : _q21 = do_valueize (valueize, _q21);
4864 : 1078 : if (tree_swap_operands_p (_q20, _q21))
4865 : 63 : std::swap (_q20, _q21);
4866 : 1078 : {
4867 : 1078 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21 };
4868 : 1078 : const enum tree_code op = PLUS_EXPR;
4869 : 1078 : gimple_seq *lseq = seq;
4870 : 1078 : if (lseq
4871 : 278 : && (!single_use (captures[0])
4872 : : || !single_use (captures[1])))
4873 : : lseq = NULL;
4874 : 1078 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1351;
4875 : 1078 : {
4876 : 1078 : res_op->set_op (NOP_EXPR, type, 1);
4877 : 1078 : {
4878 : 1078 : tree _o1[2], _r1;
4879 : 1078 : {
4880 : 1078 : tree _o2[1], _r2;
4881 : 1078 : _o2[0] = captures[2];
4882 : 1078 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4883 : 1078 : tem_op.resimplify (lseq, valueize);
4884 : 1078 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4885 : 1078 : if (!_r2) goto next_after_fail1351;
4886 : 848 : _o1[0] = _r2;
4887 : : }
4888 : 848 : {
4889 : 848 : tree _o2[1], _r2;
4890 : 848 : _o2[0] = captures[3];
4891 : 848 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4892 : 848 : tem_op.resimplify (lseq, valueize);
4893 : 848 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4894 : 848 : if (!_r2) goto next_after_fail1351;
4895 : 440 : _o1[1] = _r2;
4896 : : }
4897 : 440 : gimple_match_op tem_op (res_op->cond.any_else (), op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
4898 : 440 : tem_op.resimplify (lseq, valueize);
4899 : 440 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4900 : 440 : if (!_r1) goto next_after_fail1351;
4901 : 26 : res_op->ops[0] = _r1;
4902 : : }
4903 : 26 : res_op->resimplify (lseq, valueize);
4904 : 26 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 897, __FILE__, __LINE__, true);
4905 : 26 : return true;
4906 : : }
4907 : 1052 : next_after_fail1351:;
4908 : : }
4909 : 1052 : break;
4910 : : }
4911 : 817 : case MINUS_EXPR:
4912 : 817 : {
4913 : 817 : tree _q20 = gimple_assign_rhs1 (_a1);
4914 : 817 : _q20 = do_valueize (valueize, _q20);
4915 : 817 : tree _q21 = gimple_assign_rhs2 (_a1);
4916 : 817 : _q21 = do_valueize (valueize, _q21);
4917 : 817 : {
4918 : 817 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21 };
4919 : 817 : const enum tree_code op = MINUS_EXPR;
4920 : 817 : gimple_seq *lseq = seq;
4921 : 817 : if (lseq
4922 : 236 : && (!single_use (captures[0])
4923 : : || !single_use (captures[1])))
4924 : : lseq = NULL;
4925 : 817 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1352;
4926 : 817 : {
4927 : 817 : res_op->set_op (NOP_EXPR, type, 1);
4928 : 817 : {
4929 : 817 : tree _o1[2], _r1;
4930 : 817 : {
4931 : 817 : tree _o2[1], _r2;
4932 : 817 : _o2[0] = captures[2];
4933 : 817 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4934 : 817 : tem_op.resimplify (lseq, valueize);
4935 : 817 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4936 : 817 : if (!_r2) goto next_after_fail1352;
4937 : 487 : _o1[0] = _r2;
4938 : : }
4939 : 487 : {
4940 : 487 : tree _o2[1], _r2;
4941 : 487 : _o2[0] = captures[3];
4942 : 487 : gimple_match_op tem_op (res_op->cond.any_else (), IMAGPART_EXPR, TREE_TYPE (TREE_TYPE (_o2[0])), _o2[0]);
4943 : 487 : tem_op.resimplify (lseq, valueize);
4944 : 487 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
4945 : 487 : if (!_r2) goto next_after_fail1352;
4946 : 427 : _o1[1] = _r2;
4947 : : }
4948 : 427 : gimple_match_op tem_op (res_op->cond.any_else (), op, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
4949 : 427 : tem_op.resimplify (lseq, valueize);
4950 : 427 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
4951 : 427 : if (!_r1) goto next_after_fail1352;
4952 : 3 : res_op->ops[0] = _r1;
4953 : : }
4954 : 3 : res_op->resimplify (lseq, valueize);
4955 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 897, __FILE__, __LINE__, true);
4956 : 3 : return true;
4957 : : }
4958 : 814 : next_after_fail1352:;
4959 : : }
4960 : 814 : break;
4961 : : }
4962 : : default:;
4963 : : }
4964 : 836798 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
4965 : 814383 : switch (gimple_call_combined_fn (_c1))
4966 : : {
4967 : 210762 : case CFN_MUL_OVERFLOW:
4968 : 210762 : if (gimple_call_num_args (_c1) == 2)
4969 : : {
4970 : 210762 : tree _q20 = gimple_call_arg (_c1, 0);
4971 : 210762 : _q20 = do_valueize (valueize, _q20);
4972 : 210762 : tree _q21 = gimple_call_arg (_c1, 1);
4973 : 210762 : _q21 = do_valueize (valueize, _q21);
4974 : 210762 : if (integer_nonzerop (_q21))
4975 : : {
4976 : 143232 : {
4977 : 143232 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
4978 : 143232 : if (gimple_simplify_569 (res_op, seq, valueize, type, captures))
4979 : 2325 : return true;
4980 : : }
4981 : : }
4982 : 208437 : if (integer_nonzerop (_q20))
4983 : : {
4984 : 3382 : {
4985 : 3382 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q21, _q20 };
4986 : 3382 : if (gimple_simplify_569 (res_op, seq, valueize, type, captures))
4987 : 91 : return true;
4988 : : }
4989 : : }
4990 : : }
4991 : : break;
4992 : 153 : case CFN_BUILT_IN_CEXPIF:
4993 : 153 : if (gimple_call_num_args (_c1) == 1)
4994 : : {
4995 : 153 : tree _q20 = gimple_call_arg (_c1, 0);
4996 : 153 : _q20 = do_valueize (valueize, _q20);
4997 : 153 : {
4998 : 153 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
4999 : 153 : gimple_seq *lseq = seq;
5000 : 153 : if (lseq
5001 : 54 : && (!single_use (captures[0])
5002 : : || !single_use (captures[1])))
5003 : : lseq = NULL;
5004 : 153 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1353;
5005 : 153 : {
5006 : 153 : res_op->set_op (NOP_EXPR, type, 1);
5007 : 153 : {
5008 : 153 : tree _o1[1], _r1;
5009 : 153 : _o1[0] = captures[2];
5010 : 153 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_BUILT_IN_SINF, TREE_TYPE (_o1[0]), _o1[0]);
5011 : 153 : tem_op.resimplify (lseq, valueize);
5012 : 153 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5013 : 153 : if (!_r1) goto next_after_fail1353;
5014 : 0 : res_op->ops[0] = _r1;
5015 : : }
5016 : 0 : res_op->resimplify (lseq, valueize);
5017 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 901, __FILE__, __LINE__, true);
5018 : 0 : return true;
5019 : : }
5020 : 153 : next_after_fail1353:;
5021 : : }
5022 : : }
5023 : : break;
5024 : 56 : case CFN_BUILT_IN_CEXPIL:
5025 : 56 : if (gimple_call_num_args (_c1) == 1)
5026 : : {
5027 : 56 : tree _q20 = gimple_call_arg (_c1, 0);
5028 : 56 : _q20 = do_valueize (valueize, _q20);
5029 : 56 : {
5030 : 56 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
5031 : 56 : gimple_seq *lseq = seq;
5032 : 56 : if (lseq
5033 : 19 : && (!single_use (captures[0])
5034 : : || !single_use (captures[1])))
5035 : : lseq = NULL;
5036 : 56 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1354;
5037 : 56 : {
5038 : 56 : res_op->set_op (NOP_EXPR, type, 1);
5039 : 56 : {
5040 : 56 : tree _o1[1], _r1;
5041 : 56 : _o1[0] = captures[2];
5042 : 56 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_BUILT_IN_SINL, TREE_TYPE (_o1[0]), _o1[0]);
5043 : 56 : tem_op.resimplify (lseq, valueize);
5044 : 56 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5045 : 56 : if (!_r1) goto next_after_fail1354;
5046 : 0 : res_op->ops[0] = _r1;
5047 : : }
5048 : 0 : res_op->resimplify (lseq, valueize);
5049 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 901, __FILE__, __LINE__, true);
5050 : 0 : return true;
5051 : : }
5052 : 56 : next_after_fail1354:;
5053 : : }
5054 : : }
5055 : : break;
5056 : 305 : case CFN_BUILT_IN_CEXPI:
5057 : 305 : if (gimple_call_num_args (_c1) == 1)
5058 : : {
5059 : 305 : tree _q20 = gimple_call_arg (_c1, 0);
5060 : 305 : _q20 = do_valueize (valueize, _q20);
5061 : 305 : {
5062 : 305 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
5063 : 305 : gimple_seq *lseq = seq;
5064 : 305 : if (lseq
5065 : 109 : && (!single_use (captures[0])
5066 : : || !single_use (captures[1])))
5067 : : lseq = NULL;
5068 : 305 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1355;
5069 : 305 : {
5070 : 305 : res_op->set_op (NOP_EXPR, type, 1);
5071 : 305 : {
5072 : 305 : tree _o1[1], _r1;
5073 : 305 : _o1[0] = captures[2];
5074 : 305 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_BUILT_IN_SIN, TREE_TYPE (_o1[0]), _o1[0]);
5075 : 305 : tem_op.resimplify (lseq, valueize);
5076 : 305 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5077 : 305 : if (!_r1) goto next_after_fail1355;
5078 : 4 : res_op->ops[0] = _r1;
5079 : : }
5080 : 4 : res_op->resimplify (lseq, valueize);
5081 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 901, __FILE__, __LINE__, true);
5082 : 4 : return true;
5083 : : }
5084 : 301 : next_after_fail1355:;
5085 : : }
5086 : : }
5087 : : break;
5088 : : default:;
5089 : : }
5090 : : }
5091 : : break;
5092 : : default:;
5093 : : }
5094 : : return false;
5095 : : }
5096 : :
5097 : : bool
5098 : 0 : gimple_simplify_CFN_LOG2 (gimple_match_op *res_op, gimple_seq *seq,
5099 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5100 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5101 : : {
5102 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5103 : 0 : switch (TREE_CODE (_p0))
5104 : : {
5105 : 0 : case SSA_NAME:
5106 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
5107 : : {
5108 : 0 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5109 : 0 : switch (gimple_call_combined_fn (_c1))
5110 : : {
5111 : 0 : case CFN_EXP:
5112 : 0 : if (gimple_call_num_args (_c1) == 1)
5113 : : {
5114 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5115 : 0 : _q20 = do_valueize (valueize, _q20);
5116 : 0 : {
5117 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5118 : 0 : if (flag_unsafe_math_optimizations
5119 : : )
5120 : : {
5121 : 0 : if (SCALAR_FLOAT_TYPE_P (type)
5122 : : )
5123 : : {
5124 : 0 : {
5125 : 0 : tree x;
5126 : 0 : switch (CFN_EXP)
5127 : : {
5128 : 0 : CASE_CFN_EXP:
5129 : 0 : x = build_real_truncate (type, dconst_e ());
5130 : 0 : break;
5131 : : CASE_CFN_EXP2:
5132 : : x = build_real (type, dconst2);
5133 : : break;
5134 : : CASE_CFN_EXP10:
5135 : : CASE_CFN_POW10:
5136 : : {
5137 : : REAL_VALUE_TYPE dconst10;
5138 : : real_from_integer (&dconst10, VOIDmode, 10, SIGNED);
5139 : : x = build_real (type, dconst10);
5140 : : }
5141 : : break;
5142 : : default:
5143 : : gcc_unreachable ();
5144 : : }
5145 : 0 : gimple_seq *lseq = seq;
5146 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1398;
5147 : 0 : {
5148 : 0 : res_op->set_op (MULT_EXPR, type, 2);
5149 : 0 : {
5150 : 0 : tree _o1[1], _r1;
5151 : 0 : _o1[0] = x;
5152 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_LOG2, TREE_TYPE (_o1[0]), _o1[0]);
5153 : 0 : tem_op.resimplify (lseq, valueize);
5154 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5155 : 0 : if (!_r1) goto next_after_fail1398;
5156 : 0 : res_op->ops[0] = _r1;
5157 : : }
5158 : 0 : res_op->ops[1] = captures[0];
5159 : 0 : res_op->resimplify (lseq, valueize);
5160 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 904, __FILE__, __LINE__, true);
5161 : 0 : return true;
5162 : : }
5163 : : next_after_fail1398:;
5164 : : }
5165 : : }
5166 : : }
5167 : : }
5168 : : }
5169 : : break;
5170 : 0 : case CFN_POW:
5171 : 0 : if (gimple_call_num_args (_c1) == 2)
5172 : : {
5173 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5174 : 0 : _q20 = do_valueize (valueize, _q20);
5175 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
5176 : 0 : _q21 = do_valueize (valueize, _q21);
5177 : 0 : {
5178 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
5179 : 0 : if (gimple_simplify_599 (res_op, seq, valueize, type, captures, CFN_LOG2, CFN_POW))
5180 : 0 : return true;
5181 : : }
5182 : : }
5183 : : break;
5184 : 0 : case CFN_EXP2:
5185 : 0 : if (gimple_call_num_args (_c1) == 1)
5186 : : {
5187 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5188 : 0 : _q20 = do_valueize (valueize, _q20);
5189 : 0 : {
5190 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5191 : 0 : if (flag_unsafe_math_optimizations
5192 : : )
5193 : : {
5194 : 0 : gimple_seq *lseq = seq;
5195 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1399;
5196 : 0 : {
5197 : 0 : tree tem;
5198 : 0 : tem = captures[0];
5199 : 0 : res_op->set_value (tem);
5200 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 905, __FILE__, __LINE__, true);
5201 : 0 : return true;
5202 : : }
5203 : 0 : next_after_fail1399:;
5204 : : }
5205 : : }
5206 : : }
5207 : : break;
5208 : 0 : case CFN_SQRT:
5209 : 0 : if (gimple_call_num_args (_c1) == 1)
5210 : : {
5211 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5212 : 0 : _q20 = do_valueize (valueize, _q20);
5213 : 0 : {
5214 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5215 : 0 : if (flag_unsafe_math_optimizations
5216 : : )
5217 : : {
5218 : 0 : if (SCALAR_FLOAT_TYPE_P (type)
5219 : : )
5220 : : {
5221 : 0 : {
5222 : 0 : tree x;
5223 : 0 : switch (CFN_SQRT)
5224 : : {
5225 : 0 : CASE_CFN_SQRT:
5226 : 0 : x = build_real (type, dconsthalf);
5227 : 0 : break;
5228 : : CASE_CFN_CBRT:
5229 : : x = build_real_truncate (type, dconst_third ());
5230 : : break;
5231 : : default:
5232 : : gcc_unreachable ();
5233 : : }
5234 : 0 : gimple_seq *lseq = seq;
5235 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1400;
5236 : 0 : {
5237 : 0 : res_op->set_op (MULT_EXPR, type, 2);
5238 : 0 : res_op->ops[0] = x;
5239 : 0 : {
5240 : 0 : tree _o1[1], _r1;
5241 : 0 : _o1[0] = captures[0];
5242 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_LOG2, TREE_TYPE (_o1[0]), _o1[0]);
5243 : 0 : tem_op.resimplify (lseq, valueize);
5244 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5245 : 0 : if (!_r1) goto next_after_fail1400;
5246 : 0 : res_op->ops[1] = _r1;
5247 : : }
5248 : 0 : res_op->resimplify (lseq, valueize);
5249 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 903, __FILE__, __LINE__, true);
5250 : 0 : return true;
5251 : : }
5252 : : next_after_fail1400:;
5253 : : }
5254 : : }
5255 : : }
5256 : : }
5257 : : }
5258 : : break;
5259 : 0 : case CFN_EXP10:
5260 : 0 : if (gimple_call_num_args (_c1) == 1)
5261 : : {
5262 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5263 : 0 : _q20 = do_valueize (valueize, _q20);
5264 : 0 : {
5265 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5266 : 0 : if (flag_unsafe_math_optimizations
5267 : : )
5268 : : {
5269 : 0 : if (SCALAR_FLOAT_TYPE_P (type)
5270 : : )
5271 : : {
5272 : 0 : {
5273 : 0 : tree x;
5274 : 0 : switch (CFN_EXP10)
5275 : : {
5276 : : CASE_CFN_EXP:
5277 : : x = build_real_truncate (type, dconst_e ());
5278 : : break;
5279 : : CASE_CFN_EXP2:
5280 : : x = build_real (type, dconst2);
5281 : : break;
5282 : 0 : CASE_CFN_EXP10:
5283 : 0 : CASE_CFN_POW10:
5284 : 0 : {
5285 : 0 : REAL_VALUE_TYPE dconst10;
5286 : 0 : real_from_integer (&dconst10, VOIDmode, 10, SIGNED);
5287 : 0 : x = build_real (type, dconst10);
5288 : : }
5289 : 0 : break;
5290 : : default:
5291 : : gcc_unreachable ();
5292 : : }
5293 : 0 : gimple_seq *lseq = seq;
5294 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1401;
5295 : 0 : {
5296 : 0 : res_op->set_op (MULT_EXPR, type, 2);
5297 : 0 : {
5298 : 0 : tree _o1[1], _r1;
5299 : 0 : _o1[0] = x;
5300 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_LOG2, TREE_TYPE (_o1[0]), _o1[0]);
5301 : 0 : tem_op.resimplify (lseq, valueize);
5302 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5303 : 0 : if (!_r1) goto next_after_fail1401;
5304 : 0 : res_op->ops[0] = _r1;
5305 : : }
5306 : 0 : res_op->ops[1] = captures[0];
5307 : 0 : res_op->resimplify (lseq, valueize);
5308 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 904, __FILE__, __LINE__, true);
5309 : 0 : return true;
5310 : : }
5311 : : next_after_fail1401:;
5312 : : }
5313 : : }
5314 : : }
5315 : : }
5316 : : }
5317 : : break;
5318 : : default:;
5319 : : }
5320 : : }
5321 : : break;
5322 : : default:;
5323 : : }
5324 : : return false;
5325 : : }
5326 : :
5327 : : bool
5328 : 6126 : gimple_simplify_CFN_BUILT_IN_EXPF (gimple_match_op *res_op, gimple_seq *seq,
5329 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5330 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5331 : : {
5332 : 6126 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5333 : 6126 : switch (TREE_CODE (_p0))
5334 : : {
5335 : 5947 : case SSA_NAME:
5336 : 5947 : if (gimple *_d1 = get_def (valueize, _p0))
5337 : : {
5338 : 3184 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5339 : 131 : switch (gimple_call_combined_fn (_c1))
5340 : : {
5341 : 7 : case CFN_BUILT_IN_LOGF:
5342 : 7 : if (gimple_call_num_args (_c1) == 1)
5343 : : {
5344 : 7 : tree _q20 = gimple_call_arg (_c1, 0);
5345 : 7 : _q20 = do_valueize (valueize, _q20);
5346 : 7 : {
5347 : 7 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5348 : 7 : if (flag_unsafe_math_optimizations
5349 : : )
5350 : : {
5351 : 7 : gimple_seq *lseq = seq;
5352 : 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1424;
5353 : 7 : {
5354 : 7 : tree tem;
5355 : 7 : tem = captures[0];
5356 : 7 : res_op->set_value (tem);
5357 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 906, __FILE__, __LINE__, true);
5358 : 7 : return true;
5359 : : }
5360 : 0 : next_after_fail1424:;
5361 : : }
5362 : : }
5363 : : }
5364 : : break;
5365 : : default:;
5366 : : }
5367 : : }
5368 : : break;
5369 : : default:;
5370 : : }
5371 : : return false;
5372 : : }
5373 : :
5374 : : bool
5375 : 5759 : gimple_simplify_CFN_BUILT_IN_EXPL (gimple_match_op *res_op, gimple_seq *seq,
5376 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5377 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5378 : : {
5379 : 5759 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5380 : 5759 : switch (TREE_CODE (_p0))
5381 : : {
5382 : 5601 : case SSA_NAME:
5383 : 5601 : if (gimple *_d1 = get_def (valueize, _p0))
5384 : : {
5385 : 3062 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5386 : 87 : switch (gimple_call_combined_fn (_c1))
5387 : : {
5388 : 7 : case CFN_BUILT_IN_LOGL:
5389 : 7 : if (gimple_call_num_args (_c1) == 1)
5390 : : {
5391 : 7 : tree _q20 = gimple_call_arg (_c1, 0);
5392 : 7 : _q20 = do_valueize (valueize, _q20);
5393 : 7 : {
5394 : 7 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5395 : 7 : if (flag_unsafe_math_optimizations
5396 : : )
5397 : : {
5398 : 7 : gimple_seq *lseq = seq;
5399 : 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1426;
5400 : 7 : {
5401 : 7 : tree tem;
5402 : 7 : tem = captures[0];
5403 : 7 : res_op->set_value (tem);
5404 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 906, __FILE__, __LINE__, true);
5405 : 7 : return true;
5406 : : }
5407 : 0 : next_after_fail1426:;
5408 : : }
5409 : : }
5410 : : }
5411 : : break;
5412 : : default:;
5413 : : }
5414 : : }
5415 : : break;
5416 : : default:;
5417 : : }
5418 : : return false;
5419 : : }
5420 : :
5421 : : bool
5422 : 1520 : gimple_simplify_CFN_BUILT_IN_EXP2 (gimple_match_op *res_op, gimple_seq *seq,
5423 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5424 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5425 : : {
5426 : 1520 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5427 : 1520 : switch (TREE_CODE (_p0))
5428 : : {
5429 : 530 : case SSA_NAME:
5430 : 530 : if (gimple *_d1 = get_def (valueize, _p0))
5431 : : {
5432 : 330 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5433 : 27 : switch (gimple_call_combined_fn (_c1))
5434 : : {
5435 : 6 : case CFN_BUILT_IN_LOG2:
5436 : 6 : if (gimple_call_num_args (_c1) == 1)
5437 : : {
5438 : 6 : tree _q20 = gimple_call_arg (_c1, 0);
5439 : 6 : _q20 = do_valueize (valueize, _q20);
5440 : 6 : {
5441 : 6 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5442 : 6 : if (flag_unsafe_math_optimizations
5443 : : )
5444 : : {
5445 : 6 : gimple_seq *lseq = seq;
5446 : 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1429;
5447 : 6 : {
5448 : 6 : tree tem;
5449 : 6 : tem = captures[0];
5450 : 6 : res_op->set_value (tem);
5451 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 906, __FILE__, __LINE__, true);
5452 : 6 : return true;
5453 : : }
5454 : 0 : next_after_fail1429:;
5455 : : }
5456 : : }
5457 : : }
5458 : : break;
5459 : : default:;
5460 : : }
5461 : : }
5462 : : break;
5463 : : default:;
5464 : : }
5465 : : return false;
5466 : : }
5467 : :
5468 : : bool
5469 : 532 : gimple_simplify_CFN_BUILT_IN_POW10F (gimple_match_op *res_op, gimple_seq *seq,
5470 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5471 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5472 : : {
5473 : 532 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5474 : 532 : switch (TREE_CODE (_p0))
5475 : : {
5476 : 452 : case SSA_NAME:
5477 : 452 : if (gimple *_d1 = get_def (valueize, _p0))
5478 : : {
5479 : 316 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5480 : 6 : switch (gimple_call_combined_fn (_c1))
5481 : : {
5482 : 6 : case CFN_BUILT_IN_LOG10F:
5483 : 6 : if (gimple_call_num_args (_c1) == 1)
5484 : : {
5485 : 6 : tree _q20 = gimple_call_arg (_c1, 0);
5486 : 6 : _q20 = do_valueize (valueize, _q20);
5487 : 6 : {
5488 : 6 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5489 : 6 : if (flag_unsafe_math_optimizations
5490 : : )
5491 : : {
5492 : 6 : gimple_seq *lseq = seq;
5493 : 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1436;
5494 : 6 : {
5495 : 6 : tree tem;
5496 : 6 : tem = captures[0];
5497 : 6 : res_op->set_value (tem);
5498 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 906, __FILE__, __LINE__, true);
5499 : 6 : return true;
5500 : : }
5501 : 0 : next_after_fail1436:;
5502 : : }
5503 : : }
5504 : : }
5505 : : break;
5506 : : default:;
5507 : : }
5508 : : }
5509 : : break;
5510 : : default:;
5511 : : }
5512 : : return false;
5513 : : }
5514 : :
5515 : : bool
5516 : 381 : gimple_simplify_CFN_BUILT_IN_CBRT (gimple_match_op *res_op, gimple_seq *seq,
5517 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5518 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5519 : : {
5520 : 381 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5521 : 381 : switch (TREE_CODE (_p0))
5522 : : {
5523 : 350 : case SSA_NAME:
5524 : 350 : if (gimple *_d1 = get_def (valueize, _p0))
5525 : : {
5526 : 241 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5527 : 84 : switch (gimple_call_combined_fn (_c1))
5528 : : {
5529 : 12 : case CFN_BUILT_IN_EXP:
5530 : 12 : if (gimple_call_num_args (_c1) == 1)
5531 : : {
5532 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5533 : 12 : _q20 = do_valueize (valueize, _q20);
5534 : 12 : {
5535 : 12 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5536 : 12 : if (flag_unsafe_math_optimizations
5537 : : )
5538 : : {
5539 : 12 : gimple_seq *lseq = seq;
5540 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1472;
5541 : 12 : {
5542 : 12 : res_op->set_op (CFN_BUILT_IN_EXP, type, 1);
5543 : 12 : {
5544 : 12 : tree _o1[2], _r1;
5545 : 12 : _o1[0] = captures[0];
5546 : 12 : _o1[1] = build_real_truncate (type, dconst_third ());
5547 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
5548 : 12 : tem_op.resimplify (lseq, valueize);
5549 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5550 : 12 : if (!_r1) goto next_after_fail1472;
5551 : 6 : res_op->ops[0] = _r1;
5552 : : }
5553 : 6 : res_op->resimplify (lseq, valueize);
5554 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 912, __FILE__, __LINE__, true);
5555 : 6 : return true;
5556 : : }
5557 : : next_after_fail1472:;
5558 : : }
5559 : : }
5560 : : }
5561 : : break;
5562 : 12 : case CFN_BUILT_IN_POW:
5563 : 12 : if (gimple_call_num_args (_c1) == 2)
5564 : : {
5565 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5566 : 12 : _q20 = do_valueize (valueize, _q20);
5567 : 12 : tree _q21 = gimple_call_arg (_c1, 1);
5568 : 12 : _q21 = do_valueize (valueize, _q21);
5569 : 12 : if (tree_expr_nonnegative_p (_q20))
5570 : : {
5571 : 12 : {
5572 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
5573 : 12 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
5574 : : )
5575 : : {
5576 : 12 : gimple_seq *lseq = seq;
5577 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1473;
5578 : 12 : {
5579 : 12 : res_op->set_op (CFN_BUILT_IN_POW, type, 2);
5580 : 12 : res_op->ops[0] = captures[0];
5581 : 12 : {
5582 : 12 : tree _o1[2], _r1;
5583 : 12 : _o1[0] = captures[1];
5584 : 12 : _o1[1] = build_real_truncate (type, dconst_third ());
5585 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
5586 : 12 : tem_op.resimplify (lseq, valueize);
5587 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5588 : 12 : if (!_r1) goto next_after_fail1473;
5589 : 6 : res_op->ops[1] = _r1;
5590 : : }
5591 : 6 : res_op->resimplify (lseq, valueize);
5592 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 913, __FILE__, __LINE__, true);
5593 : 6 : return true;
5594 : : }
5595 : 6 : next_after_fail1473:;
5596 : : }
5597 : : }
5598 : : }
5599 : : }
5600 : : break;
5601 : 12 : case CFN_BUILT_IN_CBRT:
5602 : 12 : if (gimple_call_num_args (_c1) == 1)
5603 : : {
5604 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5605 : 12 : _q20 = do_valueize (valueize, _q20);
5606 : 12 : if (tree_expr_nonnegative_p (_q20))
5607 : : {
5608 : 12 : {
5609 : 12 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5610 : 12 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
5611 : : )
5612 : : {
5613 : 12 : gimple_seq *lseq = seq;
5614 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1474;
5615 : 12 : {
5616 : 12 : res_op->set_op (CFN_BUILT_IN_POW, type, 2);
5617 : 12 : res_op->ops[0] = captures[0];
5618 : 12 : res_op->ops[1] = build_real_truncate (type, dconst_ninth ());
5619 : 12 : res_op->resimplify (lseq, valueize);
5620 : 12 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 914, __FILE__, __LINE__, true);
5621 : 12 : return true;
5622 : : }
5623 : 0 : next_after_fail1474:;
5624 : : }
5625 : : }
5626 : : }
5627 : : }
5628 : : break;
5629 : 12 : case CFN_BUILT_IN_EXP2:
5630 : 12 : if (gimple_call_num_args (_c1) == 1)
5631 : : {
5632 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5633 : 12 : _q20 = do_valueize (valueize, _q20);
5634 : 12 : {
5635 : 12 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5636 : 12 : if (flag_unsafe_math_optimizations
5637 : : )
5638 : : {
5639 : 12 : gimple_seq *lseq = seq;
5640 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1475;
5641 : 12 : {
5642 : 12 : res_op->set_op (CFN_BUILT_IN_EXP2, type, 1);
5643 : 12 : {
5644 : 12 : tree _o1[2], _r1;
5645 : 12 : _o1[0] = captures[0];
5646 : 12 : _o1[1] = build_real_truncate (type, dconst_third ());
5647 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
5648 : 12 : tem_op.resimplify (lseq, valueize);
5649 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5650 : 12 : if (!_r1) goto next_after_fail1475;
5651 : 6 : res_op->ops[0] = _r1;
5652 : : }
5653 : 6 : res_op->resimplify (lseq, valueize);
5654 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 912, __FILE__, __LINE__, true);
5655 : 6 : return true;
5656 : : }
5657 : : next_after_fail1475:;
5658 : : }
5659 : : }
5660 : : }
5661 : : break;
5662 : 12 : case CFN_BUILT_IN_SQRT:
5663 : 12 : if (gimple_call_num_args (_c1) == 1)
5664 : : {
5665 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5666 : 12 : _q20 = do_valueize (valueize, _q20);
5667 : 12 : {
5668 : 12 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5669 : 12 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
5670 : : )
5671 : : {
5672 : 12 : gimple_seq *lseq = seq;
5673 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1476;
5674 : 12 : {
5675 : 12 : res_op->set_op (CFN_BUILT_IN_POW, type, 2);
5676 : 12 : res_op->ops[0] = captures[0];
5677 : 12 : res_op->ops[1] = build_real_truncate (type, dconst_sixth ());
5678 : 12 : res_op->resimplify (lseq, valueize);
5679 : 12 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 911, __FILE__, __LINE__, true);
5680 : 12 : return true;
5681 : : }
5682 : 0 : next_after_fail1476:;
5683 : : }
5684 : : }
5685 : : }
5686 : : break;
5687 : 12 : case CFN_BUILT_IN_EXP10:
5688 : 12 : if (gimple_call_num_args (_c1) == 1)
5689 : : {
5690 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5691 : 12 : _q20 = do_valueize (valueize, _q20);
5692 : 12 : {
5693 : 12 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5694 : 12 : if (flag_unsafe_math_optimizations
5695 : : )
5696 : : {
5697 : 12 : gimple_seq *lseq = seq;
5698 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1477;
5699 : 12 : {
5700 : 12 : res_op->set_op (CFN_BUILT_IN_EXP10, type, 1);
5701 : 12 : {
5702 : 12 : tree _o1[2], _r1;
5703 : 12 : _o1[0] = captures[0];
5704 : 12 : _o1[1] = build_real_truncate (type, dconst_third ());
5705 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
5706 : 12 : tem_op.resimplify (lseq, valueize);
5707 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5708 : 12 : if (!_r1) goto next_after_fail1477;
5709 : 6 : res_op->ops[0] = _r1;
5710 : : }
5711 : 6 : res_op->resimplify (lseq, valueize);
5712 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 912, __FILE__, __LINE__, true);
5713 : 6 : return true;
5714 : : }
5715 : : next_after_fail1477:;
5716 : : }
5717 : : }
5718 : : }
5719 : : break;
5720 : 12 : case CFN_BUILT_IN_POW10:
5721 : 12 : if (gimple_call_num_args (_c1) == 1)
5722 : : {
5723 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
5724 : 12 : _q20 = do_valueize (valueize, _q20);
5725 : 12 : {
5726 : 12 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5727 : 12 : if (flag_unsafe_math_optimizations
5728 : : )
5729 : : {
5730 : 12 : gimple_seq *lseq = seq;
5731 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1478;
5732 : 12 : {
5733 : 12 : res_op->set_op (CFN_BUILT_IN_POW10, type, 1);
5734 : 12 : {
5735 : 12 : tree _o1[2], _r1;
5736 : 12 : _o1[0] = captures[0];
5737 : 12 : _o1[1] = build_real_truncate (type, dconst_third ());
5738 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
5739 : 12 : tem_op.resimplify (lseq, valueize);
5740 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
5741 : 12 : if (!_r1) goto next_after_fail1478;
5742 : 6 : res_op->ops[0] = _r1;
5743 : : }
5744 : 6 : res_op->resimplify (lseq, valueize);
5745 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 912, __FILE__, __LINE__, true);
5746 : 6 : return true;
5747 : : }
5748 : : next_after_fail1478:;
5749 : : }
5750 : : }
5751 : : }
5752 : : break;
5753 : : default:;
5754 : : }
5755 : : }
5756 : : break;
5757 : : default:;
5758 : : }
5759 : : return false;
5760 : : }
5761 : :
5762 : : bool
5763 : 0 : gimple_simplify_CFN_BUILT_IN_TRUNCF64 (gimple_match_op *res_op, gimple_seq *seq,
5764 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5765 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5766 : : {
5767 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5768 : 0 : switch (TREE_CODE (_p0))
5769 : : {
5770 : 0 : case SSA_NAME:
5771 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
5772 : : {
5773 : 0 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5774 : 0 : switch (gimple_call_combined_fn (_c1))
5775 : : {
5776 : 0 : case CFN_BUILT_IN_TRUNCF64:
5777 : 0 : if (gimple_call_num_args (_c1) == 1)
5778 : : {
5779 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5780 : 0 : _q20 = do_valueize (valueize, _q20);
5781 : 0 : {
5782 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5783 : 0 : if (gimple_simplify_603 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_TRUNCF64))
5784 : 0 : return true;
5785 : : }
5786 : : }
5787 : : break;
5788 : : default:;
5789 : : }
5790 : : }
5791 : : break;
5792 : 0 : default:;
5793 : : }
5794 : 0 : if (integer_valued_real_p (_p0))
5795 : : {
5796 : 0 : {
5797 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
5798 : 0 : if (gimple_simplify_604 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_TRUNCF64))
5799 : 0 : return true;
5800 : : }
5801 : : }
5802 : : return false;
5803 : : }
5804 : :
5805 : : bool
5806 : 1172 : gimple_simplify_CFN_BUILT_IN_FLOORL (gimple_match_op *res_op, gimple_seq *seq,
5807 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5808 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5809 : : {
5810 : 1172 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5811 : 1172 : switch (TREE_CODE (_p0))
5812 : : {
5813 : 1110 : case SSA_NAME:
5814 : 1110 : if (gimple *_d1 = get_def (valueize, _p0))
5815 : : {
5816 : 688 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
5817 : 655 : switch (gimple_assign_rhs_code (_a1))
5818 : : {
5819 : 128 : CASE_CONVERT:
5820 : 128 : {
5821 : 128 : tree _q20 = gimple_assign_rhs1 (_a1);
5822 : 128 : _q20 = do_valueize (valueize, _q20);
5823 : 128 : if (gimple_double_value_p (_q20, valueize))
5824 : : {
5825 : 54 : {
5826 : 54 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5827 : 54 : if (gimple_simplify_606 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FLOORL, CFN_BUILT_IN_FLOOR))
5828 : 27 : return true;
5829 : : }
5830 : : }
5831 : 101 : if (gimple_float_value_p (_q20, valueize))
5832 : : {
5833 : 72 : {
5834 : 72 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5835 : 72 : if (gimple_simplify_605 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FLOORL, CFN_BUILT_IN_FLOORF))
5836 : 36 : return true;
5837 : : }
5838 : : }
5839 : : break;
5840 : : }
5841 : : default:;
5842 : : }
5843 : 230 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5844 : 0 : switch (gimple_call_combined_fn (_c1))
5845 : : {
5846 : 0 : case CFN_BUILT_IN_FLOORL:
5847 : 0 : if (gimple_call_num_args (_c1) == 1)
5848 : : {
5849 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5850 : 0 : _q20 = do_valueize (valueize, _q20);
5851 : 0 : {
5852 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5853 : 0 : if (gimple_simplify_603 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FLOORL))
5854 : 0 : return true;
5855 : : }
5856 : : }
5857 : : break;
5858 : : default:;
5859 : : }
5860 : : }
5861 : : break;
5862 : 1109 : default:;
5863 : : }
5864 : 1109 : if (integer_valued_real_p (_p0))
5865 : : {
5866 : 10 : {
5867 : 10 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
5868 : 10 : if (gimple_simplify_604 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FLOORL))
5869 : 10 : return true;
5870 : : }
5871 : : }
5872 : 1099 : if (tree_expr_nonnegative_p (_p0))
5873 : : {
5874 : 30 : {
5875 : 30 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
5876 : 30 : if (gimple_simplify_607 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FLOORL, CFN_BUILT_IN_TRUNCL))
5877 : 30 : return true;
5878 : : }
5879 : : }
5880 : : return false;
5881 : : }
5882 : :
5883 : : bool
5884 : 0 : gimple_simplify_CFN_BUILT_IN_CEILF64 (gimple_match_op *res_op, gimple_seq *seq,
5885 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5886 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5887 : : {
5888 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5889 : 0 : switch (TREE_CODE (_p0))
5890 : : {
5891 : 0 : case SSA_NAME:
5892 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
5893 : : {
5894 : 0 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5895 : 0 : switch (gimple_call_combined_fn (_c1))
5896 : : {
5897 : 0 : case CFN_BUILT_IN_CEILF64:
5898 : 0 : if (gimple_call_num_args (_c1) == 1)
5899 : : {
5900 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5901 : 0 : _q20 = do_valueize (valueize, _q20);
5902 : 0 : {
5903 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5904 : 0 : if (gimple_simplify_603 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_CEILF64))
5905 : 0 : return true;
5906 : : }
5907 : : }
5908 : : break;
5909 : : default:;
5910 : : }
5911 : : }
5912 : : break;
5913 : 0 : default:;
5914 : : }
5915 : 0 : if (integer_valued_real_p (_p0))
5916 : : {
5917 : 0 : {
5918 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
5919 : 0 : if (gimple_simplify_604 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_CEILF64))
5920 : 0 : return true;
5921 : : }
5922 : : }
5923 : : return false;
5924 : : }
5925 : :
5926 : : bool
5927 : 823 : gimple_simplify_CFN_BUILT_IN_ROUNDL (gimple_match_op *res_op, gimple_seq *seq,
5928 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5929 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
5930 : : {
5931 : 823 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
5932 : 823 : switch (TREE_CODE (_p0))
5933 : : {
5934 : 794 : case SSA_NAME:
5935 : 794 : if (gimple *_d1 = get_def (valueize, _p0))
5936 : : {
5937 : 505 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
5938 : 586 : switch (gimple_assign_rhs_code (_a1))
5939 : : {
5940 : 108 : CASE_CONVERT:
5941 : 108 : {
5942 : 108 : tree _q20 = gimple_assign_rhs1 (_a1);
5943 : 108 : _q20 = do_valueize (valueize, _q20);
5944 : 108 : if (gimple_double_value_p (_q20, valueize))
5945 : : {
5946 : 36 : {
5947 : 36 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5948 : 36 : if (gimple_simplify_606 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_ROUNDL, CFN_BUILT_IN_ROUND))
5949 : 18 : return true;
5950 : : }
5951 : : }
5952 : 90 : if (gimple_float_value_p (_q20, valueize))
5953 : : {
5954 : 72 : {
5955 : 72 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5956 : 72 : if (gimple_simplify_605 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_ROUNDL, CFN_BUILT_IN_ROUNDF))
5957 : 36 : return true;
5958 : : }
5959 : : }
5960 : : break;
5961 : : }
5962 : : default:;
5963 : : }
5964 : 149 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
5965 : 0 : switch (gimple_call_combined_fn (_c1))
5966 : : {
5967 : 0 : case CFN_BUILT_IN_ROUNDL:
5968 : 0 : if (gimple_call_num_args (_c1) == 1)
5969 : : {
5970 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
5971 : 0 : _q20 = do_valueize (valueize, _q20);
5972 : 0 : {
5973 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
5974 : 0 : if (gimple_simplify_603 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_ROUNDL))
5975 : 0 : return true;
5976 : : }
5977 : : }
5978 : : break;
5979 : : default:;
5980 : : }
5981 : : }
5982 : : break;
5983 : 769 : default:;
5984 : : }
5985 : 769 : if (integer_valued_real_p (_p0))
5986 : : {
5987 : 7 : {
5988 : 7 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
5989 : 7 : if (gimple_simplify_604 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_ROUNDL))
5990 : 7 : return true;
5991 : : }
5992 : : }
5993 : : return false;
5994 : : }
5995 : :
5996 : : bool
5997 : 44 : gimple_simplify_CFN_BUILT_IN_NEARBYINTF128 (gimple_match_op *res_op, gimple_seq *seq,
5998 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
5999 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6000 : : {
6001 : 44 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6002 : 44 : switch (TREE_CODE (_p0))
6003 : : {
6004 : 42 : case SSA_NAME:
6005 : 42 : if (gimple *_d1 = get_def (valueize, _p0))
6006 : : {
6007 : 28 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
6008 : 0 : switch (gimple_call_combined_fn (_c1))
6009 : : {
6010 : 0 : case CFN_BUILT_IN_NEARBYINTF128:
6011 : 0 : if (gimple_call_num_args (_c1) == 1)
6012 : : {
6013 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6014 : 0 : _q20 = do_valueize (valueize, _q20);
6015 : 0 : {
6016 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6017 : 0 : if (gimple_simplify_603 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_NEARBYINTF128))
6018 : 0 : return true;
6019 : : }
6020 : : }
6021 : : break;
6022 : : default:;
6023 : : }
6024 : : }
6025 : : break;
6026 : 44 : default:;
6027 : : }
6028 : 44 : if (integer_valued_real_p (_p0))
6029 : : {
6030 : 0 : {
6031 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6032 : 0 : if (gimple_simplify_604 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_NEARBYINTF128))
6033 : 0 : return true;
6034 : : }
6035 : : }
6036 : : return false;
6037 : : }
6038 : :
6039 : : bool
6040 : 759 : gimple_simplify_CFN_BUILT_IN_RINTL (gimple_match_op *res_op, gimple_seq *seq,
6041 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6042 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6043 : : {
6044 : 759 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6045 : 759 : switch (TREE_CODE (_p0))
6046 : : {
6047 : 609 : case SSA_NAME:
6048 : 609 : if (gimple *_d1 = get_def (valueize, _p0))
6049 : : {
6050 : 399 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6051 : 372 : switch (gimple_assign_rhs_code (_a1))
6052 : : {
6053 : 110 : CASE_CONVERT:
6054 : 110 : {
6055 : 110 : tree _q20 = gimple_assign_rhs1 (_a1);
6056 : 110 : _q20 = do_valueize (valueize, _q20);
6057 : 110 : if (gimple_double_value_p (_q20, valueize))
6058 : : {
6059 : 36 : {
6060 : 36 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6061 : 36 : if (gimple_simplify_606 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_RINTL, CFN_BUILT_IN_RINT))
6062 : 18 : return true;
6063 : : }
6064 : : }
6065 : 92 : if (gimple_float_value_p (_q20, valueize))
6066 : : {
6067 : 72 : {
6068 : 72 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6069 : 72 : if (gimple_simplify_605 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_RINTL, CFN_BUILT_IN_RINTF))
6070 : 36 : return true;
6071 : : }
6072 : : }
6073 : : break;
6074 : : }
6075 : : default:;
6076 : : }
6077 : 149 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
6078 : 0 : switch (gimple_call_combined_fn (_c1))
6079 : : {
6080 : 0 : case CFN_BUILT_IN_RINTL:
6081 : 0 : if (gimple_call_num_args (_c1) == 1)
6082 : : {
6083 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6084 : 0 : _q20 = do_valueize (valueize, _q20);
6085 : 0 : {
6086 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6087 : 0 : if (gimple_simplify_603 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_RINTL))
6088 : 0 : return true;
6089 : : }
6090 : : }
6091 : : break;
6092 : : default:;
6093 : : }
6094 : : }
6095 : : break;
6096 : 705 : default:;
6097 : : }
6098 : 705 : if (integer_valued_real_p (_p0))
6099 : : {
6100 : 14 : {
6101 : 14 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6102 : 14 : if (gimple_simplify_604 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_RINTL))
6103 : 14 : return true;
6104 : : }
6105 : : }
6106 : : return false;
6107 : : }
6108 : :
6109 : : bool
6110 : 1094 : gimple_simplify_CFN_BUILT_IN_LFLOORL (gimple_match_op *res_op, gimple_seq *seq,
6111 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6112 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6113 : : {
6114 : 1094 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6115 : 1094 : switch (TREE_CODE (_p0))
6116 : : {
6117 : 1028 : case SSA_NAME:
6118 : 1028 : if (gimple *_d1 = get_def (valueize, _p0))
6119 : : {
6120 : 656 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6121 : 336 : switch (gimple_assign_rhs_code (_a1))
6122 : : {
6123 : 336 : CASE_CONVERT:
6124 : 336 : {
6125 : 336 : tree _q20 = gimple_assign_rhs1 (_a1);
6126 : 336 : _q20 = do_valueize (valueize, _q20);
6127 : 336 : if (gimple_double_value_p (_q20, valueize))
6128 : : {
6129 : 120 : {
6130 : 120 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6131 : 120 : if (gimple_simplify_610 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LFLOORL, CFN_BUILT_IN_LFLOOR))
6132 : 120 : return true;
6133 : : }
6134 : : }
6135 : 216 : if (gimple_float_value_p (_q20, valueize))
6136 : : {
6137 : 216 : {
6138 : 216 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6139 : 216 : if (gimple_simplify_611 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LFLOORL, CFN_BUILT_IN_LFLOORF))
6140 : 216 : return true;
6141 : : }
6142 : : }
6143 : : break;
6144 : : }
6145 : : default:;
6146 : : }
6147 : : }
6148 : : break;
6149 : 758 : default:;
6150 : : }
6151 : 758 : if (tree_expr_nonnegative_p (_p0))
6152 : : {
6153 : 6 : {
6154 : 6 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6155 : 6 : if (gimple_simplify_612 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LFLOORL))
6156 : 6 : return true;
6157 : : }
6158 : : }
6159 : 752 : if (integer_valued_real_p (_p0))
6160 : : {
6161 : 20 : {
6162 : 20 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6163 : 20 : if (gimple_simplify_613 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LFLOORL))
6164 : 20 : return true;
6165 : : }
6166 : : }
6167 : : return false;
6168 : : }
6169 : :
6170 : : bool
6171 : 1196 : gimple_simplify_CFN_BUILT_IN_LROUNDL (gimple_match_op *res_op, gimple_seq *seq,
6172 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6173 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6174 : : {
6175 : 1196 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6176 : 1196 : switch (TREE_CODE (_p0))
6177 : : {
6178 : 1128 : case SSA_NAME:
6179 : 1128 : if (gimple *_d1 = get_def (valueize, _p0))
6180 : : {
6181 : 693 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6182 : 454 : switch (gimple_assign_rhs_code (_a1))
6183 : : {
6184 : 336 : CASE_CONVERT:
6185 : 336 : {
6186 : 336 : tree _q20 = gimple_assign_rhs1 (_a1);
6187 : 336 : _q20 = do_valueize (valueize, _q20);
6188 : 336 : if (gimple_double_value_p (_q20, valueize))
6189 : : {
6190 : 120 : {
6191 : 120 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6192 : 120 : if (gimple_simplify_610 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LROUNDL, CFN_BUILT_IN_LROUND))
6193 : 120 : return true;
6194 : : }
6195 : : }
6196 : 216 : if (gimple_float_value_p (_q20, valueize))
6197 : : {
6198 : 216 : {
6199 : 216 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6200 : 216 : if (gimple_simplify_611 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LROUNDL, CFN_BUILT_IN_LROUNDF))
6201 : 216 : return true;
6202 : : }
6203 : : }
6204 : : break;
6205 : : }
6206 : : default:;
6207 : : }
6208 : : }
6209 : : break;
6210 : 860 : default:;
6211 : : }
6212 : 860 : if (integer_valued_real_p (_p0))
6213 : : {
6214 : 81 : {
6215 : 81 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6216 : 81 : if (gimple_simplify_613 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LROUNDL))
6217 : 81 : return true;
6218 : : }
6219 : : }
6220 : : return false;
6221 : : }
6222 : :
6223 : : bool
6224 : 124 : gimple_simplify_CFN_BUILT_IN_LLFLOOR (gimple_match_op *res_op, gimple_seq *seq,
6225 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6226 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6227 : : {
6228 : 124 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6229 : 124 : switch (TREE_CODE (_p0))
6230 : : {
6231 : 68 : case SSA_NAME:
6232 : 68 : if (gimple *_d1 = get_def (valueize, _p0))
6233 : : {
6234 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6235 : 0 : switch (gimple_assign_rhs_code (_a1))
6236 : : {
6237 : 0 : CASE_CONVERT:
6238 : 0 : {
6239 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
6240 : 0 : _q20 = do_valueize (valueize, _q20);
6241 : 0 : if (gimple_float_value_p (_q20, valueize))
6242 : : {
6243 : 0 : {
6244 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
6245 : 0 : if (gimple_simplify_611 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LLFLOOR, CFN_BUILT_IN_LLFLOORF))
6246 : 0 : return true;
6247 : : }
6248 : : }
6249 : : break;
6250 : : }
6251 : : default:;
6252 : : }
6253 : : }
6254 : : break;
6255 : 124 : default:;
6256 : : }
6257 : 124 : if (tree_expr_nonnegative_p (_p0))
6258 : : {
6259 : 6 : {
6260 : 6 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6261 : 6 : if (gimple_simplify_612 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LLFLOOR))
6262 : 6 : return true;
6263 : : }
6264 : : }
6265 : 118 : if (integer_valued_real_p (_p0))
6266 : : {
6267 : 20 : {
6268 : 20 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6269 : 20 : if (gimple_simplify_613 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_LLFLOOR))
6270 : 20 : return true;
6271 : : }
6272 : : }
6273 : 98 : {
6274 : 98 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6275 : 98 : if (gimple_simplify_615 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_IFLOOR, CFN_BUILT_IN_LFLOOR, CFN_BUILT_IN_LLFLOOR))
6276 : 98 : return true;
6277 : : }
6278 : 0 : return false;
6279 : : }
6280 : :
6281 : : bool
6282 : 0 : gimple_simplify_CFN_LFLOOR (gimple_match_op *res_op, gimple_seq *seq,
6283 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6284 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6285 : : {
6286 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6287 : 0 : if (tree_expr_nonnegative_p (_p0))
6288 : : {
6289 : 0 : {
6290 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6291 : 0 : if (gimple_simplify_612 (res_op, seq, valueize, type, captures, CFN_LFLOOR))
6292 : 0 : return true;
6293 : : }
6294 : : }
6295 : 0 : if (integer_valued_real_p (_p0))
6296 : : {
6297 : 0 : {
6298 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6299 : 0 : if (gimple_simplify_613 (res_op, seq, valueize, type, captures, CFN_LFLOOR))
6300 : 0 : return true;
6301 : : }
6302 : : }
6303 : : return false;
6304 : : }
6305 : :
6306 : : bool
6307 : 183 : gimple_simplify_CFN_BUILT_IN_ICEILF (gimple_match_op *res_op, gimple_seq *seq,
6308 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6309 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6310 : : {
6311 : 183 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6312 : 183 : if (integer_valued_real_p (_p0))
6313 : : {
6314 : 0 : {
6315 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6316 : 0 : if (gimple_simplify_613 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_ICEILF))
6317 : 0 : return true;
6318 : : }
6319 : : }
6320 : 183 : {
6321 : 183 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6322 : 183 : if (gimple_simplify_614 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_ICEILF, CFN_BUILT_IN_LCEILF, CFN_BUILT_IN_LLCEILF))
6323 : 0 : return true;
6324 : : }
6325 : 183 : return false;
6326 : : }
6327 : :
6328 : : bool
6329 : 200 : gimple_simplify_CFN_BUILT_IN_IRINTF (gimple_match_op *res_op, gimple_seq *seq,
6330 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6331 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6332 : : {
6333 : 200 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6334 : 200 : if (integer_valued_real_p (_p0))
6335 : : {
6336 : 0 : {
6337 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6338 : 0 : if (gimple_simplify_616 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_IRINTF))
6339 : 0 : return true;
6340 : : }
6341 : : }
6342 : 200 : {
6343 : 200 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6344 : 200 : if (gimple_simplify_614 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_IRINTF, CFN_BUILT_IN_LRINTF, CFN_BUILT_IN_LLRINTF))
6345 : 0 : return true;
6346 : : }
6347 : 200 : return false;
6348 : : }
6349 : :
6350 : : bool
6351 : 906 : gimple_simplify_CFN_BUILT_IN_SIGNBITF (gimple_match_op *res_op, gimple_seq *seq,
6352 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6353 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6354 : : {
6355 : 906 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6356 : 906 : if (tree_expr_nonnegative_p (_p0))
6357 : : {
6358 : 306 : {
6359 : 306 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6360 : 306 : if (gimple_simplify_617 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SIGNBITF))
6361 : 306 : return true;
6362 : : }
6363 : : }
6364 : 600 : {
6365 : 600 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6366 : 600 : if (gimple_simplify_618 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SIGNBITF))
6367 : 1 : return true;
6368 : : }
6369 : 599 : return false;
6370 : : }
6371 : :
6372 : : bool
6373 : 3239 : gimple_simplify_CFN_BUILT_IN_CTZLL (gimple_match_op *res_op, gimple_seq *seq,
6374 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6375 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6376 : : {
6377 : 3239 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6378 : 3239 : switch (TREE_CODE (_p0))
6379 : : {
6380 : 3148 : case SSA_NAME:
6381 : 3148 : if (gimple *_d1 = get_def (valueize, _p0))
6382 : : {
6383 : 1438 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6384 : 1691 : switch (gimple_assign_rhs_code (_a1))
6385 : : {
6386 : 349 : CASE_CONVERT:
6387 : 349 : {
6388 : 349 : tree _q20 = gimple_assign_rhs1 (_a1);
6389 : 349 : _q20 = do_valueize (valueize, _q20);
6390 : 349 : {
6391 : 349 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
6392 : 349 : if (gimple_simplify_628 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_CTZLL))
6393 : 15 : return true;
6394 : : }
6395 : 334 : break;
6396 : : }
6397 : : default:;
6398 : : }
6399 : : }
6400 : : break;
6401 : : default:;
6402 : : }
6403 : : return false;
6404 : : }
6405 : :
6406 : : bool
6407 : 0 : gimple_simplify_CFN_BUILT_IN_POPCOUNTIMAX (gimple_match_op *res_op, gimple_seq *seq,
6408 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6409 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6410 : : {
6411 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6412 : 0 : switch (TREE_CODE (_p0))
6413 : : {
6414 : 0 : case SSA_NAME:
6415 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
6416 : : {
6417 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6418 : 0 : switch (gimple_assign_rhs_code (_a1))
6419 : : {
6420 : 0 : CASE_CONVERT:
6421 : 0 : {
6422 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
6423 : 0 : _q20 = do_valueize (valueize, _q20);
6424 : 0 : switch (TREE_CODE (_q20))
6425 : : {
6426 : 0 : case SSA_NAME:
6427 : 0 : if (gimple *_d2 = get_def (valueize, _q20))
6428 : : {
6429 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
6430 : 0 : switch (gimple_assign_rhs_code (_a2))
6431 : : {
6432 : 0 : case LROTATE_EXPR:
6433 : 0 : {
6434 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
6435 : 0 : _q30 = do_valueize (valueize, _q30);
6436 : 0 : tree _q31 = gimple_assign_rhs2 (_a2);
6437 : 0 : _q31 = do_valueize (valueize, _q31);
6438 : 0 : {
6439 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31 };
6440 : 0 : if (gimple_simplify_630 (res_op, seq, valueize, type, captures, LROTATE_EXPR, CFN_BUILT_IN_POPCOUNTIMAX))
6441 : 0 : return true;
6442 : : }
6443 : 0 : break;
6444 : : }
6445 : 0 : case RROTATE_EXPR:
6446 : 0 : {
6447 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
6448 : 0 : _q30 = do_valueize (valueize, _q30);
6449 : 0 : tree _q31 = gimple_assign_rhs2 (_a2);
6450 : 0 : _q31 = do_valueize (valueize, _q31);
6451 : 0 : {
6452 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31 };
6453 : 0 : if (gimple_simplify_630 (res_op, seq, valueize, type, captures, RROTATE_EXPR, CFN_BUILT_IN_POPCOUNTIMAX))
6454 : 0 : return true;
6455 : : }
6456 : 0 : break;
6457 : : }
6458 : : default:;
6459 : : }
6460 : 0 : else if (gcall *_c2 = dyn_cast <gcall *> (_d2))
6461 : 0 : switch (gimple_call_combined_fn (_c2))
6462 : : {
6463 : 0 : case CFN_BUILT_IN_BSWAP128:
6464 : 0 : if (gimple_call_num_args (_c2) == 1)
6465 : : {
6466 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
6467 : 0 : _q30 = do_valueize (valueize, _q30);
6468 : 0 : {
6469 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
6470 : 0 : if (gimple_simplify_629 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP128, CFN_BUILT_IN_POPCOUNTIMAX))
6471 : 0 : return true;
6472 : : }
6473 : : }
6474 : : break;
6475 : 0 : case CFN_BUILT_IN_BSWAP16:
6476 : 0 : if (gimple_call_num_args (_c2) == 1)
6477 : : {
6478 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
6479 : 0 : _q30 = do_valueize (valueize, _q30);
6480 : 0 : {
6481 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
6482 : 0 : if (gimple_simplify_629 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP16, CFN_BUILT_IN_POPCOUNTIMAX))
6483 : 0 : return true;
6484 : : }
6485 : : }
6486 : : break;
6487 : 0 : case CFN_BUILT_IN_BSWAP32:
6488 : 0 : if (gimple_call_num_args (_c2) == 1)
6489 : : {
6490 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
6491 : 0 : _q30 = do_valueize (valueize, _q30);
6492 : 0 : {
6493 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
6494 : 0 : if (gimple_simplify_629 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP32, CFN_BUILT_IN_POPCOUNTIMAX))
6495 : 0 : return true;
6496 : : }
6497 : : }
6498 : : break;
6499 : 0 : case CFN_BUILT_IN_BSWAP64:
6500 : 0 : if (gimple_call_num_args (_c2) == 1)
6501 : : {
6502 : 0 : tree _q30 = gimple_call_arg (_c2, 0);
6503 : 0 : _q30 = do_valueize (valueize, _q30);
6504 : 0 : {
6505 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q30 };
6506 : 0 : if (gimple_simplify_629 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP64, CFN_BUILT_IN_POPCOUNTIMAX))
6507 : 0 : return true;
6508 : : }
6509 : : }
6510 : : break;
6511 : : default:;
6512 : : }
6513 : : }
6514 : : break;
6515 : 0 : default:;
6516 : : }
6517 : 0 : {
6518 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
6519 : 0 : if (gimple_simplify_631 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_POPCOUNTIMAX))
6520 : 0 : return true;
6521 : : }
6522 : 0 : break;
6523 : : }
6524 : 0 : case LROTATE_EXPR:
6525 : 0 : {
6526 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
6527 : 0 : _q20 = do_valueize (valueize, _q20);
6528 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
6529 : 0 : _q21 = do_valueize (valueize, _q21);
6530 : 0 : {
6531 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21 };
6532 : 0 : if (gimple_simplify_633 (res_op, seq, valueize, type, captures, LROTATE_EXPR, CFN_BUILT_IN_POPCOUNTIMAX))
6533 : 0 : return true;
6534 : : }
6535 : 0 : break;
6536 : : }
6537 : 0 : case RROTATE_EXPR:
6538 : 0 : {
6539 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
6540 : 0 : _q20 = do_valueize (valueize, _q20);
6541 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
6542 : 0 : _q21 = do_valueize (valueize, _q21);
6543 : 0 : {
6544 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21 };
6545 : 0 : if (gimple_simplify_633 (res_op, seq, valueize, type, captures, RROTATE_EXPR, CFN_BUILT_IN_POPCOUNTIMAX))
6546 : 0 : return true;
6547 : : }
6548 : 0 : break;
6549 : : }
6550 : : default:;
6551 : : }
6552 : 0 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
6553 : 0 : switch (gimple_call_combined_fn (_c1))
6554 : : {
6555 : 0 : case CFN_BUILT_IN_BSWAP128:
6556 : 0 : if (gimple_call_num_args (_c1) == 1)
6557 : : {
6558 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6559 : 0 : _q20 = do_valueize (valueize, _q20);
6560 : 0 : {
6561 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
6562 : 0 : if (gimple_simplify_632 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP128, CFN_BUILT_IN_POPCOUNTIMAX))
6563 : 0 : return true;
6564 : : }
6565 : : }
6566 : : break;
6567 : 0 : case CFN_BUILT_IN_BSWAP16:
6568 : 0 : if (gimple_call_num_args (_c1) == 1)
6569 : : {
6570 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6571 : 0 : _q20 = do_valueize (valueize, _q20);
6572 : 0 : {
6573 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
6574 : 0 : if (gimple_simplify_632 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP16, CFN_BUILT_IN_POPCOUNTIMAX))
6575 : 0 : return true;
6576 : : }
6577 : : }
6578 : : break;
6579 : 0 : case CFN_BUILT_IN_BSWAP32:
6580 : 0 : if (gimple_call_num_args (_c1) == 1)
6581 : : {
6582 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6583 : 0 : _q20 = do_valueize (valueize, _q20);
6584 : 0 : {
6585 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
6586 : 0 : if (gimple_simplify_632 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP32, CFN_BUILT_IN_POPCOUNTIMAX))
6587 : 0 : return true;
6588 : : }
6589 : : }
6590 : : break;
6591 : 0 : case CFN_BUILT_IN_BSWAP64:
6592 : 0 : if (gimple_call_num_args (_c1) == 1)
6593 : : {
6594 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6595 : 0 : _q20 = do_valueize (valueize, _q20);
6596 : 0 : {
6597 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q20 };
6598 : 0 : if (gimple_simplify_632 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_BSWAP64, CFN_BUILT_IN_POPCOUNTIMAX))
6599 : 0 : return true;
6600 : : }
6601 : : }
6602 : : break;
6603 : : default:;
6604 : : }
6605 : : }
6606 : : break;
6607 : 0 : default:;
6608 : : }
6609 : 0 : {
6610 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6611 : 0 : if (gimple_simplify_634 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_POPCOUNTIMAX))
6612 : 0 : return true;
6613 : : }
6614 : 0 : return false;
6615 : : }
6616 : :
6617 : : bool
6618 : 0 : gimple_simplify_CFN_BUILT_IN_FFSIMAX (gimple_match_op *res_op, gimple_seq *seq,
6619 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6620 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6621 : : {
6622 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6623 : 0 : switch (TREE_CODE (_p0))
6624 : : {
6625 : 0 : case SSA_NAME:
6626 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
6627 : : {
6628 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6629 : 0 : switch (gimple_assign_rhs_code (_a1))
6630 : : {
6631 : 0 : CASE_CONVERT:
6632 : 0 : {
6633 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
6634 : 0 : _q20 = do_valueize (valueize, _q20);
6635 : 0 : {
6636 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q20 };
6637 : 0 : if (gimple_simplify_642 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FFSIMAX))
6638 : 0 : return true;
6639 : : }
6640 : 0 : break;
6641 : : }
6642 : : default:;
6643 : : }
6644 : : }
6645 : : break;
6646 : 0 : default:;
6647 : : }
6648 : 0 : if (tree_expr_nonzero_p (_p0))
6649 : : {
6650 : 0 : {
6651 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6652 : 0 : if (gimple_simplify_641 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_FFSIMAX, CFN_BUILT_IN_CTZIMAX))
6653 : 0 : return true;
6654 : : }
6655 : : }
6656 : : return false;
6657 : : }
6658 : :
6659 : : bool
6660 : 0 : gimple_simplify_CFN_REDUC_FMIN (gimple_match_op *res_op, gimple_seq *seq,
6661 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6662 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0)
6663 : : {
6664 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6665 : 0 : switch (TREE_CODE (_p0))
6666 : : {
6667 : 0 : case SSA_NAME:
6668 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
6669 : : {
6670 : 0 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
6671 : 0 : switch (gimple_call_combined_fn (_c1))
6672 : : {
6673 : 0 : case CFN_FMIN:
6674 : 0 : if (gimple_call_num_args (_c1) == 2)
6675 : : {
6676 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
6677 : 0 : _q20 = do_valueize (valueize, _q20);
6678 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
6679 : 0 : _q21 = do_valueize (valueize, _q21);
6680 : 0 : switch (TREE_CODE (_q21))
6681 : : {
6682 : 0 : case VECTOR_CST:
6683 : 0 : {
6684 : 0 : {
6685 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
6686 : 0 : gimple_seq *lseq = seq;
6687 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1504;
6688 : 0 : {
6689 : 0 : res_op->set_op (CFN_FMIN, type, 2);
6690 : 0 : {
6691 : 0 : tree _o1[1], _r1;
6692 : 0 : _o1[0] = captures[0];
6693 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_REDUC_FMIN, type, _o1[0]);
6694 : 0 : tem_op.resimplify (lseq, valueize);
6695 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
6696 : 0 : if (!_r1) goto next_after_fail1504;
6697 : 0 : res_op->ops[0] = _r1;
6698 : : }
6699 : 0 : {
6700 : 0 : tree _o1[1], _r1;
6701 : 0 : _o1[0] = captures[1];
6702 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CFN_REDUC_FMIN, type, _o1[0]);
6703 : 0 : tem_op.resimplify (lseq, valueize);
6704 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
6705 : 0 : if (!_r1) goto next_after_fail1504;
6706 : 0 : res_op->ops[1] = _r1;
6707 : : }
6708 : 0 : res_op->resimplify (lseq, valueize);
6709 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 919, __FILE__, __LINE__, true);
6710 : 0 : return true;
6711 : : }
6712 : 0 : next_after_fail1504:;
6713 : : }
6714 : 0 : break;
6715 : : }
6716 : : default:;
6717 : : }
6718 : : }
6719 : : break;
6720 : : default:;
6721 : : }
6722 : : }
6723 : : break;
6724 : : default:;
6725 : : }
6726 : : return false;
6727 : : }
6728 : :
6729 : : bool
6730 : 28784462 : gimple_simplify_POINTER_PLUS_EXPR (gimple_match_op *res_op, gimple_seq *seq,
6731 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
6732 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
6733 : : {
6734 : 28784462 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
6735 : 28784462 : if (integer_zerop (_p1))
6736 : : {
6737 : 1880410 : {
6738 : 1880410 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
6739 : 1880410 : gimple_seq *lseq = seq;
6740 : 1880410 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1580;
6741 : 1880410 : {
6742 : 1880410 : tree tem;
6743 : 1880410 : tem = captures[0];
6744 : 1880410 : res_op->set_value (tem);
6745 : 1880410 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 920, __FILE__, __LINE__, true);
6746 : 1880410 : return true;
6747 : : }
6748 : 0 : next_after_fail1580:;
6749 : : }
6750 : : }
6751 : 26904052 : switch (TREE_CODE (_p0))
6752 : : {
6753 : 19645991 : case SSA_NAME:
6754 : 19645991 : if (gimple *_d1 = get_def (valueize, _p0))
6755 : : {
6756 : 14877273 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6757 : 13320421 : switch (gimple_assign_rhs_code (_a1))
6758 : : {
6759 : 2125882 : case POINTER_PLUS_EXPR:
6760 : 2125882 : {
6761 : 2125882 : tree _q20 = gimple_assign_rhs1 (_a1);
6762 : 2125882 : _q20 = do_valueize (valueize, _q20);
6763 : 2125882 : tree _q21 = gimple_assign_rhs2 (_a1);
6764 : 2125882 : _q21 = do_valueize (valueize, _q21);
6765 : 2125882 : {
6766 : 2125882 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
6767 : 2125882 : gimple_seq *lseq = seq;
6768 : 2125882 : if (lseq
6769 : 250213 : && (!single_use (captures[0])))
6770 : 2108826 : lseq = NULL;
6771 : 2125882 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1581;
6772 : 2125882 : {
6773 : 2125882 : res_op->set_op (POINTER_PLUS_EXPR, type, 2);
6774 : 2125882 : res_op->ops[0] = captures[1];
6775 : 2125882 : {
6776 : 2125882 : tree _o1[2], _r1;
6777 : 2125882 : _o1[0] = captures[2];
6778 : 2125882 : _o1[1] = captures[3];
6779 : 2125882 : gimple_match_op tem_op (res_op->cond.any_else (), PLUS_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
6780 : 2125882 : tem_op.resimplify (lseq, valueize);
6781 : 2125882 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
6782 : 2125882 : if (!_r1) goto next_after_fail1581;
6783 : 1055273 : res_op->ops[1] = _r1;
6784 : : }
6785 : 1055273 : res_op->resimplify (lseq, valueize);
6786 : 1055273 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 935, __FILE__, __LINE__, true);
6787 : 1055273 : return true;
6788 : : }
6789 : 1070609 : next_after_fail1581:;
6790 : : }
6791 : 1070609 : break;
6792 : : }
6793 : : default:;
6794 : : }
6795 : : }
6796 : : break;
6797 : 25848779 : default:;
6798 : : }
6799 : 25848779 : if (integer_zerop (_p0))
6800 : : {
6801 : 7729 : {
6802 : 7729 : tree captures[1] ATTRIBUTE_UNUSED = { _p1 };
6803 : 7729 : gimple_seq *lseq = seq;
6804 : 7729 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1582;
6805 : 7729 : {
6806 : 7729 : res_op->set_op (NOP_EXPR, type, 1);
6807 : 7729 : res_op->ops[0] = captures[0];
6808 : 7729 : res_op->resimplify (lseq, valueize);
6809 : 7729 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 936, __FILE__, __LINE__, true);
6810 : 7729 : return true;
6811 : : }
6812 : 0 : next_after_fail1582:;
6813 : : }
6814 : : }
6815 : 25841050 : switch (TREE_CODE (_p1))
6816 : : {
6817 : 18183112 : case SSA_NAME:
6818 : 18183112 : if (gimple *_d1 = get_def (valueize, _p1))
6819 : : {
6820 : 10761316 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
6821 : 10322242 : switch (gimple_assign_rhs_code (_a1))
6822 : : {
6823 : 3155094 : CASE_CONVERT:
6824 : 3155094 : {
6825 : 3155094 : tree _q30 = gimple_assign_rhs1 (_a1);
6826 : 3155094 : _q30 = do_valueize (valueize, _q30);
6827 : 3155094 : switch (TREE_CODE (_q30))
6828 : : {
6829 : 3155086 : case SSA_NAME:
6830 : 3155086 : if (gimple *_d2 = get_def (valueize, _q30))
6831 : : {
6832 : 3035557 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
6833 : 3489207 : switch (gimple_assign_rhs_code (_a2))
6834 : : {
6835 : 25124 : case MINUS_EXPR:
6836 : 25124 : {
6837 : 25124 : tree _q40 = gimple_assign_rhs1 (_a2);
6838 : 25124 : _q40 = do_valueize (valueize, _q40);
6839 : 25124 : tree _q41 = gimple_assign_rhs2 (_a2);
6840 : 25124 : _q41 = do_valueize (valueize, _q41);
6841 : 25124 : switch (TREE_CODE (_q40))
6842 : : {
6843 : 12913 : case SSA_NAME:
6844 : 12913 : if (gimple *_d3 = get_def (valueize, _q40))
6845 : : {
6846 : 12200 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
6847 : 13654 : switch (gimple_assign_rhs_code (_a3))
6848 : : {
6849 : 343 : CASE_CONVERT:
6850 : 343 : {
6851 : 343 : tree _q50 = gimple_assign_rhs1 (_a3);
6852 : 343 : _q50 = do_valueize (valueize, _q50);
6853 : 343 : switch (TREE_CODE (_q41))
6854 : : {
6855 : 339 : case SSA_NAME:
6856 : 339 : if (gimple *_d4 = get_def (valueize, _q41))
6857 : : {
6858 : 339 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
6859 : 339 : switch (gimple_assign_rhs_code (_a4))
6860 : : {
6861 : 292 : CASE_CONVERT:
6862 : 292 : {
6863 : 292 : tree _q70 = gimple_assign_rhs1 (_a4);
6864 : 292 : _q70 = do_valueize (valueize, _q70);
6865 : 292 : if ((_q70 == _p0 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _p0, 0) && types_match (_q70, _p0)))
6866 : : {
6867 : 125 : {
6868 : 125 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q50 };
6869 : 125 : if (TYPE_PRECISION (TREE_TYPE (captures[1])) == TYPE_PRECISION (TREE_TYPE (captures[2]))
6870 : 250 : && ((
6871 : : 1
6872 : 125 : && useless_type_conversion_p (type, TREE_TYPE (captures[3])))
6873 : : || (
6874 : :
6875 : : && type == TREE_TYPE (captures[3])))
6876 : : )
6877 : : {
6878 : 125 : gimple_seq *lseq = seq;
6879 : 125 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1583;
6880 : 125 : {
6881 : 125 : tree tem;
6882 : 125 : tem = captures[3];
6883 : 125 : res_op->set_value (tem);
6884 : 125 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 937, __FILE__, __LINE__, true);
6885 : 125 : return true;
6886 : : }
6887 : 0 : next_after_fail1583:;
6888 : : }
6889 : : }
6890 : : }
6891 : : break;
6892 : : }
6893 : : default:;
6894 : : }
6895 : : }
6896 : : break;
6897 : : default:;
6898 : : }
6899 : : break;
6900 : : }
6901 : : default:;
6902 : : }
6903 : : }
6904 : : break;
6905 : : default:;
6906 : : }
6907 : : break;
6908 : : }
6909 : 173311 : case POINTER_DIFF_EXPR:
6910 : 173311 : {
6911 : 173311 : tree _q40 = gimple_assign_rhs1 (_a2);
6912 : 173311 : _q40 = do_valueize (valueize, _q40);
6913 : 173311 : tree _q41 = gimple_assign_rhs2 (_a2);
6914 : 173311 : _q41 = do_valueize (valueize, _q41);
6915 : 173311 : if ((_q41 == _p0 && ! TREE_SIDE_EFFECTS (_q41)) || operand_equal_p (_q41, _p0, 0))
6916 : : {
6917 : 4146 : {
6918 : 4146 : tree captures[5] ATTRIBUTE_UNUSED = { _q41, _p1, _q30, _q40, _p0 };
6919 : 4146 : if (TYPE_PRECISION (TREE_TYPE (captures[1])) >= TYPE_PRECISION (TREE_TYPE (captures[2]))
6920 : : )
6921 : : {
6922 : 4146 : gimple_seq *lseq = seq;
6923 : 4146 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1584;
6924 : 4146 : {
6925 : 4146 : res_op->set_op (NOP_EXPR, type, 1);
6926 : 4146 : res_op->ops[0] = captures[3];
6927 : 4146 : res_op->resimplify (lseq, valueize);
6928 : 4146 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 938, __FILE__, __LINE__, true);
6929 : 4146 : return true;
6930 : : }
6931 : 0 : next_after_fail1584:;
6932 : : }
6933 : : }
6934 : : }
6935 : : break;
6936 : : }
6937 : : default:;
6938 : : }
6939 : : }
6940 : : break;
6941 : : default:;
6942 : : }
6943 : : break;
6944 : : }
6945 : 52660 : case MINUS_EXPR:
6946 : 52660 : {
6947 : 52660 : tree _q30 = gimple_assign_rhs1 (_a1);
6948 : 52660 : _q30 = do_valueize (valueize, _q30);
6949 : 52660 : tree _q31 = gimple_assign_rhs2 (_a1);
6950 : 52660 : _q31 = do_valueize (valueize, _q31);
6951 : 52660 : switch (TREE_CODE (_q30))
6952 : : {
6953 : 48081 : case SSA_NAME:
6954 : 48081 : if (gimple *_d2 = get_def (valueize, _q30))
6955 : : {
6956 : 47674 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
6957 : 61856 : switch (gimple_assign_rhs_code (_a2))
6958 : : {
6959 : 21709 : CASE_CONVERT:
6960 : 21709 : {
6961 : 21709 : tree _q40 = gimple_assign_rhs1 (_a2);
6962 : 21709 : _q40 = do_valueize (valueize, _q40);
6963 : 21709 : switch (TREE_CODE (_q31))
6964 : : {
6965 : 21688 : case SSA_NAME:
6966 : 21688 : if (gimple *_d3 = get_def (valueize, _q31))
6967 : : {
6968 : 21668 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
6969 : 21641 : switch (gimple_assign_rhs_code (_a3))
6970 : : {
6971 : 21349 : CASE_CONVERT:
6972 : 21349 : {
6973 : 21349 : tree _q60 = gimple_assign_rhs1 (_a3);
6974 : 21349 : _q60 = do_valueize (valueize, _q60);
6975 : 21349 : if ((_q60 == _p0 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _p0, 0) && types_match (_q60, _p0)))
6976 : : {
6977 : 86 : {
6978 : 86 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p1, _p1, _q40 };
6979 : 86 : if (TYPE_PRECISION (TREE_TYPE (captures[1])) == TYPE_PRECISION (TREE_TYPE (captures[2]))
6980 : 86 : && ((
6981 : : 1
6982 : 86 : && useless_type_conversion_p (type, TREE_TYPE (captures[3])))
6983 : : || (
6984 : :
6985 : : && type == TREE_TYPE (captures[3])))
6986 : : )
6987 : : {
6988 : 86 : gimple_seq *lseq = seq;
6989 : 86 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1585;
6990 : 86 : {
6991 : 86 : tree tem;
6992 : 86 : tem = captures[3];
6993 : 86 : res_op->set_value (tem);
6994 : 86 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 937, __FILE__, __LINE__, true);
6995 : 86 : return true;
6996 : : }
6997 : 0 : next_after_fail1585:;
6998 : : }
6999 : : }
7000 : : }
7001 : : break;
7002 : : }
7003 : : default:;
7004 : : }
7005 : : }
7006 : : break;
7007 : : default:;
7008 : : }
7009 : : break;
7010 : : }
7011 : : default:;
7012 : : }
7013 : : }
7014 : : break;
7015 : : default:;
7016 : : }
7017 : : break;
7018 : : }
7019 : 0 : case POINTER_DIFF_EXPR:
7020 : 0 : {
7021 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
7022 : 0 : _q30 = do_valueize (valueize, _q30);
7023 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
7024 : 0 : _q31 = do_valueize (valueize, _q31);
7025 : 0 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || operand_equal_p (_q31, _p0, 0))
7026 : : {
7027 : 0 : {
7028 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _q31, _p1, _p1, _q30, _p0 };
7029 : 0 : if (TYPE_PRECISION (TREE_TYPE (captures[1])) >= TYPE_PRECISION (TREE_TYPE (captures[2]))
7030 : : )
7031 : : {
7032 : 0 : gimple_seq *lseq = seq;
7033 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1586;
7034 : 0 : {
7035 : 0 : res_op->set_op (NOP_EXPR, type, 1);
7036 : 0 : res_op->ops[0] = captures[3];
7037 : 0 : res_op->resimplify (lseq, valueize);
7038 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 938, __FILE__, __LINE__, true);
7039 : 0 : return true;
7040 : : }
7041 : 0 : next_after_fail1586:;
7042 : : }
7043 : : }
7044 : : }
7045 : : break;
7046 : : }
7047 : 172495 : case NEGATE_EXPR:
7048 : 172495 : {
7049 : 172495 : tree _q30 = gimple_assign_rhs1 (_a1);
7050 : 172495 : _q30 = do_valueize (valueize, _q30);
7051 : 172495 : switch (TREE_CODE (_q30))
7052 : : {
7053 : 172495 : case SSA_NAME:
7054 : 172495 : if (gimple *_d2 = get_def (valueize, _q30))
7055 : : {
7056 : 165817 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
7057 : 157635 : switch (gimple_assign_rhs_code (_a2))
7058 : : {
7059 : 66 : case BIT_AND_EXPR:
7060 : 66 : {
7061 : 66 : tree _q40 = gimple_assign_rhs1 (_a2);
7062 : 66 : _q40 = do_valueize (valueize, _q40);
7063 : 66 : tree _q41 = gimple_assign_rhs2 (_a2);
7064 : 66 : _q41 = do_valueize (valueize, _q41);
7065 : 66 : if (tree_swap_operands_p (_q40, _q41))
7066 : 0 : std::swap (_q40, _q41);
7067 : 66 : switch (TREE_CODE (_q40))
7068 : : {
7069 : 66 : case SSA_NAME:
7070 : 66 : if (gimple *_d3 = get_def (valueize, _q40))
7071 : : {
7072 : 66 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
7073 : 96 : switch (gimple_assign_rhs_code (_a3))
7074 : : {
7075 : 22 : CASE_CONVERT:
7076 : 22 : {
7077 : 22 : tree _q50 = gimple_assign_rhs1 (_a3);
7078 : 22 : _q50 = do_valueize (valueize, _q50);
7079 : 22 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _p0, 0) && types_match (_q50, _p0)))
7080 : : {
7081 : 0 : switch (TREE_CODE (_q41))
7082 : : {
7083 : 0 : case INTEGER_CST:
7084 : 0 : {
7085 : 0 : {
7086 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q41 };
7087 : 0 : {
7088 : 0 : tree algn = wide_int_to_tree (TREE_TYPE (captures[0]), ~wi::to_wide (captures[1]));
7089 : 0 : gimple_seq *lseq = seq;
7090 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1587;
7091 : 0 : {
7092 : 0 : res_op->set_op (BIT_AND_EXPR, type, 2);
7093 : 0 : res_op->ops[0] = captures[0];
7094 : 0 : res_op->ops[1] = algn;
7095 : 0 : res_op->resimplify (lseq, valueize);
7096 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 939, __FILE__, __LINE__, true);
7097 : 0 : return true;
7098 : : }
7099 : 0 : next_after_fail1587:;
7100 : : }
7101 : : }
7102 : 0 : break;
7103 : : }
7104 : : default:;
7105 : : }
7106 : : }
7107 : : break;
7108 : : }
7109 : : default:;
7110 : : }
7111 : : }
7112 : : break;
7113 : : default:;
7114 : : }
7115 : 28784462 : break;
7116 : : }
7117 : : default:;
7118 : : }
7119 : : }
7120 : : break;
7121 : : default:;
7122 : : }
7123 : : break;
7124 : : }
7125 : : default:;
7126 : : }
7127 : : }
7128 : : break;
7129 : : default:;
7130 : : }
7131 : : return false;
7132 : : }
7133 : :
7134 : : bool
7135 : 161848 : gimple_simplify_CFN_BUILT_IN_COPYSIGNF (gimple_match_op *res_op, gimple_seq *seq,
7136 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
7137 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
7138 : : {
7139 : 161848 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
7140 : 161848 : switch (TREE_CODE (_p0))
7141 : : {
7142 : 3585 : case SSA_NAME:
7143 : 3585 : if (gimple *_d1 = get_def (valueize, _p0))
7144 : : {
7145 : 2096 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7146 : 2208 : switch (gimple_assign_rhs_code (_a1))
7147 : : {
7148 : 3 : case NEGATE_EXPR:
7149 : 3 : {
7150 : 3 : tree _q20 = gimple_assign_rhs1 (_a1);
7151 : 3 : _q20 = do_valueize (valueize, _q20);
7152 : 3 : {
7153 : 3 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7154 : 3 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF;
7155 : 3 : gimple_seq *lseq = seq;
7156 : 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1861;
7157 : 3 : {
7158 : 3 : res_op->set_op (copysigns, type, 2);
7159 : 3 : res_op->ops[0] = captures[0];
7160 : 3 : res_op->ops[1] = captures[1];
7161 : 3 : res_op->resimplify (lseq, valueize);
7162 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7163 : 3 : return true;
7164 : : }
7165 : 0 : next_after_fail1861:;
7166 : : }
7167 : 0 : break;
7168 : : }
7169 : 3 : case ABS_EXPR:
7170 : 3 : {
7171 : 3 : tree _q20 = gimple_assign_rhs1 (_a1);
7172 : 3 : _q20 = do_valueize (valueize, _q20);
7173 : 3 : {
7174 : 3 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7175 : 3 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF;
7176 : 3 : gimple_seq *lseq = seq;
7177 : 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1862;
7178 : 3 : {
7179 : 3 : res_op->set_op (copysigns, type, 2);
7180 : 3 : res_op->ops[0] = captures[0];
7181 : 3 : res_op->ops[1] = captures[1];
7182 : 3 : res_op->resimplify (lseq, valueize);
7183 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7184 : 3 : return true;
7185 : : }
7186 : 0 : next_after_fail1862:;
7187 : : }
7188 : 0 : break;
7189 : : }
7190 : : default:;
7191 : : }
7192 : : }
7193 : : break;
7194 : 158132 : case REAL_CST:
7195 : 158132 : {
7196 : 158132 : {
7197 : 158132 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7198 : 158132 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF))
7199 : 44 : return true;
7200 : : }
7201 : 158088 : break;
7202 : : }
7203 : 161798 : default:;
7204 : : }
7205 : 161798 : switch (TREE_CODE (_p1))
7206 : : {
7207 : 483 : case REAL_CST:
7208 : 483 : {
7209 : 483 : {
7210 : 483 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7211 : 483 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF))
7212 : 98 : return true;
7213 : : }
7214 : 385 : break;
7215 : : }
7216 : 161700 : default:;
7217 : : }
7218 : 161700 : switch (TREE_CODE (_p0))
7219 : : {
7220 : 3482 : case SSA_NAME:
7221 : 3482 : if (gimple *_d1 = get_def (valueize, _p0))
7222 : : {
7223 : 2090 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
7224 : 169 : switch (gimple_call_combined_fn (_c1))
7225 : : {
7226 : 0 : case CFN_BUILT_IN_COPYSIGNF:
7227 : 0 : if (gimple_call_num_args (_c1) == 2)
7228 : : {
7229 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
7230 : 0 : _q20 = do_valueize (valueize, _q20);
7231 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
7232 : 0 : _q21 = do_valueize (valueize, _q21);
7233 : 0 : {
7234 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
7235 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF))
7236 : 0 : return true;
7237 : : }
7238 : : }
7239 : : break;
7240 : : default:;
7241 : : }
7242 : : }
7243 : : break;
7244 : 161700 : default:;
7245 : : }
7246 : 161700 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
7247 : : {
7248 : 2 : {
7249 : 2 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
7250 : 2 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF))
7251 : 2 : return true;
7252 : : }
7253 : : }
7254 : 161698 : switch (TREE_CODE (_p1))
7255 : : {
7256 : 160906 : case SSA_NAME:
7257 : 160906 : if (gimple *_d1 = get_def (valueize, _p1))
7258 : : {
7259 : 95374 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7260 : 186709 : switch (gimple_assign_rhs_code (_a1))
7261 : : {
7262 : 153 : case NEGATE_EXPR:
7263 : 153 : {
7264 : 153 : tree _q30 = gimple_assign_rhs1 (_a1);
7265 : 153 : _q30 = do_valueize (valueize, _q30);
7266 : 153 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
7267 : : {
7268 : 1 : {
7269 : 1 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7270 : 1 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF))
7271 : 1 : return true;
7272 : : }
7273 : : }
7274 : : break;
7275 : : }
7276 : : default:;
7277 : : }
7278 : : }
7279 : : break;
7280 : 161697 : default:;
7281 : : }
7282 : 161697 : if (tree_expr_nonnegative_p (_p1))
7283 : : {
7284 : 69 : {
7285 : 69 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7286 : 69 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF))
7287 : 69 : return true;
7288 : : }
7289 : : }
7290 : : return false;
7291 : : }
7292 : :
7293 : : bool
7294 : 159469 : gimple_simplify_CFN_BUILT_IN_COPYSIGN (gimple_match_op *res_op, gimple_seq *seq,
7295 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
7296 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
7297 : : {
7298 : 159469 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
7299 : 159469 : switch (TREE_CODE (_p0))
7300 : : {
7301 : 2715 : case SSA_NAME:
7302 : 2715 : if (gimple *_d1 = get_def (valueize, _p0))
7303 : : {
7304 : 1595 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7305 : 1467 : switch (gimple_assign_rhs_code (_a1))
7306 : : {
7307 : 3 : case NEGATE_EXPR:
7308 : 3 : {
7309 : 3 : tree _q20 = gimple_assign_rhs1 (_a1);
7310 : 3 : _q20 = do_valueize (valueize, _q20);
7311 : 3 : {
7312 : 3 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7313 : 3 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGN;
7314 : 3 : gimple_seq *lseq = seq;
7315 : 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1863;
7316 : 3 : {
7317 : 3 : res_op->set_op (copysigns, type, 2);
7318 : 3 : res_op->ops[0] = captures[0];
7319 : 3 : res_op->ops[1] = captures[1];
7320 : 3 : res_op->resimplify (lseq, valueize);
7321 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7322 : 3 : return true;
7323 : : }
7324 : 0 : next_after_fail1863:;
7325 : : }
7326 : 0 : break;
7327 : : }
7328 : 3 : case ABS_EXPR:
7329 : 3 : {
7330 : 3 : tree _q20 = gimple_assign_rhs1 (_a1);
7331 : 3 : _q20 = do_valueize (valueize, _q20);
7332 : 3 : {
7333 : 3 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7334 : 3 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGN;
7335 : 3 : gimple_seq *lseq = seq;
7336 : 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1864;
7337 : 3 : {
7338 : 3 : res_op->set_op (copysigns, type, 2);
7339 : 3 : res_op->ops[0] = captures[0];
7340 : 3 : res_op->ops[1] = captures[1];
7341 : 3 : res_op->resimplify (lseq, valueize);
7342 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7343 : 3 : return true;
7344 : : }
7345 : 0 : next_after_fail1864:;
7346 : : }
7347 : 0 : break;
7348 : : }
7349 : : default:;
7350 : : }
7351 : : }
7352 : : break;
7353 : 156663 : case REAL_CST:
7354 : 156663 : {
7355 : 156663 : {
7356 : 156663 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7357 : 156663 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN))
7358 : 41 : return true;
7359 : : }
7360 : 156622 : break;
7361 : : }
7362 : 159422 : default:;
7363 : : }
7364 : 159422 : switch (TREE_CODE (_p1))
7365 : : {
7366 : 485 : case REAL_CST:
7367 : 485 : {
7368 : 485 : {
7369 : 485 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7370 : 485 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN))
7371 : 88 : return true;
7372 : : }
7373 : 397 : break;
7374 : : }
7375 : 159334 : default:;
7376 : : }
7377 : 159334 : switch (TREE_CODE (_p0))
7378 : : {
7379 : 2622 : case SSA_NAME:
7380 : 2622 : if (gimple *_d1 = get_def (valueize, _p0))
7381 : : {
7382 : 1587 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
7383 : 235 : switch (gimple_call_combined_fn (_c1))
7384 : : {
7385 : 0 : case CFN_BUILT_IN_COPYSIGN:
7386 : 0 : if (gimple_call_num_args (_c1) == 2)
7387 : : {
7388 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
7389 : 0 : _q20 = do_valueize (valueize, _q20);
7390 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
7391 : 0 : _q21 = do_valueize (valueize, _q21);
7392 : 0 : {
7393 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
7394 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN))
7395 : 0 : return true;
7396 : : }
7397 : : }
7398 : : break;
7399 : : default:;
7400 : : }
7401 : : }
7402 : : break;
7403 : 159334 : default:;
7404 : : }
7405 : 159334 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
7406 : : {
7407 : 2 : {
7408 : 2 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
7409 : 2 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN))
7410 : 2 : return true;
7411 : : }
7412 : : }
7413 : 159332 : switch (TREE_CODE (_p1))
7414 : : {
7415 : 158615 : case SSA_NAME:
7416 : 158615 : if (gimple *_d1 = get_def (valueize, _p1))
7417 : : {
7418 : 94336 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7419 : 184945 : switch (gimple_assign_rhs_code (_a1))
7420 : : {
7421 : 2 : case NEGATE_EXPR:
7422 : 2 : {
7423 : 2 : tree _q30 = gimple_assign_rhs1 (_a1);
7424 : 2 : _q30 = do_valueize (valueize, _q30);
7425 : 2 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
7426 : : {
7427 : 1 : {
7428 : 1 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7429 : 1 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN))
7430 : 1 : return true;
7431 : : }
7432 : : }
7433 : : break;
7434 : : }
7435 : : default:;
7436 : : }
7437 : : }
7438 : : break;
7439 : 159331 : default:;
7440 : : }
7441 : 159331 : if (tree_expr_nonnegative_p (_p1))
7442 : : {
7443 : 72 : {
7444 : 72 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7445 : 72 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN))
7446 : 72 : return true;
7447 : : }
7448 : : }
7449 : : return false;
7450 : : }
7451 : :
7452 : : bool
7453 : 157956 : gimple_simplify_CFN_BUILT_IN_COPYSIGNL (gimple_match_op *res_op, gimple_seq *seq,
7454 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
7455 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
7456 : : {
7457 : 157956 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
7458 : 157956 : switch (TREE_CODE (_p0))
7459 : : {
7460 : 1442 : case SSA_NAME:
7461 : 1442 : if (gimple *_d1 = get_def (valueize, _p0))
7462 : : {
7463 : 901 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7464 : 432 : switch (gimple_assign_rhs_code (_a1))
7465 : : {
7466 : 2 : case NEGATE_EXPR:
7467 : 2 : {
7468 : 2 : tree _q20 = gimple_assign_rhs1 (_a1);
7469 : 2 : _q20 = do_valueize (valueize, _q20);
7470 : 2 : {
7471 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7472 : 2 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNL;
7473 : 2 : gimple_seq *lseq = seq;
7474 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1865;
7475 : 2 : {
7476 : 2 : res_op->set_op (copysigns, type, 2);
7477 : 2 : res_op->ops[0] = captures[0];
7478 : 2 : res_op->ops[1] = captures[1];
7479 : 2 : res_op->resimplify (lseq, valueize);
7480 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7481 : 2 : return true;
7482 : : }
7483 : 0 : next_after_fail1865:;
7484 : : }
7485 : 0 : break;
7486 : : }
7487 : 2 : case ABS_EXPR:
7488 : 2 : {
7489 : 2 : tree _q20 = gimple_assign_rhs1 (_a1);
7490 : 2 : _q20 = do_valueize (valueize, _q20);
7491 : 2 : {
7492 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7493 : 2 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNL;
7494 : 2 : gimple_seq *lseq = seq;
7495 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1866;
7496 : 2 : {
7497 : 2 : res_op->set_op (copysigns, type, 2);
7498 : 2 : res_op->ops[0] = captures[0];
7499 : 2 : res_op->ops[1] = captures[1];
7500 : 2 : res_op->resimplify (lseq, valueize);
7501 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7502 : 2 : return true;
7503 : : }
7504 : 0 : next_after_fail1866:;
7505 : : }
7506 : 0 : break;
7507 : : }
7508 : : default:;
7509 : : }
7510 : : }
7511 : : break;
7512 : 156446 : case REAL_CST:
7513 : 156446 : {
7514 : 156446 : {
7515 : 156446 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7516 : 156446 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL))
7517 : 36 : return true;
7518 : : }
7519 : 156410 : break;
7520 : : }
7521 : 157916 : default:;
7522 : : }
7523 : 157916 : switch (TREE_CODE (_p1))
7524 : : {
7525 : 8 : case REAL_CST:
7526 : 8 : {
7527 : 8 : {
7528 : 8 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7529 : 8 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL))
7530 : 8 : return true;
7531 : : }
7532 : 0 : break;
7533 : : }
7534 : 157908 : default:;
7535 : : }
7536 : 157908 : switch (TREE_CODE (_p0))
7537 : : {
7538 : 1438 : case SSA_NAME:
7539 : 1438 : if (gimple *_d1 = get_def (valueize, _p0))
7540 : : {
7541 : 897 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
7542 : 156 : switch (gimple_call_combined_fn (_c1))
7543 : : {
7544 : 0 : case CFN_BUILT_IN_COPYSIGNL:
7545 : 0 : if (gimple_call_num_args (_c1) == 2)
7546 : : {
7547 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
7548 : 0 : _q20 = do_valueize (valueize, _q20);
7549 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
7550 : 0 : _q21 = do_valueize (valueize, _q21);
7551 : 0 : {
7552 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
7553 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL))
7554 : 0 : return true;
7555 : : }
7556 : : }
7557 : : break;
7558 : : default:;
7559 : : }
7560 : : }
7561 : : break;
7562 : 157908 : default:;
7563 : : }
7564 : 157908 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
7565 : : {
7566 : 2 : {
7567 : 2 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
7568 : 2 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL))
7569 : 2 : return true;
7570 : : }
7571 : : }
7572 : 157906 : switch (TREE_CODE (_p1))
7573 : : {
7574 : 157741 : case SSA_NAME:
7575 : 157741 : if (gimple *_d1 = get_def (valueize, _p1))
7576 : : {
7577 : 93630 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7578 : 184510 : switch (gimple_assign_rhs_code (_a1))
7579 : : {
7580 : 1 : case NEGATE_EXPR:
7581 : 1 : {
7582 : 1 : tree _q30 = gimple_assign_rhs1 (_a1);
7583 : 1 : _q30 = do_valueize (valueize, _q30);
7584 : 1 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
7585 : : {
7586 : 1 : {
7587 : 1 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7588 : 1 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL))
7589 : 1 : return true;
7590 : : }
7591 : : }
7592 : : break;
7593 : : }
7594 : : default:;
7595 : : }
7596 : : }
7597 : : break;
7598 : 157905 : default:;
7599 : : }
7600 : 157905 : if (tree_expr_nonnegative_p (_p1))
7601 : : {
7602 : 70 : {
7603 : 70 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7604 : 70 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL))
7605 : 70 : return true;
7606 : : }
7607 : : }
7608 : : return false;
7609 : : }
7610 : :
7611 : : bool
7612 : 2473 : gimple_simplify_CFN_BUILT_IN_COPYSIGNF16 (gimple_match_op *res_op, gimple_seq *seq,
7613 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
7614 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
7615 : : {
7616 : 2473 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
7617 : 2473 : switch (TREE_CODE (_p0))
7618 : : {
7619 : 1177 : case SSA_NAME:
7620 : 1177 : if (gimple *_d1 = get_def (valueize, _p0))
7621 : : {
7622 : 705 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7623 : 950 : switch (gimple_assign_rhs_code (_a1))
7624 : : {
7625 : 12 : case NEGATE_EXPR:
7626 : 12 : {
7627 : 12 : tree _q20 = gimple_assign_rhs1 (_a1);
7628 : 12 : _q20 = do_valueize (valueize, _q20);
7629 : 12 : {
7630 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7631 : 12 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF16;
7632 : 12 : gimple_seq *lseq = seq;
7633 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1867;
7634 : 12 : {
7635 : 12 : res_op->set_op (copysigns, type, 2);
7636 : 12 : res_op->ops[0] = captures[0];
7637 : 12 : res_op->ops[1] = captures[1];
7638 : 12 : res_op->resimplify (lseq, valueize);
7639 : 12 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7640 : 12 : return true;
7641 : : }
7642 : 0 : next_after_fail1867:;
7643 : : }
7644 : 0 : break;
7645 : : }
7646 : 0 : case ABS_EXPR:
7647 : 0 : {
7648 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
7649 : 0 : _q20 = do_valueize (valueize, _q20);
7650 : 0 : {
7651 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7652 : 0 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF16;
7653 : 0 : gimple_seq *lseq = seq;
7654 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1868;
7655 : 0 : {
7656 : 0 : res_op->set_op (copysigns, type, 2);
7657 : 0 : res_op->ops[0] = captures[0];
7658 : 0 : res_op->ops[1] = captures[1];
7659 : 0 : res_op->resimplify (lseq, valueize);
7660 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7661 : 0 : return true;
7662 : : }
7663 : 0 : next_after_fail1868:;
7664 : : }
7665 : 0 : break;
7666 : : }
7667 : : default:;
7668 : : }
7669 : : }
7670 : : break;
7671 : 1293 : case REAL_CST:
7672 : 1293 : {
7673 : 1293 : {
7674 : 1293 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7675 : 1293 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF16))
7676 : 0 : return true;
7677 : : }
7678 : 1293 : break;
7679 : : }
7680 : 2461 : default:;
7681 : : }
7682 : 2461 : switch (TREE_CODE (_p1))
7683 : : {
7684 : 0 : case REAL_CST:
7685 : 0 : {
7686 : 0 : {
7687 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7688 : 0 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF16))
7689 : 0 : return true;
7690 : : }
7691 : 0 : break;
7692 : : }
7693 : 2461 : default:;
7694 : : }
7695 : 2461 : switch (TREE_CODE (_p0))
7696 : : {
7697 : 1165 : case SSA_NAME:
7698 : 1165 : if (gimple *_d1 = get_def (valueize, _p0))
7699 : : {
7700 : 693 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
7701 : 0 : switch (gimple_call_combined_fn (_c1))
7702 : : {
7703 : 0 : case CFN_BUILT_IN_COPYSIGNF16:
7704 : 0 : if (gimple_call_num_args (_c1) == 2)
7705 : : {
7706 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
7707 : 0 : _q20 = do_valueize (valueize, _q20);
7708 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
7709 : 0 : _q21 = do_valueize (valueize, _q21);
7710 : 0 : {
7711 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
7712 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF16))
7713 : 0 : return true;
7714 : : }
7715 : : }
7716 : : break;
7717 : : default:;
7718 : : }
7719 : : }
7720 : : break;
7721 : 2461 : default:;
7722 : : }
7723 : 2461 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
7724 : : {
7725 : 0 : {
7726 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
7727 : 0 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF16))
7728 : 0 : return true;
7729 : : }
7730 : : }
7731 : 2461 : switch (TREE_CODE (_p1))
7732 : : {
7733 : 2385 : case SSA_NAME:
7734 : 2385 : if (gimple *_d1 = get_def (valueize, _p1))
7735 : : {
7736 : 1170 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7737 : 1056 : switch (gimple_assign_rhs_code (_a1))
7738 : : {
7739 : 0 : case NEGATE_EXPR:
7740 : 0 : {
7741 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
7742 : 0 : _q30 = do_valueize (valueize, _q30);
7743 : 0 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
7744 : : {
7745 : 0 : {
7746 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7747 : 0 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF16))
7748 : 0 : return true;
7749 : : }
7750 : : }
7751 : : break;
7752 : : }
7753 : : default:;
7754 : : }
7755 : : }
7756 : : break;
7757 : 2461 : default:;
7758 : : }
7759 : 2461 : if (tree_expr_nonnegative_p (_p1))
7760 : : {
7761 : 0 : {
7762 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7763 : 0 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF16))
7764 : 0 : return true;
7765 : : }
7766 : : }
7767 : : return false;
7768 : : }
7769 : :
7770 : : bool
7771 : 342 : gimple_simplify_CFN_BUILT_IN_COPYSIGNF64 (gimple_match_op *res_op, gimple_seq *seq,
7772 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
7773 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
7774 : : {
7775 : 342 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
7776 : 342 : switch (TREE_CODE (_p0))
7777 : : {
7778 : 342 : case SSA_NAME:
7779 : 342 : if (gimple *_d1 = get_def (valueize, _p0))
7780 : : {
7781 : 225 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7782 : 438 : switch (gimple_assign_rhs_code (_a1))
7783 : : {
7784 : 12 : case NEGATE_EXPR:
7785 : 12 : {
7786 : 12 : tree _q20 = gimple_assign_rhs1 (_a1);
7787 : 12 : _q20 = do_valueize (valueize, _q20);
7788 : 12 : {
7789 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7790 : 12 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF64;
7791 : 12 : gimple_seq *lseq = seq;
7792 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1871;
7793 : 12 : {
7794 : 12 : res_op->set_op (copysigns, type, 2);
7795 : 12 : res_op->ops[0] = captures[0];
7796 : 12 : res_op->ops[1] = captures[1];
7797 : 12 : res_op->resimplify (lseq, valueize);
7798 : 12 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7799 : 12 : return true;
7800 : : }
7801 : 0 : next_after_fail1871:;
7802 : : }
7803 : 0 : break;
7804 : : }
7805 : 0 : case ABS_EXPR:
7806 : 0 : {
7807 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
7808 : 0 : _q20 = do_valueize (valueize, _q20);
7809 : 0 : {
7810 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7811 : 0 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF64;
7812 : 0 : gimple_seq *lseq = seq;
7813 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1872;
7814 : 0 : {
7815 : 0 : res_op->set_op (copysigns, type, 2);
7816 : 0 : res_op->ops[0] = captures[0];
7817 : 0 : res_op->ops[1] = captures[1];
7818 : 0 : res_op->resimplify (lseq, valueize);
7819 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7820 : 0 : return true;
7821 : : }
7822 : 0 : next_after_fail1872:;
7823 : : }
7824 : 0 : break;
7825 : : }
7826 : : default:;
7827 : : }
7828 : : }
7829 : : break;
7830 : 0 : case REAL_CST:
7831 : 0 : {
7832 : 0 : {
7833 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7834 : 0 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF64))
7835 : 0 : return true;
7836 : : }
7837 : 0 : break;
7838 : : }
7839 : 330 : default:;
7840 : : }
7841 : 330 : switch (TREE_CODE (_p1))
7842 : : {
7843 : 0 : case REAL_CST:
7844 : 0 : {
7845 : 0 : {
7846 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7847 : 0 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF64))
7848 : 0 : return true;
7849 : : }
7850 : 0 : break;
7851 : : }
7852 : 330 : default:;
7853 : : }
7854 : 330 : switch (TREE_CODE (_p0))
7855 : : {
7856 : 330 : case SSA_NAME:
7857 : 330 : if (gimple *_d1 = get_def (valueize, _p0))
7858 : : {
7859 : 213 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
7860 : 0 : switch (gimple_call_combined_fn (_c1))
7861 : : {
7862 : 0 : case CFN_BUILT_IN_COPYSIGNF64:
7863 : 0 : if (gimple_call_num_args (_c1) == 2)
7864 : : {
7865 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
7866 : 0 : _q20 = do_valueize (valueize, _q20);
7867 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
7868 : 0 : _q21 = do_valueize (valueize, _q21);
7869 : 0 : {
7870 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
7871 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF64))
7872 : 0 : return true;
7873 : : }
7874 : : }
7875 : : break;
7876 : : default:;
7877 : : }
7878 : : }
7879 : : break;
7880 : 330 : default:;
7881 : : }
7882 : 330 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
7883 : : {
7884 : 0 : {
7885 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
7886 : 0 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF64))
7887 : 0 : return true;
7888 : : }
7889 : : }
7890 : 330 : switch (TREE_CODE (_p1))
7891 : : {
7892 : 330 : case SSA_NAME:
7893 : 330 : if (gimple *_d1 = get_def (valueize, _p1))
7894 : : {
7895 : 213 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7896 : 426 : switch (gimple_assign_rhs_code (_a1))
7897 : : {
7898 : 0 : case NEGATE_EXPR:
7899 : 0 : {
7900 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
7901 : 0 : _q30 = do_valueize (valueize, _q30);
7902 : 0 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
7903 : : {
7904 : 0 : {
7905 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7906 : 0 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF64))
7907 : 0 : return true;
7908 : : }
7909 : : }
7910 : : break;
7911 : : }
7912 : : default:;
7913 : : }
7914 : : }
7915 : : break;
7916 : 330 : default:;
7917 : : }
7918 : 330 : if (tree_expr_nonnegative_p (_p1))
7919 : : {
7920 : 0 : {
7921 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7922 : 0 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF64))
7923 : 0 : return true;
7924 : : }
7925 : : }
7926 : : return false;
7927 : : }
7928 : :
7929 : : bool
7930 : 342 : gimple_simplify_CFN_BUILT_IN_COPYSIGNF32X (gimple_match_op *res_op, gimple_seq *seq,
7931 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
7932 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
7933 : : {
7934 : 342 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
7935 : 342 : switch (TREE_CODE (_p0))
7936 : : {
7937 : 342 : case SSA_NAME:
7938 : 342 : if (gimple *_d1 = get_def (valueize, _p0))
7939 : : {
7940 : 225 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
7941 : 438 : switch (gimple_assign_rhs_code (_a1))
7942 : : {
7943 : 12 : case NEGATE_EXPR:
7944 : 12 : {
7945 : 12 : tree _q20 = gimple_assign_rhs1 (_a1);
7946 : 12 : _q20 = do_valueize (valueize, _q20);
7947 : 12 : {
7948 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7949 : 12 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF32X;
7950 : 12 : gimple_seq *lseq = seq;
7951 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1875;
7952 : 12 : {
7953 : 12 : res_op->set_op (copysigns, type, 2);
7954 : 12 : res_op->ops[0] = captures[0];
7955 : 12 : res_op->ops[1] = captures[1];
7956 : 12 : res_op->resimplify (lseq, valueize);
7957 : 12 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7958 : 12 : return true;
7959 : : }
7960 : 0 : next_after_fail1875:;
7961 : : }
7962 : 0 : break;
7963 : : }
7964 : 0 : case ABS_EXPR:
7965 : 0 : {
7966 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
7967 : 0 : _q20 = do_valueize (valueize, _q20);
7968 : 0 : {
7969 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
7970 : 0 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF32X;
7971 : 0 : gimple_seq *lseq = seq;
7972 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1876;
7973 : 0 : {
7974 : 0 : res_op->set_op (copysigns, type, 2);
7975 : 0 : res_op->ops[0] = captures[0];
7976 : 0 : res_op->ops[1] = captures[1];
7977 : 0 : res_op->resimplify (lseq, valueize);
7978 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
7979 : 0 : return true;
7980 : : }
7981 : 0 : next_after_fail1876:;
7982 : : }
7983 : 0 : break;
7984 : : }
7985 : : default:;
7986 : : }
7987 : : }
7988 : : break;
7989 : 0 : case REAL_CST:
7990 : 0 : {
7991 : 0 : {
7992 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
7993 : 0 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF32X))
7994 : 0 : return true;
7995 : : }
7996 : 0 : break;
7997 : : }
7998 : 330 : default:;
7999 : : }
8000 : 330 : switch (TREE_CODE (_p1))
8001 : : {
8002 : 0 : case REAL_CST:
8003 : 0 : {
8004 : 0 : {
8005 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8006 : 0 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF32X))
8007 : 0 : return true;
8008 : : }
8009 : 0 : break;
8010 : : }
8011 : 330 : default:;
8012 : : }
8013 : 330 : switch (TREE_CODE (_p0))
8014 : : {
8015 : 330 : case SSA_NAME:
8016 : 330 : if (gimple *_d1 = get_def (valueize, _p0))
8017 : : {
8018 : 213 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
8019 : 0 : switch (gimple_call_combined_fn (_c1))
8020 : : {
8021 : 0 : case CFN_BUILT_IN_COPYSIGNF32X:
8022 : 0 : if (gimple_call_num_args (_c1) == 2)
8023 : : {
8024 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
8025 : 0 : _q20 = do_valueize (valueize, _q20);
8026 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
8027 : 0 : _q21 = do_valueize (valueize, _q21);
8028 : 0 : {
8029 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
8030 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF32X))
8031 : 0 : return true;
8032 : : }
8033 : : }
8034 : : break;
8035 : : default:;
8036 : : }
8037 : : }
8038 : : break;
8039 : 330 : default:;
8040 : : }
8041 : 330 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
8042 : : {
8043 : 0 : {
8044 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8045 : 0 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF32X))
8046 : 0 : return true;
8047 : : }
8048 : : }
8049 : 330 : switch (TREE_CODE (_p1))
8050 : : {
8051 : 330 : case SSA_NAME:
8052 : 330 : if (gimple *_d1 = get_def (valueize, _p1))
8053 : : {
8054 : 213 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8055 : 426 : switch (gimple_assign_rhs_code (_a1))
8056 : : {
8057 : 0 : case NEGATE_EXPR:
8058 : 0 : {
8059 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
8060 : 0 : _q30 = do_valueize (valueize, _q30);
8061 : 0 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
8062 : : {
8063 : 0 : {
8064 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8065 : 0 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF32X))
8066 : 0 : return true;
8067 : : }
8068 : : }
8069 : : break;
8070 : : }
8071 : : default:;
8072 : : }
8073 : : }
8074 : : break;
8075 : 330 : default:;
8076 : : }
8077 : 330 : if (tree_expr_nonnegative_p (_p1))
8078 : : {
8079 : 0 : {
8080 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8081 : 0 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF32X))
8082 : 0 : return true;
8083 : : }
8084 : : }
8085 : : return false;
8086 : : }
8087 : :
8088 : : bool
8089 : 0 : gimple_simplify_CFN_BUILT_IN_COPYSIGNF128X (gimple_match_op *res_op, gimple_seq *seq,
8090 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
8091 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
8092 : : {
8093 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
8094 : 0 : switch (TREE_CODE (_p0))
8095 : : {
8096 : 0 : case SSA_NAME:
8097 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
8098 : : {
8099 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8100 : 0 : switch (gimple_assign_rhs_code (_a1))
8101 : : {
8102 : 0 : case NEGATE_EXPR:
8103 : 0 : {
8104 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
8105 : 0 : _q20 = do_valueize (valueize, _q20);
8106 : 0 : {
8107 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
8108 : 0 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF128X;
8109 : 0 : gimple_seq *lseq = seq;
8110 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1879;
8111 : 0 : {
8112 : 0 : res_op->set_op (copysigns, type, 2);
8113 : 0 : res_op->ops[0] = captures[0];
8114 : 0 : res_op->ops[1] = captures[1];
8115 : 0 : res_op->resimplify (lseq, valueize);
8116 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
8117 : 0 : return true;
8118 : : }
8119 : 0 : next_after_fail1879:;
8120 : : }
8121 : 0 : break;
8122 : : }
8123 : 0 : case ABS_EXPR:
8124 : 0 : {
8125 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
8126 : 0 : _q20 = do_valueize (valueize, _q20);
8127 : 0 : {
8128 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
8129 : 0 : const combined_fn copysigns = CFN_BUILT_IN_COPYSIGNF128X;
8130 : 0 : gimple_seq *lseq = seq;
8131 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1880;
8132 : 0 : {
8133 : 0 : res_op->set_op (copysigns, type, 2);
8134 : 0 : res_op->ops[0] = captures[0];
8135 : 0 : res_op->ops[1] = captures[1];
8136 : 0 : res_op->resimplify (lseq, valueize);
8137 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1015, __FILE__, __LINE__, true);
8138 : 0 : return true;
8139 : : }
8140 : 0 : next_after_fail1880:;
8141 : : }
8142 : 0 : break;
8143 : : }
8144 : : default:;
8145 : : }
8146 : : }
8147 : : break;
8148 : 0 : case REAL_CST:
8149 : 0 : {
8150 : 0 : {
8151 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8152 : 0 : if (gimple_simplify_297 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF128X))
8153 : 0 : return true;
8154 : : }
8155 : 0 : break;
8156 : : }
8157 : 0 : default:;
8158 : : }
8159 : 0 : switch (TREE_CODE (_p1))
8160 : : {
8161 : 0 : case REAL_CST:
8162 : 0 : {
8163 : 0 : {
8164 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8165 : 0 : if (gimple_simplify_298 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF128X))
8166 : 0 : return true;
8167 : : }
8168 : 0 : break;
8169 : : }
8170 : 0 : default:;
8171 : : }
8172 : 0 : switch (TREE_CODE (_p0))
8173 : : {
8174 : 0 : case SSA_NAME:
8175 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
8176 : : {
8177 : 0 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
8178 : 0 : switch (gimple_call_combined_fn (_c1))
8179 : : {
8180 : 0 : case CFN_BUILT_IN_COPYSIGNF128X:
8181 : 0 : if (gimple_call_num_args (_c1) == 2)
8182 : : {
8183 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
8184 : 0 : _q20 = do_valueize (valueize, _q20);
8185 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
8186 : 0 : _q21 = do_valueize (valueize, _q21);
8187 : 0 : {
8188 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
8189 : 0 : if (gimple_simplify_299 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF128X))
8190 : 0 : return true;
8191 : : }
8192 : : }
8193 : : break;
8194 : : default:;
8195 : : }
8196 : : }
8197 : : break;
8198 : 0 : default:;
8199 : : }
8200 : 0 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
8201 : : {
8202 : 0 : {
8203 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8204 : 0 : if (gimple_simplify_300 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF128X))
8205 : 0 : return true;
8206 : : }
8207 : : }
8208 : 0 : switch (TREE_CODE (_p1))
8209 : : {
8210 : 0 : case SSA_NAME:
8211 : 0 : if (gimple *_d1 = get_def (valueize, _p1))
8212 : : {
8213 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8214 : 0 : switch (gimple_assign_rhs_code (_a1))
8215 : : {
8216 : 0 : case NEGATE_EXPR:
8217 : 0 : {
8218 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
8219 : 0 : _q30 = do_valueize (valueize, _q30);
8220 : 0 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
8221 : : {
8222 : 0 : {
8223 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8224 : 0 : if (gimple_simplify_301 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF128X))
8225 : 0 : return true;
8226 : : }
8227 : : }
8228 : : break;
8229 : : }
8230 : : default:;
8231 : : }
8232 : : }
8233 : : break;
8234 : 0 : default:;
8235 : : }
8236 : 0 : if (tree_expr_nonnegative_p (_p1))
8237 : : {
8238 : 0 : {
8239 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8240 : 0 : if (gimple_simplify_302 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF128X))
8241 : 0 : return true;
8242 : : }
8243 : : }
8244 : : return false;
8245 : : }
8246 : :
8247 : : bool
8248 : 1448299 : gimple_simplify_TRUNC_DIV_EXPR (gimple_match_op *res_op, gimple_seq *seq,
8249 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
8250 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
8251 : : {
8252 : 1448299 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
8253 : 1448299 : if (integer_onep (_p1))
8254 : : {
8255 : 6127 : {
8256 : 6127 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8257 : 6127 : if (gimple_simplify_185 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8258 : 6127 : return true;
8259 : : }
8260 : : }
8261 : 1442172 : switch (TREE_CODE (_p0))
8262 : : {
8263 : 1283046 : case SSA_NAME:
8264 : 1283046 : if (gimple *_d1 = get_def (valueize, _p0))
8265 : : {
8266 : 865547 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8267 : 826329 : switch (gimple_assign_rhs_code (_a1))
8268 : : {
8269 : 90513 : CASE_CONVERT:
8270 : 90513 : {
8271 : 90513 : tree _q20 = gimple_assign_rhs1 (_a1);
8272 : 90513 : _q20 = do_valueize (valueize, _q20);
8273 : 90513 : switch (TREE_CODE (_p1))
8274 : : {
8275 : 18683 : case SSA_NAME:
8276 : 18683 : if (gimple *_d2 = get_def (valueize, _p1))
8277 : : {
8278 : 18266 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8279 : 15420 : switch (gimple_assign_rhs_code (_a2))
8280 : : {
8281 : 11069 : CASE_CONVERT:
8282 : 11069 : {
8283 : 11069 : tree _q40 = gimple_assign_rhs1 (_a2);
8284 : 11069 : _q40 = do_valueize (valueize, _q40);
8285 : 11069 : switch (TREE_CODE (_q40))
8286 : : {
8287 : 11066 : case SSA_NAME:
8288 : 11066 : if (gimple *_d3 = get_def (valueize, _q40))
8289 : : {
8290 : 10393 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
8291 : 11227 : switch (gimple_assign_rhs_code (_a3))
8292 : : {
8293 : 0 : case LSHIFT_EXPR:
8294 : 0 : {
8295 : 0 : tree _q50 = gimple_assign_rhs1 (_a3);
8296 : 0 : _q50 = do_valueize (valueize, _q50);
8297 : 0 : tree _q51 = gimple_assign_rhs2 (_a3);
8298 : 0 : _q51 = do_valueize (valueize, _q51);
8299 : 0 : if (integer_onep (_q50))
8300 : : {
8301 : 0 : {
8302 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q50, _q51 };
8303 : 0 : if (gimple_simplify_303 (res_op, seq, valueize, type, captures))
8304 : 0 : return true;
8305 : : }
8306 : : }
8307 : : break;
8308 : : }
8309 : : default:;
8310 : : }
8311 : : }
8312 : : break;
8313 : : default:;
8314 : : }
8315 : : break;
8316 : : }
8317 : 89 : case LSHIFT_EXPR:
8318 : 89 : {
8319 : 89 : tree _q40 = gimple_assign_rhs1 (_a2);
8320 : 89 : _q40 = do_valueize (valueize, _q40);
8321 : 89 : tree _q41 = gimple_assign_rhs2 (_a2);
8322 : 89 : _q41 = do_valueize (valueize, _q41);
8323 : 89 : if (integer_onep (_q40))
8324 : : {
8325 : 85 : {
8326 : 85 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q40, _q41 };
8327 : 85 : if (gimple_simplify_303 (res_op, seq, valueize, type, captures))
8328 : 0 : return true;
8329 : : }
8330 : : }
8331 : : break;
8332 : : }
8333 : : default:;
8334 : : }
8335 : : }
8336 : : break;
8337 : : default:;
8338 : : }
8339 : : break;
8340 : : }
8341 : : default:;
8342 : : }
8343 : : }
8344 : : break;
8345 : 1442172 : default:;
8346 : : }
8347 : 1442172 : switch (TREE_CODE (_p1))
8348 : : {
8349 : 540480 : case SSA_NAME:
8350 : 540480 : if (gimple *_d1 = get_def (valueize, _p1))
8351 : : {
8352 : 409370 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8353 : 427576 : switch (gimple_assign_rhs_code (_a1))
8354 : : {
8355 : 174418 : CASE_CONVERT:
8356 : 174418 : {
8357 : 174418 : tree _q30 = gimple_assign_rhs1 (_a1);
8358 : 174418 : _q30 = do_valueize (valueize, _q30);
8359 : 174418 : switch (TREE_CODE (_q30))
8360 : : {
8361 : 174400 : case SSA_NAME:
8362 : 174400 : if (gimple *_d2 = get_def (valueize, _q30))
8363 : : {
8364 : 172391 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8365 : 149064 : switch (gimple_assign_rhs_code (_a2))
8366 : : {
8367 : 260 : case LSHIFT_EXPR:
8368 : 260 : {
8369 : 260 : tree _q40 = gimple_assign_rhs1 (_a2);
8370 : 260 : _q40 = do_valueize (valueize, _q40);
8371 : 260 : tree _q41 = gimple_assign_rhs2 (_a2);
8372 : 260 : _q41 = do_valueize (valueize, _q41);
8373 : 260 : if (integer_onep (_q40))
8374 : : {
8375 : 260 : {
8376 : 260 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _q40, _q41 };
8377 : 260 : if (gimple_simplify_304 (res_op, seq, valueize, type, captures))
8378 : 60 : return true;
8379 : : }
8380 : : }
8381 : : break;
8382 : : }
8383 : : default:;
8384 : : }
8385 : : }
8386 : : break;
8387 : : default:;
8388 : : }
8389 : : break;
8390 : : }
8391 : 506 : case LSHIFT_EXPR:
8392 : 506 : {
8393 : 506 : tree _q30 = gimple_assign_rhs1 (_a1);
8394 : 506 : _q30 = do_valueize (valueize, _q30);
8395 : 506 : tree _q31 = gimple_assign_rhs2 (_a1);
8396 : 506 : _q31 = do_valueize (valueize, _q31);
8397 : 506 : if (integer_onep (_q30))
8398 : : {
8399 : 135 : {
8400 : 135 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _q30, _q31 };
8401 : 135 : if (gimple_simplify_304 (res_op, seq, valueize, type, captures))
8402 : 50 : return true;
8403 : : }
8404 : : }
8405 : : break;
8406 : : }
8407 : : default:;
8408 : : }
8409 : : }
8410 : : break;
8411 : 1442062 : default:;
8412 : : }
8413 : 1442062 : if (integer_zerop (_p0))
8414 : : {
8415 : 20103 : {
8416 : 20103 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8417 : 20103 : if (gimple_simplify_305 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8418 : 18962 : return true;
8419 : : }
8420 : : }
8421 : 1423100 : switch (TREE_CODE (_p1))
8422 : : {
8423 : 521408 : case SSA_NAME:
8424 : 521408 : {
8425 : 521408 : {
8426 : 521408 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8427 : 521408 : if (gimple_simplify_307 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8428 : 76 : return true;
8429 : : }
8430 : 521332 : break;
8431 : : }
8432 : 1423024 : default:;
8433 : : }
8434 : 1423024 : if (integer_minus_onep (_p1))
8435 : : {
8436 : 464 : {
8437 : 464 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
8438 : 464 : if (gimple_simplify_306 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8439 : 43 : return true;
8440 : : }
8441 : : }
8442 : 1422981 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
8443 : : {
8444 : 1167 : {
8445 : 1167 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8446 : 1167 : if (gimple_simplify_308 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8447 : 22 : return true;
8448 : : }
8449 : : }
8450 : 1422959 : switch (TREE_CODE (_p1))
8451 : : {
8452 : 521310 : case SSA_NAME:
8453 : 521310 : if (gimple *_d1 = get_def (valueize, _p1))
8454 : : {
8455 : 392355 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8456 : 400820 : switch (gimple_assign_rhs_code (_a1))
8457 : : {
8458 : 1276 : case ABS_EXPR:
8459 : 1276 : {
8460 : 1276 : tree _q30 = gimple_assign_rhs1 (_a1);
8461 : 1276 : _q30 = do_valueize (valueize, _q30);
8462 : 1276 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
8463 : : {
8464 : 16 : {
8465 : 16 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8466 : 16 : if (gimple_simplify_309 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8467 : 8 : return true;
8468 : : }
8469 : : }
8470 : : break;
8471 : : }
8472 : : default:;
8473 : : }
8474 : : }
8475 : : break;
8476 : 1422951 : default:;
8477 : : }
8478 : 1422951 : switch (TREE_CODE (_p0))
8479 : : {
8480 : 1282863 : case SSA_NAME:
8481 : 1282863 : if (gimple *_d1 = get_def (valueize, _p0))
8482 : : {
8483 : 865408 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8484 : 826194 : switch (gimple_assign_rhs_code (_a1))
8485 : : {
8486 : 4592 : case ABS_EXPR:
8487 : 4592 : {
8488 : 4592 : tree _q20 = gimple_assign_rhs1 (_a1);
8489 : 4592 : _q20 = do_valueize (valueize, _q20);
8490 : 4592 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
8491 : : {
8492 : 0 : {
8493 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
8494 : 0 : if (gimple_simplify_309 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8495 : 0 : return true;
8496 : : }
8497 : : }
8498 : : break;
8499 : : }
8500 : : default:;
8501 : : }
8502 : : }
8503 : : break;
8504 : 1422951 : default:;
8505 : : }
8506 : 1422951 : switch (TREE_CODE (_p1))
8507 : : {
8508 : 521302 : case SSA_NAME:
8509 : 521302 : if (gimple *_d1 = get_def (valueize, _p1))
8510 : : {
8511 : 392347 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8512 : 400812 : switch (gimple_assign_rhs_code (_a1))
8513 : : {
8514 : 13697 : case NEGATE_EXPR:
8515 : 13697 : {
8516 : 13697 : tree _q30 = gimple_assign_rhs1 (_a1);
8517 : 13697 : _q30 = do_valueize (valueize, _q30);
8518 : 13697 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
8519 : : {
8520 : 0 : {
8521 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
8522 : 0 : if (gimple_simplify_310 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8523 : 0 : return true;
8524 : : }
8525 : : }
8526 : : break;
8527 : : }
8528 : : default:;
8529 : : }
8530 : : }
8531 : : break;
8532 : 1422951 : default:;
8533 : : }
8534 : 1422951 : switch (TREE_CODE (_p0))
8535 : : {
8536 : 1282863 : case SSA_NAME:
8537 : 1282863 : if (gimple *_d1 = get_def (valueize, _p0))
8538 : : {
8539 : 865408 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
8540 : 826194 : switch (gimple_assign_rhs_code (_a1))
8541 : : {
8542 : 1859 : case NEGATE_EXPR:
8543 : 1859 : {
8544 : 1859 : tree _q20 = gimple_assign_rhs1 (_a1);
8545 : 1859 : _q20 = do_valueize (valueize, _q20);
8546 : 1859 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
8547 : : {
8548 : 0 : {
8549 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
8550 : 0 : if (gimple_simplify_310 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8551 : 0 : return true;
8552 : : }
8553 : : }
8554 : : break;
8555 : : }
8556 : 59190 : case TRUNC_DIV_EXPR:
8557 : 59190 : {
8558 : 59190 : tree _q20 = gimple_assign_rhs1 (_a1);
8559 : 59190 : _q20 = do_valueize (valueize, _q20);
8560 : 59190 : tree _q21 = gimple_assign_rhs2 (_a1);
8561 : 59190 : _q21 = do_valueize (valueize, _q21);
8562 : 59190 : switch (TREE_CODE (_q21))
8563 : : {
8564 : 27007 : case INTEGER_CST:
8565 : 27007 : {
8566 : 27007 : switch (TREE_CODE (_p1))
8567 : : {
8568 : 15576 : case INTEGER_CST:
8569 : 15576 : {
8570 : 15576 : {
8571 : 15576 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
8572 : 15576 : if (gimple_simplify_311 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8573 : 2872 : return true;
8574 : : }
8575 : 12704 : break;
8576 : : }
8577 : : default:;
8578 : : }
8579 : : break;
8580 : : }
8581 : : default:;
8582 : : }
8583 : : break;
8584 : : }
8585 : 90481 : CASE_CONVERT:
8586 : 90481 : {
8587 : 90481 : tree _q20 = gimple_assign_rhs1 (_a1);
8588 : 90481 : _q20 = do_valueize (valueize, _q20);
8589 : 90481 : switch (TREE_CODE (_q20))
8590 : : {
8591 : 90481 : case SSA_NAME:
8592 : 90481 : if (gimple *_d2 = get_def (valueize, _q20))
8593 : : {
8594 : 85813 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8595 : 57824 : switch (gimple_assign_rhs_code (_a2))
8596 : : {
8597 : 1148 : case BIT_AND_EXPR:
8598 : 1148 : {
8599 : 1148 : tree _q30 = gimple_assign_rhs1 (_a2);
8600 : 1148 : _q30 = do_valueize (valueize, _q30);
8601 : 1148 : tree _q31 = gimple_assign_rhs2 (_a2);
8602 : 1148 : _q31 = do_valueize (valueize, _q31);
8603 : 1148 : if (tree_swap_operands_p (_q30, _q31))
8604 : 0 : std::swap (_q30, _q31);
8605 : 1148 : switch (TREE_CODE (_q31))
8606 : : {
8607 : 1148 : case INTEGER_CST:
8608 : 1148 : {
8609 : 1148 : switch (TREE_CODE (_p1))
8610 : : {
8611 : 218 : case INTEGER_CST:
8612 : 218 : {
8613 : 218 : {
8614 : 218 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
8615 : 218 : if (gimple_simplify_312 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8616 : 0 : return true;
8617 : : }
8618 : 218 : break;
8619 : : }
8620 : : default:;
8621 : : }
8622 : : break;
8623 : : }
8624 : : default:;
8625 : : }
8626 : 1419385 : break;
8627 : : }
8628 : : default:;
8629 : : }
8630 : : }
8631 : : break;
8632 : : default:;
8633 : : }
8634 : : break;
8635 : : }
8636 : 9370 : case BIT_AND_EXPR:
8637 : 9370 : {
8638 : 9370 : tree _q20 = gimple_assign_rhs1 (_a1);
8639 : 9370 : _q20 = do_valueize (valueize, _q20);
8640 : 9370 : tree _q21 = gimple_assign_rhs2 (_a1);
8641 : 9370 : _q21 = do_valueize (valueize, _q21);
8642 : 9370 : if (tree_swap_operands_p (_q20, _q21))
8643 : 20 : std::swap (_q20, _q21);
8644 : 9370 : switch (TREE_CODE (_q21))
8645 : : {
8646 : 8631 : case INTEGER_CST:
8647 : 8631 : {
8648 : 8631 : switch (TREE_CODE (_p1))
8649 : : {
8650 : 7658 : case INTEGER_CST:
8651 : 7658 : {
8652 : 7658 : {
8653 : 7658 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
8654 : 7658 : if (gimple_simplify_312 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8655 : 8 : return true;
8656 : : }
8657 : 7650 : break;
8658 : : }
8659 : : default:;
8660 : : }
8661 : : break;
8662 : : }
8663 : : default:;
8664 : : }
8665 : 1419385 : break;
8666 : : }
8667 : 46807 : case MULT_EXPR:
8668 : 46807 : {
8669 : 46807 : tree _q20 = gimple_assign_rhs1 (_a1);
8670 : 46807 : _q20 = do_valueize (valueize, _q20);
8671 : 46807 : tree _q21 = gimple_assign_rhs2 (_a1);
8672 : 46807 : _q21 = do_valueize (valueize, _q21);
8673 : 46807 : if (tree_swap_operands_p (_q20, _q21))
8674 : 1514 : std::swap (_q20, _q21);
8675 : 46807 : if (integer_pow2p (_q21))
8676 : : {
8677 : 4967 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
8678 : : {
8679 : 278 : {
8680 : 278 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
8681 : 278 : if (INTEGRAL_TYPE_P (TREE_TYPE (captures[0])) && TYPE_UNSIGNED (TREE_TYPE (captures[0]))
8682 : : )
8683 : : {
8684 : 12 : gimple_seq *lseq = seq;
8685 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1883;
8686 : 12 : {
8687 : 12 : res_op->set_op (BIT_AND_EXPR, type, 2);
8688 : 12 : res_op->ops[0] = captures[0];
8689 : 12 : res_op->ops[1] = wide_int_to_tree
8690 : 24 : (type, wi::mask (TYPE_PRECISION (type)
8691 : 12 : - wi::exact_log2 (wi::to_wide (captures[1])),
8692 : 12 : false, TYPE_PRECISION (type)));
8693 : 12 : res_op->resimplify (lseq, valueize);
8694 : 12 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1016, __FILE__, __LINE__, true);
8695 : 12 : return true;
8696 : : }
8697 : 0 : next_after_fail1883:;
8698 : : }
8699 : : }
8700 : : }
8701 : : }
8702 : 46795 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
8703 : : {
8704 : 1077 : {
8705 : 1077 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
8706 : 1077 : if (gimple_simplify_313 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8707 : 101 : return true;
8708 : : }
8709 : : }
8710 : 46694 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
8711 : : {
8712 : 764 : {
8713 : 764 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
8714 : 764 : if (gimple_simplify_313 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8715 : 27 : return true;
8716 : : }
8717 : : }
8718 : 46667 : switch (TREE_CODE (_q21))
8719 : : {
8720 : 23376 : case INTEGER_CST:
8721 : 23376 : {
8722 : 23376 : switch (TREE_CODE (_p1))
8723 : : {
8724 : 8666 : case SSA_NAME:
8725 : 8666 : if (gimple *_d2 = get_def (valueize, _p1))
8726 : : {
8727 : 8243 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8728 : 8648 : switch (gimple_assign_rhs_code (_a2))
8729 : : {
8730 : 84 : case MULT_EXPR:
8731 : 84 : {
8732 : 84 : tree _q50 = gimple_assign_rhs1 (_a2);
8733 : 84 : _q50 = do_valueize (valueize, _q50);
8734 : 84 : tree _q51 = gimple_assign_rhs2 (_a2);
8735 : 84 : _q51 = do_valueize (valueize, _q51);
8736 : 84 : if (tree_swap_operands_p (_q50, _q51))
8737 : 0 : std::swap (_q50, _q51);
8738 : 84 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
8739 : : {
8740 : 11 : switch (TREE_CODE (_q51))
8741 : : {
8742 : 11 : case INTEGER_CST:
8743 : 11 : {
8744 : 11 : {
8745 : 11 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
8746 : 11 : if (gimple_simplify_315 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8747 : 5 : return true;
8748 : : }
8749 : 6 : break;
8750 : : }
8751 : : default:;
8752 : : }
8753 : : }
8754 : 1419385 : break;
8755 : : }
8756 : : default:;
8757 : : }
8758 : : }
8759 : : break;
8760 : 14710 : case INTEGER_CST:
8761 : 14710 : {
8762 : 14710 : {
8763 : 14710 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
8764 : 14710 : if (gimple_simplify_314 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8765 : 195 : return true;
8766 : : }
8767 : 14515 : break;
8768 : : }
8769 : : default:;
8770 : : }
8771 : : break;
8772 : : }
8773 : : default:;
8774 : : }
8775 : 1419385 : break;
8776 : : }
8777 : 143600 : case PLUS_EXPR:
8778 : 143600 : {
8779 : 143600 : tree _q20 = gimple_assign_rhs1 (_a1);
8780 : 143600 : _q20 = do_valueize (valueize, _q20);
8781 : 143600 : tree _q21 = gimple_assign_rhs2 (_a1);
8782 : 143600 : _q21 = do_valueize (valueize, _q21);
8783 : 143600 : if (tree_swap_operands_p (_q20, _q21))
8784 : 5619 : std::swap (_q20, _q21);
8785 : 143600 : switch (TREE_CODE (_q21))
8786 : : {
8787 : 61246 : case SSA_NAME:
8788 : 61246 : if (gimple *_d2 = get_def (valueize, _q21))
8789 : : {
8790 : 57893 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8791 : 55536 : switch (gimple_assign_rhs_code (_a2))
8792 : : {
8793 : 21477 : case MULT_EXPR:
8794 : 21477 : {
8795 : 21477 : tree _q40 = gimple_assign_rhs1 (_a2);
8796 : 21477 : _q40 = do_valueize (valueize, _q40);
8797 : 21477 : tree _q41 = gimple_assign_rhs2 (_a2);
8798 : 21477 : _q41 = do_valueize (valueize, _q41);
8799 : 21477 : if (tree_swap_operands_p (_q40, _q41))
8800 : 696 : std::swap (_q40, _q41);
8801 : 21477 : if ((_p1 == _q41 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q41, 0) && types_match (_p1, _q41)))
8802 : : {
8803 : 276 : {
8804 : 276 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q40, _q41 };
8805 : 276 : if (gimple_simplify_316 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8806 : 0 : return true;
8807 : : }
8808 : : }
8809 : 21477 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
8810 : : {
8811 : 156 : {
8812 : 156 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q41, _q40 };
8813 : 156 : if (gimple_simplify_316 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8814 : 0 : return true;
8815 : : }
8816 : : }
8817 : 143600 : break;
8818 : : }
8819 : : default:;
8820 : : }
8821 : : }
8822 : : break;
8823 : 143600 : default:;
8824 : : }
8825 : 143600 : switch (TREE_CODE (_q20))
8826 : : {
8827 : 143600 : case SSA_NAME:
8828 : 143600 : if (gimple *_d2 = get_def (valueize, _q20))
8829 : : {
8830 : 130512 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8831 : 120686 : switch (gimple_assign_rhs_code (_a2))
8832 : : {
8833 : 16779 : case MULT_EXPR:
8834 : 16779 : {
8835 : 16779 : tree _q30 = gimple_assign_rhs1 (_a2);
8836 : 16779 : _q30 = do_valueize (valueize, _q30);
8837 : 16779 : tree _q31 = gimple_assign_rhs2 (_a2);
8838 : 16779 : _q31 = do_valueize (valueize, _q31);
8839 : 16779 : if (tree_swap_operands_p (_q30, _q31))
8840 : 248 : std::swap (_q30, _q31);
8841 : 16779 : if ((_p1 == _q31 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q31, 0) && types_match (_p1, _q31)))
8842 : : {
8843 : 116 : {
8844 : 116 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q21, _q20, _q30, _q31 };
8845 : 116 : if (gimple_simplify_316 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8846 : 2 : return true;
8847 : : }
8848 : : }
8849 : 16777 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q30, 0) && types_match (_p1, _q30)))
8850 : : {
8851 : 57 : {
8852 : 57 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q21, _q20, _q31, _q30 };
8853 : 57 : if (gimple_simplify_316 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
8854 : 3 : return true;
8855 : : }
8856 : : }
8857 : 143595 : break;
8858 : : }
8859 : : default:;
8860 : : }
8861 : : }
8862 : : break;
8863 : 143595 : default:;
8864 : : }
8865 : 143595 : switch (TREE_CODE (_q21))
8866 : : {
8867 : 82352 : case INTEGER_CST:
8868 : 82352 : {
8869 : 82352 : switch (TREE_CODE (_p1))
8870 : : {
8871 : 69564 : case INTEGER_CST:
8872 : 69564 : {
8873 : 69564 : {
8874 : 69564 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
8875 : 69564 : {
8876 : 69564 : wide_int c = wi::to_wide (captures[2]);
8877 : 69564 : wide_int n = wi::to_wide (captures[3]);
8878 : 69564 : bool shift = TRUNC_DIV_EXPR == RSHIFT_EXPR;
8879 : 69564 : value_range vr0, vr1, vr3;
8880 : 69564 : if (INTEGRAL_TYPE_P (type)
8881 : 139128 : && get_range_query (cfun)->range_of_expr (vr0, captures[1])
8882 : : )
8883 : : {
8884 : 69564 : if ((shift ? wi::ctz (
8885 : : c
8886 : : ) >= n.to_shwi ()
8887 : 69564 : : wi::multiple_of_p (
8888 : : c
8889 : 69564 : , n, TYPE_SIGN (type)))
8890 : 20086 : && get_range_query (cfun)->range_of_expr (vr1, captures[2])
8891 : 10043 : && range_op_handler (PLUS_EXPR).overflow_free_p (vr0, vr1)
8892 : 17434 : && get_range_query (cfun)->range_of_expr (vr3, captures[0])
8893 : 8717 : && !vr3.undefined_p ()
8894 : 8716 : && (TYPE_UNSIGNED (type)
8895 : 8699 : || (vr0.nonnegative_p () && vr3.nonnegative_p ())
8896 : 8687 : || (vr0.nonpositive_p () && vr3.nonpositive_p ()))
8897 : : )
8898 : : {
8899 : 33 : gimple_seq *lseq = seq;
8900 : 33 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1884;
8901 : 33 : {
8902 : 33 : res_op->set_op (PLUS_EXPR, type, 2);
8903 : 33 : {
8904 : 33 : tree _o1[2], _r1;
8905 : 33 : _o1[0] = captures[1];
8906 : 33 : _o1[1] = captures[3];
8907 : 33 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8908 : 33 : tem_op.resimplify (lseq, valueize);
8909 : 33 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
8910 : 33 : if (!_r1) goto next_after_fail1884;
8911 : 19 : res_op->ops[0] = _r1;
8912 : : }
8913 : 19 : res_op->ops[1] = wide_int_to_tree (type,
8914 : 38 : (shift ? wi::rshift (
8915 : : c
8916 : : , n, TYPE_SIGN (type))
8917 : : : wi::div_trunc (
8918 : : c
8919 : 19 : , n, TYPE_SIGN (type)))
8920 : : );
8921 : 19 : res_op->resimplify (lseq, valueize);
8922 : 19 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1017, __FILE__, __LINE__, true);
8923 : 19 : return true;
8924 : : }
8925 : 69226 : next_after_fail1884:;
8926 : : }
8927 : : else
8928 : : {
8929 : 69527 : if (!vr0.undefined_p () && TYPE_UNSIGNED (type) && c.sign_mask () < 0
8930 : : &&
8931 : 23486 : (shift ? wi::ctz (
8932 : : -c
8933 : : ) >= n.to_shwi ()
8934 : 46972 : : wi::multiple_of_p (
8935 : 93017 : -c
8936 : 23486 : , n, TYPE_SIGN (type)))
8937 : 155879 : && wi::geu_p (vr0.lower_bound (), -c)
8938 : : )
8939 : : {
8940 : 489 : gimple_seq *lseq = seq;
8941 : 489 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1885;
8942 : 489 : {
8943 : 489 : res_op->set_op (PLUS_EXPR, type, 2);
8944 : 489 : {
8945 : 489 : tree _o1[2], _r1;
8946 : 489 : _o1[0] = captures[1];
8947 : 489 : _o1[1] = captures[3];
8948 : 489 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
8949 : 489 : tem_op.resimplify (lseq, valueize);
8950 : 489 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
8951 : 489 : if (!_r1) goto next_after_fail1885;
8952 : 319 : res_op->ops[0] = _r1;
8953 : : }
8954 : 319 : res_op->ops[1] = wide_int_to_tree (type, -
8955 : 319 : (shift ? wi::rshift (
8956 : : -c
8957 : : , n, TYPE_SIGN (type))
8958 : : : wi::div_trunc (
8959 : 319 : -c
8960 : 319 : , n, TYPE_SIGN (type)))
8961 : : );
8962 : 319 : res_op->resimplify (lseq, valueize);
8963 : 319 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1018, __FILE__, __LINE__, true);
8964 : 319 : return true;
8965 : : }
8966 : 69226 : next_after_fail1885:;
8967 : : }
8968 : : }
8969 : : }
8970 : 69564 : }
8971 : : }
8972 : 69226 : break;
8973 : : }
8974 : : default:;
8975 : : }
8976 : : break;
8977 : : }
8978 : : default:;
8979 : : }
8980 : 1419385 : break;
8981 : : }
8982 : 135295 : case MINUS_EXPR:
8983 : 135295 : {
8984 : 135295 : tree _q20 = gimple_assign_rhs1 (_a1);
8985 : 135295 : _q20 = do_valueize (valueize, _q20);
8986 : 135295 : tree _q21 = gimple_assign_rhs2 (_a1);
8987 : 135295 : _q21 = do_valueize (valueize, _q21);
8988 : 135295 : switch (TREE_CODE (_q21))
8989 : : {
8990 : 134919 : case SSA_NAME:
8991 : 134919 : if (gimple *_d2 = get_def (valueize, _q21))
8992 : : {
8993 : 119753 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
8994 : 140798 : switch (gimple_assign_rhs_code (_a2))
8995 : : {
8996 : 1347 : case MULT_EXPR:
8997 : 1347 : {
8998 : 1347 : tree _q40 = gimple_assign_rhs1 (_a2);
8999 : 1347 : _q40 = do_valueize (valueize, _q40);
9000 : 1347 : tree _q41 = gimple_assign_rhs2 (_a2);
9001 : 1347 : _q41 = do_valueize (valueize, _q41);
9002 : 1347 : if (tree_swap_operands_p (_q40, _q41))
9003 : 32 : std::swap (_q40, _q41);
9004 : 1347 : if ((_p1 == _q41 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q41, 0) && types_match (_p1, _q41)))
9005 : : {
9006 : 12 : {
9007 : 12 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q40, _q41 };
9008 : 12 : if (gimple_simplify_317 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
9009 : 0 : return true;
9010 : : }
9011 : : }
9012 : 1347 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
9013 : : {
9014 : 57 : {
9015 : 57 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q41, _q40 };
9016 : 57 : if (gimple_simplify_317 (res_op, seq, valueize, type, captures, TRUNC_DIV_EXPR))
9017 : 3 : return true;
9018 : : }
9019 : : }
9020 : 1419385 : break;
9021 : : }
9022 : : default:;
9023 : : }
9024 : : }
9025 : : break;
9026 : : default:;
9027 : : }
9028 : : break;
9029 : : }
9030 : 0 : case VEC_COND_EXPR:
9031 : 0 : {
9032 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
9033 : 0 : _q20 = do_valueize (valueize, _q20);
9034 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
9035 : 0 : _q21 = do_valueize (valueize, _q21);
9036 : 0 : tree _q22 = gimple_assign_rhs3 (_a1);
9037 : 0 : _q22 = do_valueize (valueize, _q22);
9038 : 0 : switch (TREE_CODE (_p1))
9039 : : {
9040 : 0 : case SSA_NAME:
9041 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
9042 : : {
9043 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
9044 : 0 : switch (gimple_assign_rhs_code (_a2))
9045 : : {
9046 : 0 : case VEC_COND_EXPR:
9047 : 0 : {
9048 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
9049 : 0 : _q60 = do_valueize (valueize, _q60);
9050 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
9051 : 0 : _q61 = do_valueize (valueize, _q61);
9052 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
9053 : 0 : _q62 = do_valueize (valueize, _q62);
9054 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
9055 : : {
9056 : 0 : {
9057 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
9058 : 0 : if (TREE_CODE_CLASS (TRUNC_DIV_EXPR) != tcc_comparison
9059 : : || types_match (type, TREE_TYPE (captures[2]))
9060 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
9061 : : || (optimize_vectors_before_lowering_p ()
9062 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
9063 : : TREE_TYPE (captures[1]), ERROR_MARK))
9064 : : )
9065 : : {
9066 : 0 : gimple_seq *lseq = seq;
9067 : 0 : if (lseq
9068 : 0 : && (!single_use (captures[0])
9069 : 0 : || !single_use (captures[4])))
9070 : 0 : lseq = NULL;
9071 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1886;
9072 : 0 : {
9073 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
9074 : 0 : res_op->ops[0] = captures[1];
9075 : 0 : {
9076 : 0 : tree _o1[2], _r1;
9077 : 0 : _o1[0] = captures[2];
9078 : 0 : _o1[1] = captures[5];
9079 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9080 : 0 : tem_op.resimplify (NULL, valueize);
9081 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9082 : 0 : if (!_r1) goto next_after_fail1886;
9083 : 0 : res_op->ops[1] = _r1;
9084 : : }
9085 : 0 : {
9086 : 0 : tree _o1[2], _r1;
9087 : 0 : _o1[0] = captures[3];
9088 : 0 : _o1[1] = captures[6];
9089 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9090 : 0 : tem_op.resimplify (NULL, valueize);
9091 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9092 : 0 : if (!_r1) goto next_after_fail1886;
9093 : 0 : res_op->ops[2] = _r1;
9094 : : }
9095 : 0 : res_op->resimplify (lseq, valueize);
9096 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
9097 : 0 : return true;
9098 : : }
9099 : 0 : next_after_fail1886:;
9100 : : }
9101 : : }
9102 : : }
9103 : : break;
9104 : : }
9105 : : default:;
9106 : : }
9107 : : }
9108 : : break;
9109 : 0 : default:;
9110 : : }
9111 : 0 : {
9112 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
9113 : 0 : if (TREE_CODE_CLASS (TRUNC_DIV_EXPR) != tcc_comparison
9114 : : || types_match (type, TREE_TYPE (captures[2]))
9115 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
9116 : : || (optimize_vectors_before_lowering_p ()
9117 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
9118 : : TREE_TYPE (captures[1]), ERROR_MARK))
9119 : : )
9120 : : {
9121 : 0 : gimple_seq *lseq = seq;
9122 : 0 : if (lseq
9123 : 0 : && (!single_use (captures[0])))
9124 : 0 : lseq = NULL;
9125 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1887;
9126 : 0 : {
9127 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
9128 : 0 : res_op->ops[0] = captures[1];
9129 : 0 : {
9130 : 0 : tree _o1[2], _r1;
9131 : 0 : _o1[0] = captures[2];
9132 : 0 : _o1[1] = captures[4];
9133 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9134 : 0 : tem_op.resimplify (NULL, valueize);
9135 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9136 : 0 : if (!_r1) goto next_after_fail1887;
9137 : 0 : res_op->ops[1] = _r1;
9138 : : }
9139 : 0 : {
9140 : 0 : tree _o1[2], _r1;
9141 : 0 : _o1[0] = captures[3];
9142 : 0 : _o1[1] = captures[4];
9143 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9144 : 0 : tem_op.resimplify (NULL, valueize);
9145 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9146 : 0 : if (!_r1) goto next_after_fail1887;
9147 : 0 : res_op->ops[2] = _r1;
9148 : : }
9149 : 0 : res_op->resimplify (lseq, valueize);
9150 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
9151 : 0 : return true;
9152 : : }
9153 : 0 : next_after_fail1887:;
9154 : : }
9155 : : }
9156 : 0 : break;
9157 : : }
9158 : : default:;
9159 : : }
9160 : : }
9161 : : break;
9162 : 1419385 : default:;
9163 : : }
9164 : 1419385 : if (integer_onep (_p0))
9165 : : {
9166 : 4626 : {
9167 : 4626 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
9168 : 4626 : if (INTEGRAL_TYPE_P (type)
9169 : 4622 : && TYPE_PRECISION (type) > 1
9170 : 4622 : && !integer_zerop (captures[1])
9171 : 7324 : && (!flag_non_call_exceptions || tree_expr_nonzero_p (captures[1]))
9172 : : )
9173 : : {
9174 : 2405 : if (TYPE_UNSIGNED (type)
9175 : : )
9176 : : {
9177 : 159 : gimple_seq *lseq = seq;
9178 : 159 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1888;
9179 : 159 : {
9180 : 159 : res_op->set_op (NOP_EXPR, type, 1);
9181 : 159 : {
9182 : 159 : tree _o1[2], _r1;
9183 : 159 : _o1[0] = captures[1];
9184 : 159 : _o1[1] = build_one_cst (type);
9185 : 159 : gimple_match_op tem_op (res_op->cond.any_else (), EQ_EXPR, boolean_type_node, _o1[0], _o1[1]);
9186 : 159 : tem_op.resimplify (lseq, valueize);
9187 : 159 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
9188 : 159 : if (!_r1) goto next_after_fail1888;
9189 : 20 : res_op->ops[0] = _r1;
9190 : : }
9191 : 20 : res_op->resimplify (lseq, valueize);
9192 : 20 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1019, __FILE__, __LINE__, true);
9193 : 20 : return true;
9194 : : }
9195 : 4512 : next_after_fail1888:;
9196 : : }
9197 : : else
9198 : : {
9199 : 2246 : if (!canonicalize_math_p ()
9200 : : )
9201 : : {
9202 : 370 : {
9203 : 370 : tree utype = unsigned_type_for (type);
9204 : 370 : gimple_seq *lseq = seq;
9205 : 370 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1889;
9206 : 370 : {
9207 : 370 : res_op->set_op (COND_EXPR, type, 3);
9208 : 370 : {
9209 : 370 : tree _o1[2], _r1;
9210 : 370 : {
9211 : 370 : tree _o2[2], _r2;
9212 : 370 : {
9213 : 370 : tree _o3[1], _r3;
9214 : 370 : _o3[0] = captures[1];
9215 : 370 : if (utype != TREE_TYPE (_o3[0])
9216 : 370 : && !useless_type_conversion_p (utype, TREE_TYPE (_o3[0])))
9217 : : {
9218 : 370 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, utype, _o3[0]);
9219 : 370 : tem_op.resimplify (lseq, valueize);
9220 : 370 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
9221 : 370 : if (!_r3) goto next_after_fail1889;
9222 : : }
9223 : : else
9224 : : _r3 = _o3[0];
9225 : 106 : _o2[0] = _r3;
9226 : : }
9227 : 106 : _o2[1] = build_one_cst (utype);
9228 : 106 : gimple_match_op tem_op (res_op->cond.any_else (), PLUS_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
9229 : 106 : tem_op.resimplify (lseq, valueize);
9230 : 106 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
9231 : 106 : if (!_r2) goto next_after_fail1889;
9232 : 94 : _o1[0] = _r2;
9233 : : }
9234 : 94 : _o1[1] = build_int_cst (utype, 2);
9235 : 94 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, boolean_type_node, _o1[0], _o1[1]);
9236 : 94 : tem_op.resimplify (lseq, valueize);
9237 : 94 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
9238 : 94 : if (!_r1) goto next_after_fail1889;
9239 : 94 : res_op->ops[0] = _r1;
9240 : : }
9241 : 94 : res_op->ops[1] = captures[1];
9242 : 94 : res_op->ops[2] = build_zero_cst (type);
9243 : 94 : res_op->resimplify (lseq, valueize);
9244 : 94 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1020, __FILE__, __LINE__, true);
9245 : 94 : return true;
9246 : : }
9247 : 4512 : next_after_fail1889:;
9248 : : }
9249 : : }
9250 : : }
9251 : : }
9252 : : }
9253 : : }
9254 : 1419271 : switch (TREE_CODE (_p1))
9255 : : {
9256 : 521143 : case SSA_NAME:
9257 : 521143 : if (gimple *_d1 = get_def (valueize, _p1))
9258 : : {
9259 : 392236 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9260 : 400733 : switch (gimple_assign_rhs_code (_a1))
9261 : : {
9262 : 0 : case VEC_COND_EXPR:
9263 : 0 : {
9264 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
9265 : 0 : _q30 = do_valueize (valueize, _q30);
9266 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
9267 : 0 : _q31 = do_valueize (valueize, _q31);
9268 : 0 : tree _q32 = gimple_assign_rhs3 (_a1);
9269 : 0 : _q32 = do_valueize (valueize, _q32);
9270 : 0 : {
9271 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
9272 : 0 : if (TREE_CODE_CLASS (TRUNC_DIV_EXPR) != tcc_comparison
9273 : : || types_match (type, TREE_TYPE (captures[3]))
9274 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
9275 : : || (optimize_vectors_before_lowering_p ()
9276 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
9277 : : TREE_TYPE (captures[2]), ERROR_MARK))
9278 : : )
9279 : : {
9280 : 0 : gimple_seq *lseq = seq;
9281 : 0 : if (lseq
9282 : 0 : && (!single_use (captures[1])))
9283 : 0 : lseq = NULL;
9284 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1890;
9285 : 0 : {
9286 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
9287 : 0 : res_op->ops[0] = captures[2];
9288 : 0 : {
9289 : 0 : tree _o1[2], _r1;
9290 : 0 : _o1[0] = captures[0];
9291 : 0 : _o1[1] = captures[3];
9292 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9293 : 0 : tem_op.resimplify (NULL, valueize);
9294 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9295 : 0 : if (!_r1) goto next_after_fail1890;
9296 : 0 : res_op->ops[1] = _r1;
9297 : : }
9298 : 0 : {
9299 : 0 : tree _o1[2], _r1;
9300 : 0 : _o1[0] = captures[0];
9301 : 0 : _o1[1] = captures[4];
9302 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_DIV_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9303 : 0 : tem_op.resimplify (NULL, valueize);
9304 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9305 : 0 : if (!_r1) goto next_after_fail1890;
9306 : 0 : res_op->ops[2] = _r1;
9307 : : }
9308 : 0 : res_op->resimplify (lseq, valueize);
9309 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
9310 : 0 : return true;
9311 : : }
9312 : 0 : next_after_fail1890:;
9313 : : }
9314 : : }
9315 : 0 : break;
9316 : : }
9317 : : default:;
9318 : : }
9319 : : }
9320 : : break;
9321 : : default:;
9322 : : }
9323 : : return false;
9324 : : }
9325 : :
9326 : : bool
9327 : 8298 : gimple_simplify_FLOOR_MOD_EXPR (gimple_match_op *res_op, gimple_seq *seq,
9328 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
9329 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
9330 : : {
9331 : 8298 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
9332 : 8298 : {
9333 : 8298 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
9334 : 8298 : if (gimple_simplify_318 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR, TRUNC_MOD_EXPR))
9335 : 0 : return true;
9336 : : }
9337 : 8298 : if (integer_zerop (_p0))
9338 : : {
9339 : 9 : {
9340 : 9 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
9341 : 9 : if (gimple_simplify_319 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9342 : 9 : return true;
9343 : : }
9344 : : }
9345 : 8289 : if (integer_onep (_p1))
9346 : : {
9347 : 5 : {
9348 : 5 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
9349 : 5 : if (gimple_simplify_320 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9350 : 5 : return true;
9351 : : }
9352 : : }
9353 : 8284 : if (integer_minus_onep (_p1))
9354 : : {
9355 : 0 : {
9356 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
9357 : 0 : if (gimple_simplify_321 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9358 : 0 : return true;
9359 : : }
9360 : : }
9361 : 8284 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
9362 : : {
9363 : 0 : {
9364 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
9365 : 0 : if (gimple_simplify_322 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9366 : 0 : return true;
9367 : : }
9368 : : }
9369 : 8284 : switch (TREE_CODE (_p0))
9370 : : {
9371 : 7771 : case SSA_NAME:
9372 : 7771 : if (gimple *_d1 = get_def (valueize, _p0))
9373 : : {
9374 : 4411 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9375 : 3819 : switch (gimple_assign_rhs_code (_a1))
9376 : : {
9377 : 0 : case FLOOR_MOD_EXPR:
9378 : 0 : {
9379 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
9380 : 0 : _q20 = do_valueize (valueize, _q20);
9381 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
9382 : 0 : _q21 = do_valueize (valueize, _q21);
9383 : 0 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
9384 : : {
9385 : 0 : {
9386 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
9387 : 0 : if (gimple_simplify_323 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9388 : 0 : return true;
9389 : : }
9390 : : }
9391 : : break;
9392 : : }
9393 : 248 : case MULT_EXPR:
9394 : 248 : {
9395 : 248 : tree _q20 = gimple_assign_rhs1 (_a1);
9396 : 248 : _q20 = do_valueize (valueize, _q20);
9397 : 248 : tree _q21 = gimple_assign_rhs2 (_a1);
9398 : 248 : _q21 = do_valueize (valueize, _q21);
9399 : 248 : if (tree_swap_operands_p (_q20, _q21))
9400 : 0 : std::swap (_q20, _q21);
9401 : 248 : switch (TREE_CODE (_q21))
9402 : : {
9403 : 248 : case INTEGER_CST:
9404 : 248 : {
9405 : 248 : switch (TREE_CODE (_p1))
9406 : : {
9407 : 248 : case INTEGER_CST:
9408 : 248 : {
9409 : 248 : {
9410 : 248 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
9411 : 248 : if (gimple_simplify_324 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9412 : 0 : return true;
9413 : : }
9414 : 248 : break;
9415 : : }
9416 : : default:;
9417 : : }
9418 : : break;
9419 : : }
9420 : : default:;
9421 : : }
9422 : 8284 : break;
9423 : : }
9424 : : default:;
9425 : : }
9426 : : }
9427 : : break;
9428 : 8284 : default:;
9429 : : }
9430 : 8284 : switch (TREE_CODE (_p1))
9431 : : {
9432 : 1171 : case SSA_NAME:
9433 : 1171 : if (gimple *_d1 = get_def (valueize, _p1))
9434 : : {
9435 : 828 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9436 : 979 : switch (gimple_assign_rhs_code (_a1))
9437 : : {
9438 : 354 : CASE_CONVERT:
9439 : 354 : {
9440 : 354 : tree _q30 = gimple_assign_rhs1 (_a1);
9441 : 354 : _q30 = do_valueize (valueize, _q30);
9442 : 354 : {
9443 : 354 : tree _q30_pops[1];
9444 : 354 : if (gimple_power_of_two_cand (_q30, _q30_pops, valueize))
9445 : : {
9446 : 0 : tree _q40 = _q30_pops[0];
9447 : 0 : {
9448 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q40 };
9449 : 0 : if (gimple_simplify_325 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9450 : 0 : return true;
9451 : : }
9452 : : }
9453 : : }
9454 : 354 : break;
9455 : : }
9456 : : default:;
9457 : : }
9458 : : }
9459 : : break;
9460 : 8284 : default:;
9461 : : }
9462 : 8284 : {
9463 : 8284 : tree _p1_pops[1];
9464 : 8284 : if (gimple_power_of_two_cand (_p1, _p1_pops, valueize))
9465 : : {
9466 : 7014 : tree _q30 = _p1_pops[0];
9467 : 7014 : {
9468 : 7014 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p1, _q30 };
9469 : 7014 : if (gimple_simplify_325 (res_op, seq, valueize, type, captures, FLOOR_MOD_EXPR))
9470 : 12 : return true;
9471 : : }
9472 : : }
9473 : : }
9474 : 8272 : switch (TREE_CODE (_p0))
9475 : : {
9476 : 7759 : case SSA_NAME:
9477 : 7759 : if (gimple *_d1 = get_def (valueize, _p0))
9478 : : {
9479 : 4399 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9480 : 3807 : switch (gimple_assign_rhs_code (_a1))
9481 : : {
9482 : 0 : case VEC_COND_EXPR:
9483 : 0 : {
9484 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
9485 : 0 : _q20 = do_valueize (valueize, _q20);
9486 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
9487 : 0 : _q21 = do_valueize (valueize, _q21);
9488 : 0 : tree _q22 = gimple_assign_rhs3 (_a1);
9489 : 0 : _q22 = do_valueize (valueize, _q22);
9490 : 0 : switch (TREE_CODE (_p1))
9491 : : {
9492 : 0 : case SSA_NAME:
9493 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
9494 : : {
9495 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
9496 : 0 : switch (gimple_assign_rhs_code (_a2))
9497 : : {
9498 : 0 : case VEC_COND_EXPR:
9499 : 0 : {
9500 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
9501 : 0 : _q60 = do_valueize (valueize, _q60);
9502 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
9503 : 0 : _q61 = do_valueize (valueize, _q61);
9504 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
9505 : 0 : _q62 = do_valueize (valueize, _q62);
9506 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
9507 : : {
9508 : 0 : {
9509 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
9510 : 0 : if (TREE_CODE_CLASS (FLOOR_MOD_EXPR) != tcc_comparison
9511 : : || types_match (type, TREE_TYPE (captures[2]))
9512 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
9513 : : || (optimize_vectors_before_lowering_p ()
9514 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
9515 : : TREE_TYPE (captures[1]), ERROR_MARK))
9516 : : )
9517 : : {
9518 : 0 : gimple_seq *lseq = seq;
9519 : 0 : if (lseq
9520 : 0 : && (!single_use (captures[0])
9521 : 0 : || !single_use (captures[4])))
9522 : 0 : lseq = NULL;
9523 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1902;
9524 : 0 : {
9525 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
9526 : 0 : res_op->ops[0] = captures[1];
9527 : 0 : {
9528 : 0 : tree _o1[2], _r1;
9529 : 0 : _o1[0] = captures[2];
9530 : 0 : _o1[1] = captures[5];
9531 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), FLOOR_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9532 : 0 : tem_op.resimplify (NULL, valueize);
9533 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9534 : 0 : if (!_r1) goto next_after_fail1902;
9535 : 0 : res_op->ops[1] = _r1;
9536 : : }
9537 : 0 : {
9538 : 0 : tree _o1[2], _r1;
9539 : 0 : _o1[0] = captures[3];
9540 : 0 : _o1[1] = captures[6];
9541 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), FLOOR_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9542 : 0 : tem_op.resimplify (NULL, valueize);
9543 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9544 : 0 : if (!_r1) goto next_after_fail1902;
9545 : 0 : res_op->ops[2] = _r1;
9546 : : }
9547 : 0 : res_op->resimplify (lseq, valueize);
9548 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
9549 : 0 : return true;
9550 : : }
9551 : 0 : next_after_fail1902:;
9552 : : }
9553 : : }
9554 : : }
9555 : : break;
9556 : : }
9557 : : default:;
9558 : : }
9559 : : }
9560 : : break;
9561 : 0 : default:;
9562 : : }
9563 : 0 : {
9564 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
9565 : 0 : if (TREE_CODE_CLASS (FLOOR_MOD_EXPR) != tcc_comparison
9566 : : || types_match (type, TREE_TYPE (captures[2]))
9567 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
9568 : : || (optimize_vectors_before_lowering_p ()
9569 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
9570 : : TREE_TYPE (captures[1]), ERROR_MARK))
9571 : : )
9572 : : {
9573 : 0 : gimple_seq *lseq = seq;
9574 : 0 : if (lseq
9575 : 0 : && (!single_use (captures[0])))
9576 : 0 : lseq = NULL;
9577 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1903;
9578 : 0 : {
9579 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
9580 : 0 : res_op->ops[0] = captures[1];
9581 : 0 : {
9582 : 0 : tree _o1[2], _r1;
9583 : 0 : _o1[0] = captures[2];
9584 : 0 : _o1[1] = captures[4];
9585 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), FLOOR_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9586 : 0 : tem_op.resimplify (NULL, valueize);
9587 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9588 : 0 : if (!_r1) goto next_after_fail1903;
9589 : 0 : res_op->ops[1] = _r1;
9590 : : }
9591 : 0 : {
9592 : 0 : tree _o1[2], _r1;
9593 : 0 : _o1[0] = captures[3];
9594 : 0 : _o1[1] = captures[4];
9595 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), FLOOR_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9596 : 0 : tem_op.resimplify (NULL, valueize);
9597 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9598 : 0 : if (!_r1) goto next_after_fail1903;
9599 : 0 : res_op->ops[2] = _r1;
9600 : : }
9601 : 0 : res_op->resimplify (lseq, valueize);
9602 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
9603 : 0 : return true;
9604 : : }
9605 : 0 : next_after_fail1903:;
9606 : : }
9607 : : }
9608 : 0 : break;
9609 : : }
9610 : : default:;
9611 : : }
9612 : : }
9613 : : break;
9614 : 8272 : default:;
9615 : : }
9616 : 8272 : switch (TREE_CODE (_p1))
9617 : : {
9618 : 1171 : case SSA_NAME:
9619 : 1171 : if (gimple *_d1 = get_def (valueize, _p1))
9620 : : {
9621 : 828 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9622 : 979 : switch (gimple_assign_rhs_code (_a1))
9623 : : {
9624 : 0 : case VEC_COND_EXPR:
9625 : 0 : {
9626 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
9627 : 0 : _q30 = do_valueize (valueize, _q30);
9628 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
9629 : 0 : _q31 = do_valueize (valueize, _q31);
9630 : 0 : tree _q32 = gimple_assign_rhs3 (_a1);
9631 : 0 : _q32 = do_valueize (valueize, _q32);
9632 : 0 : {
9633 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
9634 : 0 : if (TREE_CODE_CLASS (FLOOR_MOD_EXPR) != tcc_comparison
9635 : : || types_match (type, TREE_TYPE (captures[3]))
9636 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
9637 : : || (optimize_vectors_before_lowering_p ()
9638 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
9639 : : TREE_TYPE (captures[2]), ERROR_MARK))
9640 : : )
9641 : : {
9642 : 0 : gimple_seq *lseq = seq;
9643 : 0 : if (lseq
9644 : 0 : && (!single_use (captures[1])))
9645 : 0 : lseq = NULL;
9646 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1904;
9647 : 0 : {
9648 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
9649 : 0 : res_op->ops[0] = captures[2];
9650 : 0 : {
9651 : 0 : tree _o1[2], _r1;
9652 : 0 : _o1[0] = captures[0];
9653 : 0 : _o1[1] = captures[3];
9654 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), FLOOR_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9655 : 0 : tem_op.resimplify (NULL, valueize);
9656 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9657 : 0 : if (!_r1) goto next_after_fail1904;
9658 : 0 : res_op->ops[1] = _r1;
9659 : : }
9660 : 0 : {
9661 : 0 : tree _o1[2], _r1;
9662 : 0 : _o1[0] = captures[0];
9663 : 0 : _o1[1] = captures[4];
9664 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), FLOOR_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
9665 : 0 : tem_op.resimplify (NULL, valueize);
9666 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
9667 : 0 : if (!_r1) goto next_after_fail1904;
9668 : 0 : res_op->ops[2] = _r1;
9669 : : }
9670 : 0 : res_op->resimplify (lseq, valueize);
9671 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
9672 : 0 : return true;
9673 : : }
9674 : 0 : next_after_fail1904:;
9675 : : }
9676 : : }
9677 : 0 : break;
9678 : : }
9679 : : default:;
9680 : : }
9681 : : }
9682 : : break;
9683 : : default:;
9684 : : }
9685 : : return false;
9686 : : }
9687 : :
9688 : : bool
9689 : 12048600 : gimple_simplify_LE_EXPR (gimple_match_op *res_op, gimple_seq *seq,
9690 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
9691 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
9692 : : {
9693 : 12048600 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
9694 : 12048600 : switch (TREE_CODE (_p0))
9695 : : {
9696 : 11558690 : case SSA_NAME:
9697 : 11558690 : if (gimple *_d1 = get_def (valueize, _p0))
9698 : : {
9699 : 3705973 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9700 : 3314942 : switch (gimple_assign_rhs_code (_a1))
9701 : : {
9702 : 11523 : case RDIV_EXPR:
9703 : 11523 : {
9704 : 11523 : tree _q20 = gimple_assign_rhs1 (_a1);
9705 : 11523 : _q20 = do_valueize (valueize, _q20);
9706 : 11523 : tree _q21 = gimple_assign_rhs2 (_a1);
9707 : 11523 : _q21 = do_valueize (valueize, _q21);
9708 : 11523 : switch (TREE_CODE (_q20))
9709 : : {
9710 : 4791 : case REAL_CST:
9711 : 4791 : {
9712 : 4791 : if (real_zerop (_p1))
9713 : : {
9714 : 0 : {
9715 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
9716 : 0 : if (gimple_simplify_336 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
9717 : 0 : return true;
9718 : : }
9719 : : }
9720 : : break;
9721 : : }
9722 : : default:;
9723 : : }
9724 : : break;
9725 : : }
9726 : : default:;
9727 : : }
9728 : : }
9729 : : break;
9730 : 12048600 : default:;
9731 : : }
9732 : 12048600 : switch (TREE_CODE (_p1))
9733 : : {
9734 : 2740595 : case SSA_NAME:
9735 : 2740595 : if (gimple *_d1 = get_def (valueize, _p1))
9736 : : {
9737 : 955025 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9738 : 1053850 : switch (gimple_assign_rhs_code (_a1))
9739 : : {
9740 : 159 : case TRUNC_MOD_EXPR:
9741 : 159 : {
9742 : 159 : tree _q30 = gimple_assign_rhs1 (_a1);
9743 : 159 : _q30 = do_valueize (valueize, _q30);
9744 : 159 : tree _q31 = gimple_assign_rhs2 (_a1);
9745 : 159 : _q31 = do_valueize (valueize, _q31);
9746 : 159 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
9747 : : {
9748 : 141 : {
9749 : 141 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _p0 };
9750 : 141 : if (gimple_simplify_337 (res_op, seq, valueize, type, captures, GE_EXPR))
9751 : 112 : return true;
9752 : : }
9753 : : }
9754 : : break;
9755 : : }
9756 : : default:;
9757 : : }
9758 : : }
9759 : : break;
9760 : 12048488 : default:;
9761 : : }
9762 : 12048488 : switch (TREE_CODE (_p0))
9763 : : {
9764 : 11558578 : case SSA_NAME:
9765 : 11558578 : if (gimple *_d1 = get_def (valueize, _p0))
9766 : : {
9767 : 3705861 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
9768 : 3314858 : switch (gimple_assign_rhs_code (_a1))
9769 : : {
9770 : 57978 : case MULT_EXPR:
9771 : 57978 : {
9772 : 57978 : tree _q20 = gimple_assign_rhs1 (_a1);
9773 : 57978 : _q20 = do_valueize (valueize, _q20);
9774 : 57978 : tree _q21 = gimple_assign_rhs2 (_a1);
9775 : 57978 : _q21 = do_valueize (valueize, _q21);
9776 : 57978 : if (tree_swap_operands_p (_q20, _q21))
9777 : 822 : std::swap (_q20, _q21);
9778 : 57978 : switch (TREE_CODE (_p1))
9779 : : {
9780 : 11172 : case SSA_NAME:
9781 : 11172 : if (gimple *_d2 = get_def (valueize, _p1))
9782 : : {
9783 : 10507 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
9784 : 11295 : switch (gimple_assign_rhs_code (_a2))
9785 : : {
9786 : 862 : case MULT_EXPR:
9787 : 862 : {
9788 : 862 : tree _q50 = gimple_assign_rhs1 (_a2);
9789 : 862 : _q50 = do_valueize (valueize, _q50);
9790 : 862 : tree _q51 = gimple_assign_rhs2 (_a2);
9791 : 862 : _q51 = do_valueize (valueize, _q51);
9792 : 862 : if (tree_swap_operands_p (_q50, _q51))
9793 : 4 : std::swap (_q50, _q51);
9794 : 862 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
9795 : : {
9796 : 367 : {
9797 : 367 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
9798 : 367 : if (gimple_simplify_338 (res_op, seq, valueize, type, captures, LE_EXPR))
9799 : 16 : return true;
9800 : : }
9801 : : }
9802 : 846 : if ((_q50 == _q21 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q21, 0) && types_match (_q50, _q21)))
9803 : : {
9804 : 0 : {
9805 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
9806 : 0 : if (gimple_simplify_338 (res_op, seq, valueize, type, captures, LE_EXPR))
9807 : 0 : return true;
9808 : : }
9809 : : }
9810 : 846 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q20, 0) && types_match (_q51, _q20)))
9811 : : {
9812 : 8 : {
9813 : 8 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q50 };
9814 : 8 : if (gimple_simplify_338 (res_op, seq, valueize, type, captures, LE_EXPR))
9815 : 0 : return true;
9816 : : }
9817 : : }
9818 : 846 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
9819 : : {
9820 : 100 : {
9821 : 100 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q51 };
9822 : 100 : if (gimple_simplify_338 (res_op, seq, valueize, type, captures, LE_EXPR))
9823 : 0 : return true;
9824 : : }
9825 : : }
9826 : 12043312 : break;
9827 : : }
9828 : : default:;
9829 : : }
9830 : : }
9831 : : break;
9832 : : default:;
9833 : : }
9834 : 12043312 : break;
9835 : : }
9836 : 683706 : case PLUS_EXPR:
9837 : 683706 : {
9838 : 683706 : tree _q20 = gimple_assign_rhs1 (_a1);
9839 : 683706 : _q20 = do_valueize (valueize, _q20);
9840 : 683706 : tree _q21 = gimple_assign_rhs2 (_a1);
9841 : 683706 : _q21 = do_valueize (valueize, _q21);
9842 : 683706 : if (tree_swap_operands_p (_q20, _q21))
9843 : 12814 : std::swap (_q20, _q21);
9844 : 683706 : if (integer_minus_onep (_q21))
9845 : : {
9846 : 152818 : switch (TREE_CODE (_p1))
9847 : : {
9848 : 121617 : case INTEGER_CST:
9849 : 121617 : {
9850 : 121617 : {
9851 : 121617 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
9852 : 121617 : if (gimple_simplify_363 (res_op, seq, valueize, type, captures, LE_EXPR, GT_EXPR))
9853 : 2 : return true;
9854 : : }
9855 : 121615 : break;
9856 : : }
9857 : : default:;
9858 : : }
9859 : : }
9860 : 683704 : switch (TREE_CODE (_p1))
9861 : : {
9862 : 155221 : case SSA_NAME:
9863 : 155221 : if (gimple *_d2 = get_def (valueize, _p1))
9864 : : {
9865 : 151070 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
9866 : 160284 : switch (gimple_assign_rhs_code (_a2))
9867 : : {
9868 : 34929 : case PLUS_EXPR:
9869 : 34929 : {
9870 : 34929 : tree _q50 = gimple_assign_rhs1 (_a2);
9871 : 34929 : _q50 = do_valueize (valueize, _q50);
9872 : 34929 : tree _q51 = gimple_assign_rhs2 (_a2);
9873 : 34929 : _q51 = do_valueize (valueize, _q51);
9874 : 34929 : if (tree_swap_operands_p (_q50, _q51))
9875 : 277 : std::swap (_q50, _q51);
9876 : 34929 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
9877 : : {
9878 : 3396 : {
9879 : 3396 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
9880 : 3396 : if (gimple_simplify_339 (res_op, seq, valueize, type, captures, LE_EXPR))
9881 : 1112 : return true;
9882 : : }
9883 : : }
9884 : 33817 : if ((_q50 == _q21 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q21, 0) && types_match (_q50, _q21)))
9885 : : {
9886 : 43 : {
9887 : 43 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
9888 : 43 : if (gimple_simplify_339 (res_op, seq, valueize, type, captures, LE_EXPR))
9889 : 7 : return true;
9890 : : }
9891 : : }
9892 : 33810 : if ((_q51 == _q20 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q20, 0) && types_match (_q51, _q20)))
9893 : : {
9894 : 357 : {
9895 : 357 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q50 };
9896 : 357 : if (gimple_simplify_339 (res_op, seq, valueize, type, captures, LE_EXPR))
9897 : 0 : return true;
9898 : : }
9899 : : }
9900 : 33810 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
9901 : : {
9902 : 1624 : {
9903 : 1624 : tree captures[3] ATTRIBUTE_UNUSED = { _q21, _q20, _q51 };
9904 : 1624 : if (gimple_simplify_339 (res_op, seq, valueize, type, captures, LE_EXPR))
9905 : 68 : return true;
9906 : : }
9907 : : }
9908 : 682517 : break;
9909 : : }
9910 : : default:;
9911 : : }
9912 : : }
9913 : : break;
9914 : 682517 : default:;
9915 : : }
9916 : 682517 : switch (TREE_CODE (_q21))
9917 : : {
9918 : 563104 : case INTEGER_CST:
9919 : 563104 : {
9920 : 563104 : switch (TREE_CODE (_p1))
9921 : : {
9922 : 95541 : case SSA_NAME:
9923 : 95541 : if (gimple *_d2 = get_def (valueize, _p1))
9924 : : {
9925 : 91878 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
9926 : 118721 : switch (gimple_assign_rhs_code (_a2))
9927 : : {
9928 : 25316 : case PLUS_EXPR:
9929 : 25316 : {
9930 : 25316 : tree _q50 = gimple_assign_rhs1 (_a2);
9931 : 25316 : _q50 = do_valueize (valueize, _q50);
9932 : 25316 : tree _q51 = gimple_assign_rhs2 (_a2);
9933 : 25316 : _q51 = do_valueize (valueize, _q51);
9934 : 25316 : if (tree_swap_operands_p (_q50, _q51))
9935 : 133 : std::swap (_q50, _q51);
9936 : 25316 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
9937 : : {
9938 : 2039 : {
9939 : 2039 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
9940 : 2039 : if (gimple_simplify_340 (res_op, seq, valueize, type, captures, LE_EXPR))
9941 : 0 : return true;
9942 : : }
9943 : : }
9944 : 682517 : break;
9945 : : }
9946 : : default:;
9947 : : }
9948 : : }
9949 : : break;
9950 : : default:;
9951 : : }
9952 : : break;
9953 : : }
9954 : 682517 : default:;
9955 : : }
9956 : 682517 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
9957 : : {
9958 : 18472 : {
9959 : 18472 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
9960 : 18472 : if (gimple_simplify_341 (res_op, seq, valueize, type, captures, LE_EXPR))
9961 : 728 : return true;
9962 : : }
9963 : : }
9964 : 681789 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
9965 : : {
9966 : 1989 : {
9967 : 1989 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q21, _q20 };
9968 : 1989 : if (gimple_simplify_341 (res_op, seq, valueize, type, captures, LE_EXPR))
9969 : 0 : return true;
9970 : : }
9971 : : }
9972 : 12043312 : break;
9973 : : }
9974 : 529449 : CASE_CONVERT:
9975 : 529449 : {
9976 : 529449 : tree _q20 = gimple_assign_rhs1 (_a1);
9977 : 529449 : _q20 = do_valueize (valueize, _q20);
9978 : 529449 : switch (TREE_CODE (_q20))
9979 : : {
9980 : 529249 : case SSA_NAME:
9981 : 529249 : if (gimple *_d2 = get_def (valueize, _q20))
9982 : : {
9983 : 510964 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
9984 : 524550 : switch (gimple_assign_rhs_code (_a2))
9985 : : {
9986 : 5790 : case EXACT_DIV_EXPR:
9987 : 5790 : {
9988 : 5790 : tree _q30 = gimple_assign_rhs1 (_a2);
9989 : 5790 : _q30 = do_valueize (valueize, _q30);
9990 : 5790 : tree _q31 = gimple_assign_rhs2 (_a2);
9991 : 5790 : _q31 = do_valueize (valueize, _q31);
9992 : 5790 : switch (TREE_CODE (_q31))
9993 : : {
9994 : 5790 : case INTEGER_CST:
9995 : 5790 : {
9996 : 5790 : switch (TREE_CODE (_p1))
9997 : : {
9998 : 4615 : case SSA_NAME:
9999 : 4615 : if (gimple *_d3 = get_def (valueize, _p1))
10000 : : {
10001 : 4615 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
10002 : 4751 : switch (gimple_assign_rhs_code (_a3))
10003 : : {
10004 : 907 : CASE_CONVERT:
10005 : 907 : {
10006 : 907 : tree _q60 = gimple_assign_rhs1 (_a3);
10007 : 907 : _q60 = do_valueize (valueize, _q60);
10008 : 907 : switch (TREE_CODE (_q60))
10009 : : {
10010 : 907 : case SSA_NAME:
10011 : 907 : if (gimple *_d4 = get_def (valueize, _q60))
10012 : : {
10013 : 907 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
10014 : 907 : switch (gimple_assign_rhs_code (_a4))
10015 : : {
10016 : 907 : case EXACT_DIV_EXPR:
10017 : 907 : {
10018 : 907 : tree _q70 = gimple_assign_rhs1 (_a4);
10019 : 907 : _q70 = do_valueize (valueize, _q70);
10020 : 907 : tree _q71 = gimple_assign_rhs2 (_a4);
10021 : 907 : _q71 = do_valueize (valueize, _q71);
10022 : 907 : if ((_q71 == _q31 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q31, 0) && types_match (_q71, _q31)))
10023 : : {
10024 : 883 : {
10025 : 883 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q30, _q31, _q70 };
10026 : 883 : if (gimple_simplify_209 (res_op, seq, valueize, type, captures, LE_EXPR))
10027 : 248 : return true;
10028 : : }
10029 : : }
10030 : : break;
10031 : : }
10032 : : default:;
10033 : : }
10034 : : }
10035 : : break;
10036 : : default:;
10037 : : }
10038 : : break;
10039 : : }
10040 : : default:;
10041 : : }
10042 : : }
10043 : : break;
10044 : : default:;
10045 : : }
10046 : : break;
10047 : : }
10048 : : default:;
10049 : : }
10050 : : break;
10051 : : }
10052 : : default:;
10053 : : }
10054 : : }
10055 : : break;
10056 : : default:;
10057 : : }
10058 : : break;
10059 : : }
10060 : 2344 : case EXACT_DIV_EXPR:
10061 : 2344 : {
10062 : 2344 : tree _q20 = gimple_assign_rhs1 (_a1);
10063 : 2344 : _q20 = do_valueize (valueize, _q20);
10064 : 2344 : tree _q21 = gimple_assign_rhs2 (_a1);
10065 : 2344 : _q21 = do_valueize (valueize, _q21);
10066 : 2344 : switch (TREE_CODE (_q21))
10067 : : {
10068 : 2344 : case INTEGER_CST:
10069 : 2344 : {
10070 : 2344 : switch (TREE_CODE (_p1))
10071 : : {
10072 : 58 : case SSA_NAME:
10073 : 58 : if (gimple *_d2 = get_def (valueize, _p1))
10074 : : {
10075 : 56 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10076 : 40 : switch (gimple_assign_rhs_code (_a2))
10077 : : {
10078 : 20 : case EXACT_DIV_EXPR:
10079 : 20 : {
10080 : 20 : tree _q50 = gimple_assign_rhs1 (_a2);
10081 : 20 : _q50 = do_valueize (valueize, _q50);
10082 : 20 : tree _q51 = gimple_assign_rhs2 (_a2);
10083 : 20 : _q51 = do_valueize (valueize, _q51);
10084 : 20 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
10085 : : {
10086 : 20 : {
10087 : 20 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q50 };
10088 : 20 : if (gimple_simplify_209 (res_op, seq, valueize, type, captures, LE_EXPR))
10089 : 20 : return true;
10090 : : }
10091 : : }
10092 : : break;
10093 : : }
10094 : : default:;
10095 : : }
10096 : : }
10097 : : break;
10098 : : default:;
10099 : : }
10100 : : break;
10101 : : }
10102 : : default:;
10103 : : }
10104 : : break;
10105 : : }
10106 : 13025 : case TRUNC_DIV_EXPR:
10107 : 13025 : {
10108 : 13025 : tree _q20 = gimple_assign_rhs1 (_a1);
10109 : 13025 : _q20 = do_valueize (valueize, _q20);
10110 : 13025 : tree _q21 = gimple_assign_rhs2 (_a1);
10111 : 13025 : _q21 = do_valueize (valueize, _q21);
10112 : 13025 : switch (TREE_CODE (_q21))
10113 : : {
10114 : 4109 : case INTEGER_CST:
10115 : 4109 : {
10116 : 4109 : switch (TREE_CODE (_p1))
10117 : : {
10118 : 2775 : case INTEGER_CST:
10119 : 2775 : {
10120 : 2775 : {
10121 : 2775 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
10122 : 2775 : if (gimple_simplify_212 (res_op, seq, valueize, type, captures, LE_EXPR))
10123 : 2775 : return true;
10124 : : }
10125 : 0 : break;
10126 : : }
10127 : : default:;
10128 : : }
10129 : : break;
10130 : : }
10131 : : default:;
10132 : : }
10133 : : break;
10134 : : }
10135 : 181558 : case MINUS_EXPR:
10136 : 181558 : {
10137 : 181558 : tree _q20 = gimple_assign_rhs1 (_a1);
10138 : 181558 : _q20 = do_valueize (valueize, _q20);
10139 : 181558 : tree _q21 = gimple_assign_rhs2 (_a1);
10140 : 181558 : _q21 = do_valueize (valueize, _q21);
10141 : 181558 : switch (TREE_CODE (_p1))
10142 : : {
10143 : 30210 : case SSA_NAME:
10144 : 30210 : if (gimple *_d2 = get_def (valueize, _p1))
10145 : : {
10146 : 29963 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10147 : 32414 : switch (gimple_assign_rhs_code (_a2))
10148 : : {
10149 : 1114 : case MINUS_EXPR:
10150 : 1114 : {
10151 : 1114 : tree _q50 = gimple_assign_rhs1 (_a2);
10152 : 1114 : _q50 = do_valueize (valueize, _q50);
10153 : 1114 : tree _q51 = gimple_assign_rhs2 (_a2);
10154 : 1114 : _q51 = do_valueize (valueize, _q51);
10155 : 1114 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
10156 : : {
10157 : 307 : {
10158 : 307 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q50 };
10159 : 307 : if (gimple_simplify_342 (res_op, seq, valueize, type, captures, LE_EXPR))
10160 : 0 : return true;
10161 : : }
10162 : : }
10163 : 1114 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
10164 : : {
10165 : 286 : {
10166 : 286 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _q51 };
10167 : 286 : if (gimple_simplify_343 (res_op, seq, valueize, type, captures, LE_EXPR))
10168 : 200 : return true;
10169 : : }
10170 : : }
10171 : : break;
10172 : : }
10173 : : default:;
10174 : : }
10175 : : }
10176 : : break;
10177 : : default:;
10178 : : }
10179 : : break;
10180 : : }
10181 : 16498 : case POINTER_DIFF_EXPR:
10182 : 16498 : {
10183 : 16498 : tree _q20 = gimple_assign_rhs1 (_a1);
10184 : 16498 : _q20 = do_valueize (valueize, _q20);
10185 : 16498 : tree _q21 = gimple_assign_rhs2 (_a1);
10186 : 16498 : _q21 = do_valueize (valueize, _q21);
10187 : 16498 : switch (TREE_CODE (_p1))
10188 : : {
10189 : 288 : case SSA_NAME:
10190 : 288 : if (gimple *_d2 = get_def (valueize, _p1))
10191 : : {
10192 : 238 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10193 : 116 : switch (gimple_assign_rhs_code (_a2))
10194 : : {
10195 : 43 : case POINTER_DIFF_EXPR:
10196 : 43 : {
10197 : 43 : tree _q50 = gimple_assign_rhs1 (_a2);
10198 : 43 : _q50 = do_valueize (valueize, _q50);
10199 : 43 : tree _q51 = gimple_assign_rhs2 (_a2);
10200 : 43 : _q51 = do_valueize (valueize, _q51);
10201 : 43 : if ((_q51 == _q21 && ! TREE_SIDE_EFFECTS (_q51)) || (operand_equal_p (_q51, _q21, 0) && types_match (_q51, _q21)))
10202 : : {
10203 : 0 : {
10204 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q50 };
10205 : 0 : if (gimple_simplify_216 (res_op, seq, valueize, type, captures, LE_EXPR))
10206 : 0 : return true;
10207 : : }
10208 : : }
10209 : 43 : if ((_q50 == _q20 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _q20, 0) && types_match (_q50, _q20)))
10210 : : {
10211 : 0 : {
10212 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q51 };
10213 : 0 : if (gimple_simplify_217 (res_op, seq, valueize, type, captures, LE_EXPR))
10214 : 0 : return true;
10215 : : }
10216 : : }
10217 : : break;
10218 : : }
10219 : : default:;
10220 : : }
10221 : : }
10222 : : break;
10223 : : default:;
10224 : : }
10225 : : break;
10226 : : }
10227 : : default:;
10228 : : }
10229 : : }
10230 : : break;
10231 : 12043312 : default:;
10232 : : }
10233 : 12043312 : switch (TREE_CODE (_p1))
10234 : : {
10235 : 2738812 : case SSA_NAME:
10236 : 2738812 : if (gimple *_d1 = get_def (valueize, _p1))
10237 : : {
10238 : 953242 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10239 : 1052067 : switch (gimple_assign_rhs_code (_a1))
10240 : : {
10241 : 196345 : case PLUS_EXPR:
10242 : 196345 : {
10243 : 196345 : tree _q30 = gimple_assign_rhs1 (_a1);
10244 : 196345 : _q30 = do_valueize (valueize, _q30);
10245 : 196345 : tree _q31 = gimple_assign_rhs2 (_a1);
10246 : 196345 : _q31 = do_valueize (valueize, _q31);
10247 : 196345 : if (tree_swap_operands_p (_q30, _q31))
10248 : 1604 : std::swap (_q30, _q31);
10249 : 196345 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
10250 : : {
10251 : 3521 : {
10252 : 3521 : tree captures[3] ATTRIBUTE_UNUSED = { _p1, _q30, _p0 };
10253 : 3521 : if (gimple_simplify_341 (res_op, seq, valueize, type, captures, GE_EXPR))
10254 : 0 : return true;
10255 : : }
10256 : : }
10257 : 196345 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
10258 : : {
10259 : 12791 : {
10260 : 12791 : tree captures[3] ATTRIBUTE_UNUSED = { _p1, _q31, _p0 };
10261 : 12791 : if (gimple_simplify_341 (res_op, seq, valueize, type, captures, GE_EXPR))
10262 : 25 : return true;
10263 : : }
10264 : : }
10265 : 12043287 : break;
10266 : : }
10267 : 16888 : case MINUS_EXPR:
10268 : 16888 : {
10269 : 16888 : tree _q30 = gimple_assign_rhs1 (_a1);
10270 : 16888 : _q30 = do_valueize (valueize, _q30);
10271 : 16888 : tree _q31 = gimple_assign_rhs2 (_a1);
10272 : 16888 : _q31 = do_valueize (valueize, _q31);
10273 : 16888 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
10274 : : {
10275 : 157 : {
10276 : 157 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p1, _q31 };
10277 : 157 : if (gimple_simplify_215 (res_op, seq, valueize, type, captures, LE_EXPR))
10278 : 0 : return true;
10279 : : }
10280 : : }
10281 : : break;
10282 : : }
10283 : : default:;
10284 : : }
10285 : : }
10286 : : break;
10287 : 12043287 : default:;
10288 : : }
10289 : 12043287 : switch (TREE_CODE (_p0))
10290 : : {
10291 : 11553377 : case SSA_NAME:
10292 : 11553377 : if (gimple *_d1 = get_def (valueize, _p0))
10293 : : {
10294 : 3700660 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10295 : 3309640 : switch (gimple_assign_rhs_code (_a1))
10296 : : {
10297 : 181358 : case MINUS_EXPR:
10298 : 181358 : {
10299 : 181358 : tree _q20 = gimple_assign_rhs1 (_a1);
10300 : 181358 : _q20 = do_valueize (valueize, _q20);
10301 : 181358 : tree _q21 = gimple_assign_rhs2 (_a1);
10302 : 181358 : _q21 = do_valueize (valueize, _q21);
10303 : 181358 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
10304 : : {
10305 : 2945 : {
10306 : 2945 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _p0, _q21 };
10307 : 2945 : if (gimple_simplify_215 (res_op, seq, valueize, type, captures, GE_EXPR))
10308 : 0 : return true;
10309 : : }
10310 : : }
10311 : : break;
10312 : : }
10313 : 15202 : case BIT_AND_EXPR:
10314 : 15202 : {
10315 : 15202 : tree _q20 = gimple_assign_rhs1 (_a1);
10316 : 15202 : _q20 = do_valueize (valueize, _q20);
10317 : 15202 : tree _q21 = gimple_assign_rhs2 (_a1);
10318 : 15202 : _q21 = do_valueize (valueize, _q21);
10319 : 15202 : if (tree_swap_operands_p (_q20, _q21))
10320 : 30 : std::swap (_q20, _q21);
10321 : 15202 : if (tree_expr_nonnegative_p (_q20))
10322 : : {
10323 : 13610 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
10324 : : {
10325 : 0 : {
10326 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
10327 : 0 : if (gimple_simplify_344 (res_op, seq, valueize, type, captures, LE_EXPR, BIT_AND_EXPR))
10328 : 0 : return true;
10329 : : }
10330 : : }
10331 : : }
10332 : 15202 : if (tree_expr_nonnegative_p (_q21))
10333 : : {
10334 : 14786 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
10335 : : {
10336 : 2282 : {
10337 : 2282 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
10338 : 2282 : if (gimple_simplify_344 (res_op, seq, valueize, type, captures, LE_EXPR, BIT_AND_EXPR))
10339 : 2282 : return true;
10340 : : }
10341 : : }
10342 : : }
10343 : 12041005 : break;
10344 : : }
10345 : : default:;
10346 : : }
10347 : : }
10348 : : break;
10349 : 12041005 : default:;
10350 : : }
10351 : 12041005 : switch (TREE_CODE (_p1))
10352 : : {
10353 : 2738787 : case SSA_NAME:
10354 : 2738787 : if (gimple *_d1 = get_def (valueize, _p1))
10355 : : {
10356 : 953217 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10357 : 1052042 : switch (gimple_assign_rhs_code (_a1))
10358 : : {
10359 : 244 : case BIT_IOR_EXPR:
10360 : 244 : {
10361 : 244 : tree _q30 = gimple_assign_rhs1 (_a1);
10362 : 244 : _q30 = do_valueize (valueize, _q30);
10363 : 244 : tree _q31 = gimple_assign_rhs2 (_a1);
10364 : 244 : _q31 = do_valueize (valueize, _q31);
10365 : 244 : if (tree_swap_operands_p (_q30, _q31))
10366 : 3 : std::swap (_q30, _q31);
10367 : 244 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
10368 : : {
10369 : 18 : if (tree_expr_nonnegative_p (_q30))
10370 : : {
10371 : 3 : {
10372 : 3 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
10373 : 3 : if (gimple_simplify_344 (res_op, seq, valueize, type, captures, GE_EXPR, BIT_IOR_EXPR))
10374 : 3 : return true;
10375 : : }
10376 : : }
10377 : : }
10378 : 241 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
10379 : : {
10380 : 0 : if (tree_expr_nonnegative_p (_q31))
10381 : : {
10382 : 0 : {
10383 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
10384 : 0 : if (gimple_simplify_344 (res_op, seq, valueize, type, captures, GE_EXPR, BIT_IOR_EXPR))
10385 : 0 : return true;
10386 : : }
10387 : : }
10388 : : }
10389 : 12041002 : break;
10390 : : }
10391 : : default:;
10392 : : }
10393 : : }
10394 : : break;
10395 : 12041002 : default:;
10396 : : }
10397 : 12041002 : switch (TREE_CODE (_p0))
10398 : : {
10399 : 11551092 : case SSA_NAME:
10400 : 11551092 : if (gimple *_d1 = get_def (valueize, _p0))
10401 : : {
10402 : 3698375 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10403 : 3307356 : switch (gimple_assign_rhs_code (_a1))
10404 : : {
10405 : 12596 : case MAX_EXPR:
10406 : 12596 : {
10407 : 12596 : tree _q20 = gimple_assign_rhs1 (_a1);
10408 : 12596 : _q20 = do_valueize (valueize, _q20);
10409 : 12596 : tree _q21 = gimple_assign_rhs2 (_a1);
10410 : 12596 : _q21 = do_valueize (valueize, _q21);
10411 : 12596 : if (tree_swap_operands_p (_q20, _q21))
10412 : 21 : std::swap (_q20, _q21);
10413 : 12596 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
10414 : : {
10415 : 0 : {
10416 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
10417 : 0 : if (gimple_simplify_225 (res_op, seq, valueize, type, captures, MAX_EXPR, LE_EXPR, GE_EXPR))
10418 : 0 : return true;
10419 : : }
10420 : : }
10421 : 12596 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
10422 : : {
10423 : 2864 : {
10424 : 2864 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
10425 : 2864 : if (gimple_simplify_225 (res_op, seq, valueize, type, captures, MAX_EXPR, LE_EXPR, GE_EXPR))
10426 : 2864 : return true;
10427 : : }
10428 : : }
10429 : 9732 : switch (TREE_CODE (_q21))
10430 : : {
10431 : 9414 : case INTEGER_CST:
10432 : 9414 : {
10433 : 9414 : switch (TREE_CODE (_p1))
10434 : : {
10435 : 2434 : case INTEGER_CST:
10436 : 2434 : {
10437 : 2434 : {
10438 : 2434 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
10439 : 2434 : if (gimple_simplify_345 (res_op, seq, valueize, type, captures, MAX_EXPR, LE_EXPR, BIT_AND_EXPR))
10440 : 258 : return true;
10441 : : }
10442 : 2176 : break;
10443 : : }
10444 : : default:;
10445 : : }
10446 : : break;
10447 : : }
10448 : : default:;
10449 : : }
10450 : 12037880 : break;
10451 : : }
10452 : : default:;
10453 : : }
10454 : : }
10455 : : break;
10456 : 12037880 : default:;
10457 : : }
10458 : 12037880 : switch (TREE_CODE (_p1))
10459 : : {
10460 : 2738784 : case SSA_NAME:
10461 : 2738784 : if (gimple *_d1 = get_def (valueize, _p1))
10462 : : {
10463 : 953214 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10464 : 1052039 : switch (gimple_assign_rhs_code (_a1))
10465 : : {
10466 : 19838 : case MIN_EXPR:
10467 : 19838 : {
10468 : 19838 : tree _q30 = gimple_assign_rhs1 (_a1);
10469 : 19838 : _q30 = do_valueize (valueize, _q30);
10470 : 19838 : tree _q31 = gimple_assign_rhs2 (_a1);
10471 : 19838 : _q31 = do_valueize (valueize, _q31);
10472 : 19838 : if (tree_swap_operands_p (_q30, _q31))
10473 : 47 : std::swap (_q30, _q31);
10474 : 19838 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
10475 : : {
10476 : 12 : {
10477 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
10478 : 12 : if (gimple_simplify_225 (res_op, seq, valueize, type, captures, MIN_EXPR, GE_EXPR, LE_EXPR))
10479 : 12 : return true;
10480 : : }
10481 : : }
10482 : 19826 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
10483 : : {
10484 : 16 : {
10485 : 16 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
10486 : 16 : if (gimple_simplify_225 (res_op, seq, valueize, type, captures, MIN_EXPR, GE_EXPR, LE_EXPR))
10487 : 16 : return true;
10488 : : }
10489 : : }
10490 : 12037843 : break;
10491 : : }
10492 : 358 : case MAX_EXPR:
10493 : 358 : {
10494 : 358 : tree _q30 = gimple_assign_rhs1 (_a1);
10495 : 358 : _q30 = do_valueize (valueize, _q30);
10496 : 358 : tree _q31 = gimple_assign_rhs2 (_a1);
10497 : 358 : _q31 = do_valueize (valueize, _q31);
10498 : 358 : if (tree_swap_operands_p (_q30, _q31))
10499 : 12 : std::swap (_q30, _q31);
10500 : 358 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
10501 : : {
10502 : 2 : {
10503 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q31 };
10504 : 2 : if (gimple_simplify_346 (res_op, seq, valueize, type, captures, MAX_EXPR, LE_EXPR))
10505 : 2 : return true;
10506 : : }
10507 : : }
10508 : 356 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
10509 : : {
10510 : 7 : {
10511 : 7 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
10512 : 7 : if (gimple_simplify_346 (res_op, seq, valueize, type, captures, MAX_EXPR, LE_EXPR))
10513 : 7 : return true;
10514 : : }
10515 : : }
10516 : 12037843 : break;
10517 : : }
10518 : : default:;
10519 : : }
10520 : : }
10521 : : break;
10522 : 12037843 : default:;
10523 : : }
10524 : 12037843 : switch (TREE_CODE (_p0))
10525 : : {
10526 : 11547933 : case SSA_NAME:
10527 : 11547933 : if (gimple *_d1 = get_def (valueize, _p0))
10528 : : {
10529 : 3695216 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10530 : 3304222 : switch (gimple_assign_rhs_code (_a1))
10531 : : {
10532 : 10377 : case MIN_EXPR:
10533 : 10377 : {
10534 : 10377 : tree _q20 = gimple_assign_rhs1 (_a1);
10535 : 10377 : _q20 = do_valueize (valueize, _q20);
10536 : 10377 : tree _q21 = gimple_assign_rhs2 (_a1);
10537 : 10377 : _q21 = do_valueize (valueize, _q21);
10538 : 10377 : if (tree_swap_operands_p (_q20, _q21))
10539 : 975 : std::swap (_q20, _q21);
10540 : 10377 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
10541 : : {
10542 : 0 : {
10543 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
10544 : 0 : if (gimple_simplify_346 (res_op, seq, valueize, type, captures, MIN_EXPR, GE_EXPR))
10545 : 0 : return true;
10546 : : }
10547 : : }
10548 : 10377 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
10549 : : {
10550 : 131 : {
10551 : 131 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
10552 : 131 : if (gimple_simplify_346 (res_op, seq, valueize, type, captures, MIN_EXPR, GE_EXPR))
10553 : 131 : return true;
10554 : : }
10555 : : }
10556 : 10246 : switch (TREE_CODE (_q21))
10557 : : {
10558 : 2593 : case INTEGER_CST:
10559 : 2593 : {
10560 : 2593 : switch (TREE_CODE (_p1))
10561 : : {
10562 : 995 : case INTEGER_CST:
10563 : 995 : {
10564 : 995 : {
10565 : 995 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
10566 : 995 : if (gimple_simplify_345 (res_op, seq, valueize, type, captures, MIN_EXPR, LE_EXPR, BIT_IOR_EXPR))
10567 : 123 : return true;
10568 : : }
10569 : 872 : break;
10570 : : }
10571 : : default:;
10572 : : }
10573 : : break;
10574 : : }
10575 : : default:;
10576 : : }
10577 : 12037581 : break;
10578 : : }
10579 : 10 : case VEC_COND_EXPR:
10580 : 10 : {
10581 : 10 : tree _q20 = gimple_assign_rhs1 (_a1);
10582 : 10 : _q20 = do_valueize (valueize, _q20);
10583 : 10 : tree _q21 = gimple_assign_rhs2 (_a1);
10584 : 10 : _q21 = do_valueize (valueize, _q21);
10585 : 10 : tree _q22 = gimple_assign_rhs3 (_a1);
10586 : 10 : _q22 = do_valueize (valueize, _q22);
10587 : 10 : switch (TREE_CODE (_p1))
10588 : : {
10589 : 2 : case SSA_NAME:
10590 : 2 : if (gimple *_d2 = get_def (valueize, _p1))
10591 : : {
10592 : 2 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10593 : 2 : switch (gimple_assign_rhs_code (_a2))
10594 : : {
10595 : 2 : case VEC_COND_EXPR:
10596 : 2 : {
10597 : 2 : tree _q60 = gimple_assign_rhs1 (_a2);
10598 : 2 : _q60 = do_valueize (valueize, _q60);
10599 : 2 : tree _q61 = gimple_assign_rhs2 (_a2);
10600 : 2 : _q61 = do_valueize (valueize, _q61);
10601 : 2 : tree _q62 = gimple_assign_rhs3 (_a2);
10602 : 2 : _q62 = do_valueize (valueize, _q62);
10603 : 2 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
10604 : : {
10605 : 0 : {
10606 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
10607 : 0 : if (TREE_CODE_CLASS (LE_EXPR) != tcc_comparison
10608 : 0 : || types_match (type, TREE_TYPE (captures[2]))
10609 : 0 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
10610 : : || (optimize_vectors_before_lowering_p ()
10611 : 0 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
10612 : 0 : TREE_TYPE (captures[1]), ERROR_MARK))
10613 : : )
10614 : : {
10615 : 0 : gimple_seq *lseq = seq;
10616 : 0 : if (lseq
10617 : 0 : && (!single_use (captures[0])
10618 : 0 : || !single_use (captures[4])))
10619 : 0 : lseq = NULL;
10620 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1947;
10621 : 0 : {
10622 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
10623 : 0 : res_op->ops[0] = captures[1];
10624 : 0 : {
10625 : 0 : tree _o1[2], _r1;
10626 : 0 : _o1[0] = captures[2];
10627 : 0 : _o1[1] = captures[5];
10628 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
10629 : 0 : tem_op.resimplify (NULL, valueize);
10630 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
10631 : 0 : if (!_r1) goto next_after_fail1947;
10632 : 0 : res_op->ops[1] = _r1;
10633 : : }
10634 : 0 : {
10635 : 0 : tree _o1[2], _r1;
10636 : 0 : _o1[0] = captures[3];
10637 : 0 : _o1[1] = captures[6];
10638 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
10639 : 0 : tem_op.resimplify (NULL, valueize);
10640 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
10641 : 0 : if (!_r1) goto next_after_fail1947;
10642 : 0 : res_op->ops[2] = _r1;
10643 : : }
10644 : 0 : res_op->resimplify (lseq, valueize);
10645 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
10646 : 0 : return true;
10647 : : }
10648 : 0 : next_after_fail1947:;
10649 : : }
10650 : : }
10651 : : }
10652 : : break;
10653 : : }
10654 : : default:;
10655 : : }
10656 : : }
10657 : : break;
10658 : 10 : default:;
10659 : : }
10660 : 10 : {
10661 : 10 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
10662 : 10 : if (TREE_CODE_CLASS (LE_EXPR) != tcc_comparison
10663 : 10 : || types_match (type, TREE_TYPE (captures[2]))
10664 : 10 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
10665 : : || (optimize_vectors_before_lowering_p ()
10666 : 4 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
10667 : 4 : TREE_TYPE (captures[1]), ERROR_MARK))
10668 : : )
10669 : : {
10670 : 10 : gimple_seq *lseq = seq;
10671 : 10 : if (lseq
10672 : 1 : && (!single_use (captures[0])))
10673 : 9 : lseq = NULL;
10674 : 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1948;
10675 : 10 : {
10676 : 10 : res_op->set_op (VEC_COND_EXPR, type, 3);
10677 : 10 : res_op->ops[0] = captures[1];
10678 : 10 : {
10679 : 10 : tree _o1[2], _r1;
10680 : 10 : _o1[0] = captures[2];
10681 : 10 : _o1[1] = captures[4];
10682 : 10 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
10683 : 10 : tem_op.resimplify (NULL, valueize);
10684 : 10 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
10685 : 10 : if (!_r1) goto next_after_fail1948;
10686 : 10 : res_op->ops[1] = _r1;
10687 : : }
10688 : 10 : {
10689 : 10 : tree _o1[2], _r1;
10690 : 10 : _o1[0] = captures[3];
10691 : 10 : _o1[1] = captures[4];
10692 : 10 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
10693 : 10 : tem_op.resimplify (NULL, valueize);
10694 : 10 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
10695 : 10 : if (!_r1) goto next_after_fail1948;
10696 : 8 : res_op->ops[2] = _r1;
10697 : : }
10698 : 8 : res_op->resimplify (lseq, valueize);
10699 : 8 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
10700 : 8 : return true;
10701 : : }
10702 : 2 : next_after_fail1948:;
10703 : : }
10704 : : }
10705 : 2 : break;
10706 : : }
10707 : : default:;
10708 : : }
10709 : : }
10710 : : break;
10711 : 12037581 : default:;
10712 : : }
10713 : 12037581 : switch (TREE_CODE (_p1))
10714 : : {
10715 : 2738686 : case SSA_NAME:
10716 : 2738686 : if (gimple *_d1 = get_def (valueize, _p1))
10717 : : {
10718 : 953116 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10719 : 1051926 : switch (gimple_assign_rhs_code (_a1))
10720 : : {
10721 : 2 : case VEC_COND_EXPR:
10722 : 2 : {
10723 : 2 : tree _q30 = gimple_assign_rhs1 (_a1);
10724 : 2 : _q30 = do_valueize (valueize, _q30);
10725 : 2 : tree _q31 = gimple_assign_rhs2 (_a1);
10726 : 2 : _q31 = do_valueize (valueize, _q31);
10727 : 2 : tree _q32 = gimple_assign_rhs3 (_a1);
10728 : 2 : _q32 = do_valueize (valueize, _q32);
10729 : 2 : {
10730 : 2 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
10731 : 2 : if (TREE_CODE_CLASS (LE_EXPR) != tcc_comparison
10732 : 2 : || types_match (type, TREE_TYPE (captures[3]))
10733 : 2 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
10734 : : || (optimize_vectors_before_lowering_p ()
10735 : 0 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
10736 : 0 : TREE_TYPE (captures[2]), ERROR_MARK))
10737 : : )
10738 : : {
10739 : 2 : gimple_seq *lseq = seq;
10740 : 2 : if (lseq
10741 : 1 : && (!single_use (captures[1])))
10742 : 1 : lseq = NULL;
10743 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1949;
10744 : 2 : {
10745 : 2 : res_op->set_op (VEC_COND_EXPR, type, 3);
10746 : 2 : res_op->ops[0] = captures[2];
10747 : 2 : {
10748 : 2 : tree _o1[2], _r1;
10749 : 2 : _o1[0] = captures[0];
10750 : 2 : _o1[1] = captures[3];
10751 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
10752 : 2 : tem_op.resimplify (NULL, valueize);
10753 : 2 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
10754 : 2 : if (!_r1) goto next_after_fail1949;
10755 : 2 : res_op->ops[1] = _r1;
10756 : : }
10757 : 2 : {
10758 : 2 : tree _o1[2], _r1;
10759 : 2 : _o1[0] = captures[0];
10760 : 2 : _o1[1] = captures[4];
10761 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), LE_EXPR, type, _o1[0], _o1[1]);
10762 : 2 : tem_op.resimplify (NULL, valueize);
10763 : 2 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
10764 : 2 : if (!_r1) goto next_after_fail1949;
10765 : 2 : res_op->ops[2] = _r1;
10766 : : }
10767 : 2 : res_op->resimplify (lseq, valueize);
10768 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
10769 : 2 : return true;
10770 : : }
10771 : 0 : next_after_fail1949:;
10772 : : }
10773 : : }
10774 : 0 : break;
10775 : : }
10776 : : default:;
10777 : : }
10778 : : }
10779 : : break;
10780 : 12037579 : default:;
10781 : : }
10782 : 12037579 : if (uniform_integer_cst_p (_p1))
10783 : : {
10784 : 9072563 : {
10785 : 9072563 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
10786 : 9072563 : if (gimple_simplify_364 (res_op, seq, valueize, type, captures, LE_EXPR, LT_EXPR))
10787 : 7021 : return true;
10788 : : }
10789 : : }
10790 : 12030558 : switch (TREE_CODE (_p0))
10791 : : {
10792 : 11540648 : case SSA_NAME:
10793 : 11540648 : if (gimple *_d1 = get_def (valueize, _p0))
10794 : : {
10795 : 3688629 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10796 : 3298531 : switch (gimple_assign_rhs_code (_a1))
10797 : : {
10798 : 57926 : case MULT_EXPR:
10799 : 57926 : {
10800 : 57926 : tree _q20 = gimple_assign_rhs1 (_a1);
10801 : 57926 : _q20 = do_valueize (valueize, _q20);
10802 : 57926 : tree _q21 = gimple_assign_rhs2 (_a1);
10803 : 57926 : _q21 = do_valueize (valueize, _q21);
10804 : 57926 : if (tree_swap_operands_p (_q20, _q21))
10805 : 822 : std::swap (_q20, _q21);
10806 : 57926 : switch (TREE_CODE (_q21))
10807 : : {
10808 : 46540 : case INTEGER_CST:
10809 : 46540 : {
10810 : 46540 : if (integer_zerop (_p1))
10811 : : {
10812 : 171 : {
10813 : 171 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
10814 : 171 : if (gimple_simplify_245 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
10815 : 70 : return true;
10816 : : }
10817 : : }
10818 : : break;
10819 : : }
10820 : : default:;
10821 : : }
10822 : 12030488 : break;
10823 : : }
10824 : : default:;
10825 : : }
10826 : : }
10827 : : break;
10828 : 12030488 : default:;
10829 : : }
10830 : 12030488 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
10831 : : {
10832 : 5522 : {
10833 : 5522 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
10834 : 5522 : if (gimple_simplify_247 (res_op, seq, valueize, type, captures, LE_EXPR))
10835 : 4783 : return true;
10836 : : }
10837 : : }
10838 : 12025705 : switch (TREE_CODE (_p0))
10839 : : {
10840 : 11535812 : case SSA_NAME:
10841 : 11535812 : if (gimple *_d1 = get_def (valueize, _p0))
10842 : : {
10843 : 3685713 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10844 : 3296825 : switch (gimple_assign_rhs_code (_a1))
10845 : : {
10846 : 820 : case BIT_NOT_EXPR:
10847 : 820 : {
10848 : 820 : tree _q20 = gimple_assign_rhs1 (_a1);
10849 : 820 : _q20 = do_valueize (valueize, _q20);
10850 : 820 : switch (TREE_CODE (_p1))
10851 : : {
10852 : 3 : case SSA_NAME:
10853 : 3 : if (gimple *_d2 = get_def (valueize, _p1))
10854 : : {
10855 : 3 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10856 : 3 : switch (gimple_assign_rhs_code (_a2))
10857 : : {
10858 : 0 : case BIT_NOT_EXPR:
10859 : 0 : {
10860 : 0 : tree _q40 = gimple_assign_rhs1 (_a2);
10861 : 0 : _q40 = do_valueize (valueize, _q40);
10862 : 0 : {
10863 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _p1, _q40 };
10864 : 0 : if (gimple_simplify_249 (res_op, seq, valueize, type, captures, LE_EXPR))
10865 : 0 : return true;
10866 : : }
10867 : 0 : break;
10868 : : }
10869 : : default:;
10870 : : }
10871 : : }
10872 : : break;
10873 : 820 : default:;
10874 : : }
10875 : 820 : {
10876 : 820 : tree _p1_pops[1];
10877 : 820 : if (gimple_nop_convert (_p1, _p1_pops, valueize))
10878 : : {
10879 : 3 : tree _q40 = _p1_pops[0];
10880 : 3 : switch (TREE_CODE (_q40))
10881 : : {
10882 : 3 : case SSA_NAME:
10883 : 3 : if (gimple *_d2 = get_def (valueize, _q40))
10884 : : {
10885 : 3 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10886 : 3 : switch (gimple_assign_rhs_code (_a2))
10887 : : {
10888 : 0 : case BIT_NOT_EXPR:
10889 : 0 : {
10890 : 0 : tree _q50 = gimple_assign_rhs1 (_a2);
10891 : 0 : _q50 = do_valueize (valueize, _q50);
10892 : 0 : {
10893 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q40, _q50 };
10894 : 0 : if (gimple_simplify_249 (res_op, seq, valueize, type, captures, LE_EXPR))
10895 : 0 : return true;
10896 : : }
10897 : 0 : break;
10898 : : }
10899 : : default:;
10900 : : }
10901 : : }
10902 : : break;
10903 : : default:;
10904 : : }
10905 : : }
10906 : : }
10907 : 820 : if (CONSTANT_CLASS_P (_p1))
10908 : : {
10909 : 817 : {
10910 : 817 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
10911 : 817 : if (gimple_simplify_250 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
10912 : 64 : return true;
10913 : : }
10914 : : }
10915 : : break;
10916 : : }
10917 : : default:;
10918 : : }
10919 : : }
10920 : : break;
10921 : 12025641 : default:;
10922 : : }
10923 : 12025641 : {
10924 : 12025641 : tree _p0_pops[1];
10925 : 12025641 : if (gimple_nop_convert (_p0, _p0_pops, valueize))
10926 : : {
10927 : 266168 : tree _q20 = _p0_pops[0];
10928 : 266168 : switch (TREE_CODE (_q20))
10929 : : {
10930 : 265968 : case SSA_NAME:
10931 : 265968 : if (gimple *_d1 = get_def (valueize, _q20))
10932 : : {
10933 : 251523 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
10934 : 178816 : switch (gimple_assign_rhs_code (_a1))
10935 : : {
10936 : 67 : case BIT_NOT_EXPR:
10937 : 67 : {
10938 : 67 : tree _q30 = gimple_assign_rhs1 (_a1);
10939 : 67 : _q30 = do_valueize (valueize, _q30);
10940 : 67 : switch (TREE_CODE (_p1))
10941 : : {
10942 : 0 : case SSA_NAME:
10943 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
10944 : : {
10945 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10946 : 0 : switch (gimple_assign_rhs_code (_a2))
10947 : : {
10948 : 0 : case BIT_NOT_EXPR:
10949 : 0 : {
10950 : 0 : tree _q50 = gimple_assign_rhs1 (_a2);
10951 : 0 : _q50 = do_valueize (valueize, _q50);
10952 : 0 : {
10953 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _p1, _q50 };
10954 : 0 : if (gimple_simplify_251 (res_op, seq, valueize, type, captures, LE_EXPR))
10955 : 0 : return true;
10956 : : }
10957 : 0 : break;
10958 : : }
10959 : : default:;
10960 : : }
10961 : : }
10962 : : break;
10963 : 67 : default:;
10964 : : }
10965 : 67 : {
10966 : 67 : tree _p1_pops[1];
10967 : 67 : if (gimple_nop_convert (_p1, _p1_pops, valueize))
10968 : : {
10969 : 0 : tree _q50 = _p1_pops[0];
10970 : 0 : switch (TREE_CODE (_q50))
10971 : : {
10972 : 0 : case SSA_NAME:
10973 : 0 : if (gimple *_d2 = get_def (valueize, _q50))
10974 : : {
10975 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
10976 : 0 : switch (gimple_assign_rhs_code (_a2))
10977 : : {
10978 : 0 : case BIT_NOT_EXPR:
10979 : 0 : {
10980 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
10981 : 0 : _q60 = do_valueize (valueize, _q60);
10982 : 0 : {
10983 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q50, _q60 };
10984 : 0 : if (gimple_simplify_251 (res_op, seq, valueize, type, captures, LE_EXPR))
10985 : 0 : return true;
10986 : : }
10987 : 0 : break;
10988 : : }
10989 : : default:;
10990 : : }
10991 : : }
10992 : : break;
10993 : : default:;
10994 : : }
10995 : : }
10996 : : }
10997 : 67 : if (CONSTANT_CLASS_P (_p1))
10998 : : {
10999 : 67 : {
11000 : 67 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q30, _p1 };
11001 : 67 : if (gimple_simplify_250 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
11002 : 0 : return true;
11003 : : }
11004 : : }
11005 : : break;
11006 : : }
11007 : : default:;
11008 : : }
11009 : : }
11010 : : break;
11011 : : default:;
11012 : : }
11013 : : }
11014 : : }
11015 : 12025641 : switch (TREE_CODE (_p1))
11016 : : {
11017 : 157891 : case REAL_CST:
11018 : 157891 : {
11019 : 157891 : {
11020 : 157891 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
11021 : 157891 : if (gimple_simplify_252 (res_op, seq, valueize, type, captures, LE_EXPR))
11022 : 147 : return true;
11023 : : }
11024 : 157744 : break;
11025 : : }
11026 : 12025494 : default:;
11027 : : }
11028 : 12025494 : switch (TREE_CODE (_p0))
11029 : : {
11030 : 11535601 : case SSA_NAME:
11031 : 11535601 : if (gimple *_d1 = get_def (valueize, _p0))
11032 : : {
11033 : 3685502 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
11034 : 3296758 : switch (gimple_assign_rhs_code (_a1))
11035 : : {
11036 : 681668 : case PLUS_EXPR:
11037 : 681668 : {
11038 : 681668 : tree _q20 = gimple_assign_rhs1 (_a1);
11039 : 681668 : _q20 = do_valueize (valueize, _q20);
11040 : 681668 : tree _q21 = gimple_assign_rhs2 (_a1);
11041 : 681668 : _q21 = do_valueize (valueize, _q21);
11042 : 681668 : if (tree_swap_operands_p (_q20, _q21))
11043 : 12800 : std::swap (_q20, _q21);
11044 : 681668 : switch (TREE_CODE (_q21))
11045 : : {
11046 : 377 : case REAL_CST:
11047 : 377 : {
11048 : 377 : switch (TREE_CODE (_p1))
11049 : : {
11050 : 368 : case REAL_CST:
11051 : 368 : {
11052 : 368 : {
11053 : 368 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
11054 : 368 : if (gimple_simplify_253 (res_op, seq, valueize, type, captures, PLUS_EXPR, LE_EXPR))
11055 : 0 : return true;
11056 : : }
11057 : 368 : break;
11058 : : }
11059 : : default:;
11060 : : }
11061 : : break;
11062 : : }
11063 : 562283 : case INTEGER_CST:
11064 : 562283 : {
11065 : 562283 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
11066 : : {
11067 : 1861 : {
11068 : 1861 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q20, _q21 };
11069 : 1861 : if (gimple_simplify_348 (res_op, seq, valueize, type, captures, LE_EXPR, GT_EXPR))
11070 : 50 : return true;
11071 : : }
11072 : : }
11073 : : break;
11074 : : }
11075 : : default:;
11076 : : }
11077 : 11999566 : break;
11078 : : }
11079 : 177369 : case MINUS_EXPR:
11080 : 177369 : {
11081 : 177369 : tree _q20 = gimple_assign_rhs1 (_a1);
11082 : 177369 : _q20 = do_valueize (valueize, _q20);
11083 : 177369 : tree _q21 = gimple_assign_rhs2 (_a1);
11084 : 177369 : _q21 = do_valueize (valueize, _q21);
11085 : 177369 : switch (TREE_CODE (_q21))
11086 : : {
11087 : 4232 : case REAL_CST:
11088 : 4232 : {
11089 : 4232 : switch (TREE_CODE (_p1))
11090 : : {
11091 : 4232 : case REAL_CST:
11092 : 4232 : {
11093 : 4232 : {
11094 : 4232 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
11095 : 4232 : if (gimple_simplify_253 (res_op, seq, valueize, type, captures, MINUS_EXPR, LE_EXPR))
11096 : 0 : return true;
11097 : : }
11098 : 4232 : break;
11099 : : }
11100 : : default:;
11101 : : }
11102 : : break;
11103 : : }
11104 : 177369 : default:;
11105 : : }
11106 : 177369 : switch (TREE_CODE (_q20))
11107 : : {
11108 : 0 : case REAL_CST:
11109 : 0 : {
11110 : 0 : switch (TREE_CODE (_p1))
11111 : : {
11112 : 0 : case REAL_CST:
11113 : 0 : {
11114 : 0 : {
11115 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
11116 : 0 : if (gimple_simplify_254 (res_op, seq, valueize, type, captures, LE_EXPR))
11117 : 0 : return true;
11118 : : }
11119 : 0 : break;
11120 : : }
11121 : : default:;
11122 : : }
11123 : : break;
11124 : : }
11125 : : default:;
11126 : : }
11127 : : break;
11128 : : }
11129 : 2258 : case FLOAT_EXPR:
11130 : 2258 : {
11131 : 2258 : tree _q20 = gimple_assign_rhs1 (_a1);
11132 : 2258 : _q20 = do_valueize (valueize, _q20);
11133 : 2258 : switch (TREE_CODE (_p1))
11134 : : {
11135 : 1497 : case SSA_NAME:
11136 : 1497 : if (gimple *_d2 = get_def (valueize, _p1))
11137 : : {
11138 : 1424 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11139 : 1559 : switch (gimple_assign_rhs_code (_a2))
11140 : : {
11141 : 108 : case FLOAT_EXPR:
11142 : 108 : {
11143 : 108 : tree _q40 = gimple_assign_rhs1 (_a2);
11144 : 108 : _q40 = do_valueize (valueize, _q40);
11145 : 108 : {
11146 : 108 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q40 };
11147 : 108 : if (gimple_simplify_257 (res_op, seq, valueize, type, captures, LE_EXPR, LE_EXPR))
11148 : 0 : return true;
11149 : : }
11150 : 108 : break;
11151 : : }
11152 : : default:;
11153 : : }
11154 : : }
11155 : : break;
11156 : 761 : case REAL_CST:
11157 : 761 : {
11158 : 761 : {
11159 : 761 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
11160 : 761 : if (gimple_simplify_258 (res_op, seq, valueize, type, captures, LE_EXPR, LE_EXPR))
11161 : 67 : return true;
11162 : : }
11163 : 694 : break;
11164 : : }
11165 : : default:;
11166 : : }
11167 : : break;
11168 : : }
11169 : 2320 : case EXACT_DIV_EXPR:
11170 : 2320 : {
11171 : 2320 : tree _q20 = gimple_assign_rhs1 (_a1);
11172 : 2320 : _q20 = do_valueize (valueize, _q20);
11173 : 2320 : tree _q21 = gimple_assign_rhs2 (_a1);
11174 : 2320 : _q21 = do_valueize (valueize, _q21);
11175 : 2320 : switch (TREE_CODE (_q21))
11176 : : {
11177 : 2320 : case INTEGER_CST:
11178 : 2320 : {
11179 : 2320 : switch (TREE_CODE (_p1))
11180 : : {
11181 : 2282 : case INTEGER_CST:
11182 : 2282 : {
11183 : 2282 : {
11184 : 2282 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
11185 : 2282 : if (gimple_simplify_349 (res_op, seq, valueize, type, captures, LE_EXPR))
11186 : 2282 : return true;
11187 : : }
11188 : 0 : break;
11189 : : }
11190 : : default:;
11191 : : }
11192 : : break;
11193 : : }
11194 : : default:;
11195 : : }
11196 : : break;
11197 : : }
11198 : 528862 : CASE_CONVERT:
11199 : 528862 : {
11200 : 528862 : tree _q20 = gimple_assign_rhs1 (_a1);
11201 : 528862 : _q20 = do_valueize (valueize, _q20);
11202 : 528862 : switch (TREE_CODE (_q20))
11203 : : {
11204 : 528662 : case SSA_NAME:
11205 : 528662 : if (gimple *_d2 = get_def (valueize, _q20))
11206 : : {
11207 : 510377 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11208 : 523952 : switch (gimple_assign_rhs_code (_a2))
11209 : : {
11210 : 5542 : case EXACT_DIV_EXPR:
11211 : 5542 : {
11212 : 5542 : tree _q30 = gimple_assign_rhs1 (_a2);
11213 : 5542 : _q30 = do_valueize (valueize, _q30);
11214 : 5542 : tree _q31 = gimple_assign_rhs2 (_a2);
11215 : 5542 : _q31 = do_valueize (valueize, _q31);
11216 : 5542 : switch (TREE_CODE (_q31))
11217 : : {
11218 : 5542 : case INTEGER_CST:
11219 : 5542 : {
11220 : 5542 : switch (TREE_CODE (_p1))
11221 : : {
11222 : 1175 : case INTEGER_CST:
11223 : 1175 : {
11224 : 1175 : {
11225 : 1175 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
11226 : 1175 : if (gimple_simplify_350 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
11227 : 425 : return true;
11228 : : }
11229 : 750 : break;
11230 : : }
11231 : : default:;
11232 : : }
11233 : : break;
11234 : : }
11235 : : default:;
11236 : : }
11237 : : break;
11238 : : }
11239 : : default:;
11240 : : }
11241 : : }
11242 : : break;
11243 : 528437 : default:;
11244 : : }
11245 : 528437 : switch (TREE_CODE (_p1))
11246 : : {
11247 : 105862 : case SSA_NAME:
11248 : 105862 : if (gimple *_d2 = get_def (valueize, _p1))
11249 : : {
11250 : 98206 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11251 : 100550 : switch (gimple_assign_rhs_code (_a2))
11252 : : {
11253 : 25073 : CASE_CONVERT:
11254 : 25073 : {
11255 : 25073 : tree _q40 = gimple_assign_rhs1 (_a2);
11256 : 25073 : _q40 = do_valueize (valueize, _q40);
11257 : 25073 : {
11258 : 25073 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
11259 : 25073 : if (gimple_simplify_262 (res_op, seq, valueize, type, captures, LE_EXPR))
11260 : 160 : return true;
11261 : : }
11262 : 24913 : break;
11263 : : }
11264 : : default:;
11265 : : }
11266 : : }
11267 : : break;
11268 : 528277 : default:;
11269 : : }
11270 : 528277 : {
11271 : 528277 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _p1 };
11272 : 528277 : if (gimple_simplify_263 (res_op, seq, valueize, type, captures, LE_EXPR))
11273 : 21030 : return true;
11274 : : }
11275 : 507247 : break;
11276 : : }
11277 : 12912 : case BIT_AND_EXPR:
11278 : 12912 : {
11279 : 12912 : tree _q20 = gimple_assign_rhs1 (_a1);
11280 : 12912 : _q20 = do_valueize (valueize, _q20);
11281 : 12912 : tree _q21 = gimple_assign_rhs2 (_a1);
11282 : 12912 : _q21 = do_valueize (valueize, _q21);
11283 : 12912 : if (tree_swap_operands_p (_q20, _q21))
11284 : 24 : std::swap (_q20, _q21);
11285 : 12912 : switch (TREE_CODE (_q21))
11286 : : {
11287 : 12203 : case INTEGER_CST:
11288 : 12203 : {
11289 : 12203 : switch (TREE_CODE (_p1))
11290 : : {
11291 : 9577 : case INTEGER_CST:
11292 : 9577 : {
11293 : 9577 : {
11294 : 9577 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
11295 : 9577 : if (gimple_simplify_365 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR))
11296 : 115 : return true;
11297 : : }
11298 : 9462 : break;
11299 : : }
11300 : : default:;
11301 : : }
11302 : : break;
11303 : : }
11304 : : default:;
11305 : : }
11306 : 11999566 : break;
11307 : : }
11308 : 3344 : case NEGATE_EXPR:
11309 : 3344 : {
11310 : 3344 : tree _q20 = gimple_assign_rhs1 (_a1);
11311 : 3344 : _q20 = do_valueize (valueize, _q20);
11312 : 3344 : switch (TREE_CODE (_p1))
11313 : : {
11314 : 742 : case SSA_NAME:
11315 : 742 : if (gimple *_d2 = get_def (valueize, _p1))
11316 : : {
11317 : 720 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11318 : 921 : switch (gimple_assign_rhs_code (_a2))
11319 : : {
11320 : 188 : case NEGATE_EXPR:
11321 : 188 : {
11322 : 188 : tree _q40 = gimple_assign_rhs1 (_a2);
11323 : 188 : _q40 = do_valueize (valueize, _q40);
11324 : 188 : {
11325 : 188 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
11326 : 188 : if (gimple_simplify_260 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
11327 : 102 : return true;
11328 : : }
11329 : 86 : break;
11330 : : }
11331 : : default:;
11332 : : }
11333 : : }
11334 : : break;
11335 : 3242 : default:;
11336 : : }
11337 : 3242 : if (CONSTANT_CLASS_P (_p1))
11338 : : {
11339 : 2602 : {
11340 : 2602 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
11341 : 2602 : if (gimple_simplify_261 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
11342 : 1645 : return true;
11343 : : }
11344 : : }
11345 : : break;
11346 : : }
11347 : 92 : case COND_EXPR:
11348 : 92 : {
11349 : 92 : tree _q20 = gimple_assign_rhs1 (_a1);
11350 : 92 : _q20 = do_valueize (valueize, _q20);
11351 : 92 : tree _q21 = gimple_assign_rhs2 (_a1);
11352 : 92 : _q21 = do_valueize (valueize, _q21);
11353 : 92 : tree _q22 = gimple_assign_rhs3 (_a1);
11354 : 92 : _q22 = do_valueize (valueize, _q22);
11355 : 92 : {
11356 : 92 : tree captures[4] ATTRIBUTE_UNUSED = { _q20, _q21, _q22, _p1 };
11357 : 92 : if (gimple_simplify_278 (res_op, seq, valueize, type, captures, LE_EXPR))
11358 : 10 : return true;
11359 : : }
11360 : 82 : break;
11361 : : }
11362 : : default:;
11363 : : }
11364 : 1243165 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
11365 : 118418 : switch (gimple_call_combined_fn (_c1))
11366 : : {
11367 : 14 : case CFN_BUILT_IN_SQRTF:
11368 : 14 : if (gimple_call_num_args (_c1) == 1)
11369 : : {
11370 : 14 : tree _q20 = gimple_call_arg (_c1, 0);
11371 : 14 : _q20 = do_valueize (valueize, _q20);
11372 : 14 : switch (TREE_CODE (_p1))
11373 : : {
11374 : 2 : case SSA_NAME:
11375 : 2 : if (gimple *_d2 = get_def (valueize, _p1))
11376 : : {
11377 : 2 : if (gcall *_c2 = dyn_cast <gcall *> (_d2))
11378 : 2 : switch (gimple_call_combined_fn (_c2))
11379 : : {
11380 : 2 : case CFN_BUILT_IN_SQRTF:
11381 : 2 : if (gimple_call_num_args (_c2) == 1)
11382 : : {
11383 : 2 : tree _q40 = gimple_call_arg (_c2, 0);
11384 : 2 : _q40 = do_valueize (valueize, _q40);
11385 : 2 : {
11386 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
11387 : 2 : if (gimple_simplify_256 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SQRTF, LE_EXPR))
11388 : 2 : return true;
11389 : : }
11390 : : }
11391 : : break;
11392 : : default:;
11393 : : }
11394 : : }
11395 : : break;
11396 : 12 : case REAL_CST:
11397 : 12 : {
11398 : 12 : {
11399 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
11400 : 12 : if (gimple_simplify_255 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SQRTF, LE_EXPR))
11401 : 12 : return true;
11402 : : }
11403 : 0 : break;
11404 : : }
11405 : : default:;
11406 : : }
11407 : : }
11408 : : break;
11409 : 14 : case CFN_BUILT_IN_SQRTL:
11410 : 14 : if (gimple_call_num_args (_c1) == 1)
11411 : : {
11412 : 14 : tree _q20 = gimple_call_arg (_c1, 0);
11413 : 14 : _q20 = do_valueize (valueize, _q20);
11414 : 14 : switch (TREE_CODE (_p1))
11415 : : {
11416 : 2 : case SSA_NAME:
11417 : 2 : if (gimple *_d2 = get_def (valueize, _p1))
11418 : : {
11419 : 2 : if (gcall *_c2 = dyn_cast <gcall *> (_d2))
11420 : 2 : switch (gimple_call_combined_fn (_c2))
11421 : : {
11422 : 2 : case CFN_BUILT_IN_SQRTL:
11423 : 2 : if (gimple_call_num_args (_c2) == 1)
11424 : : {
11425 : 2 : tree _q40 = gimple_call_arg (_c2, 0);
11426 : 2 : _q40 = do_valueize (valueize, _q40);
11427 : 2 : {
11428 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
11429 : 2 : if (gimple_simplify_256 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SQRTL, LE_EXPR))
11430 : 2 : return true;
11431 : : }
11432 : : }
11433 : : break;
11434 : : default:;
11435 : : }
11436 : : }
11437 : : break;
11438 : 12 : case REAL_CST:
11439 : 12 : {
11440 : 12 : {
11441 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
11442 : 12 : if (gimple_simplify_255 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SQRTL, LE_EXPR))
11443 : 12 : return true;
11444 : : }
11445 : 0 : break;
11446 : : }
11447 : : default:;
11448 : : }
11449 : : }
11450 : : break;
11451 : 65 : case CFN_BUILT_IN_SQRT:
11452 : 65 : if (gimple_call_num_args (_c1) == 1)
11453 : : {
11454 : 65 : tree _q20 = gimple_call_arg (_c1, 0);
11455 : 65 : _q20 = do_valueize (valueize, _q20);
11456 : 65 : switch (TREE_CODE (_p1))
11457 : : {
11458 : 2 : case SSA_NAME:
11459 : 2 : if (gimple *_d2 = get_def (valueize, _p1))
11460 : : {
11461 : 2 : if (gcall *_c2 = dyn_cast <gcall *> (_d2))
11462 : 2 : switch (gimple_call_combined_fn (_c2))
11463 : : {
11464 : 2 : case CFN_BUILT_IN_SQRT:
11465 : 2 : if (gimple_call_num_args (_c2) == 1)
11466 : : {
11467 : 2 : tree _q40 = gimple_call_arg (_c2, 0);
11468 : 2 : _q40 = do_valueize (valueize, _q40);
11469 : 2 : {
11470 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
11471 : 2 : if (gimple_simplify_256 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SQRT, LE_EXPR))
11472 : 2 : return true;
11473 : : }
11474 : : }
11475 : : break;
11476 : : default:;
11477 : : }
11478 : : }
11479 : : break;
11480 : 63 : case REAL_CST:
11481 : 63 : {
11482 : 63 : {
11483 : 63 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
11484 : 63 : if (gimple_simplify_255 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_SQRT, LE_EXPR))
11485 : 12 : return true;
11486 : : }
11487 : 51 : break;
11488 : : }
11489 : : default:;
11490 : : }
11491 : : }
11492 : : break;
11493 : 0 : case CFN_SQRT:
11494 : 0 : if (gimple_call_num_args (_c1) == 1)
11495 : : {
11496 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
11497 : 0 : _q20 = do_valueize (valueize, _q20);
11498 : 0 : switch (TREE_CODE (_p1))
11499 : : {
11500 : 0 : case SSA_NAME:
11501 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
11502 : : {
11503 : 0 : if (gcall *_c2 = dyn_cast <gcall *> (_d2))
11504 : 0 : switch (gimple_call_combined_fn (_c2))
11505 : : {
11506 : 0 : case CFN_SQRT:
11507 : 0 : if (gimple_call_num_args (_c2) == 1)
11508 : : {
11509 : 0 : tree _q40 = gimple_call_arg (_c2, 0);
11510 : 0 : _q40 = do_valueize (valueize, _q40);
11511 : 0 : {
11512 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
11513 : 0 : if (gimple_simplify_256 (res_op, seq, valueize, type, captures, CFN_SQRT, LE_EXPR))
11514 : 0 : return true;
11515 : : }
11516 : : }
11517 : : break;
11518 : : default:;
11519 : : }
11520 : : }
11521 : : break;
11522 : 0 : case REAL_CST:
11523 : 0 : {
11524 : 0 : {
11525 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
11526 : 0 : if (gimple_simplify_255 (res_op, seq, valueize, type, captures, CFN_SQRT, LE_EXPR))
11527 : 0 : return true;
11528 : : }
11529 : 0 : break;
11530 : : }
11531 : : default:;
11532 : : }
11533 : : }
11534 : : break;
11535 : : default:;
11536 : : }
11537 : : }
11538 : : break;
11539 : 11999566 : default:;
11540 : : }
11541 : 11999566 : switch (TREE_CODE (_p1))
11542 : : {
11543 : 2733600 : case SSA_NAME:
11544 : 2733600 : if (gimple *_d1 = get_def (valueize, _p1))
11545 : : {
11546 : 949950 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
11547 : 1049962 : switch (gimple_assign_rhs_code (_a1))
11548 : : {
11549 : 64 : case COND_EXPR:
11550 : 64 : {
11551 : 64 : tree _q30 = gimple_assign_rhs1 (_a1);
11552 : 64 : _q30 = do_valueize (valueize, _q30);
11553 : 64 : tree _q31 = gimple_assign_rhs2 (_a1);
11554 : 64 : _q31 = do_valueize (valueize, _q31);
11555 : 64 : tree _q32 = gimple_assign_rhs3 (_a1);
11556 : 64 : _q32 = do_valueize (valueize, _q32);
11557 : 64 : {
11558 : 64 : tree captures[4] ATTRIBUTE_UNUSED = { _q30, _q31, _q32, _p0 };
11559 : 64 : if (gimple_simplify_278 (res_op, seq, valueize, type, captures, GE_EXPR))
11560 : 0 : return true;
11561 : : }
11562 : 64 : break;
11563 : : }
11564 : : default:;
11565 : : }
11566 : : }
11567 : : break;
11568 : 11999566 : default:;
11569 : : }
11570 : 11999566 : switch (TREE_CODE (_p0))
11571 : : {
11572 : 11509673 : case SSA_NAME:
11573 : 11509673 : if (gimple *_d1 = get_def (valueize, _p0))
11574 : : {
11575 : 3659574 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
11576 : 3270872 : switch (gimple_assign_rhs_code (_a1))
11577 : : {
11578 : 507247 : CASE_CONVERT:
11579 : 507247 : {
11580 : 507247 : tree _q20 = gimple_assign_rhs1 (_a1);
11581 : 507247 : _q20 = do_valueize (valueize, _q20);
11582 : 507247 : switch (TREE_CODE (_q20))
11583 : : {
11584 : 507047 : case SSA_NAME:
11585 : 507047 : if (gimple *_d2 = get_def (valueize, _q20))
11586 : : {
11587 : 489776 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11588 : 490618 : switch (gimple_assign_rhs_code (_a2))
11589 : : {
11590 : 127 : case ADDR_EXPR:
11591 : 127 : {
11592 : 127 : switch (TREE_CODE (_p1))
11593 : : {
11594 : 127 : case SSA_NAME:
11595 : 127 : if (gimple *_d3 = get_def (valueize, _p1))
11596 : : {
11597 : 127 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
11598 : 127 : switch (gimple_assign_rhs_code (_a3))
11599 : : {
11600 : 127 : CASE_CONVERT:
11601 : 127 : {
11602 : 127 : tree _q40 = gimple_assign_rhs1 (_a3);
11603 : 127 : _q40 = do_valueize (valueize, _q40);
11604 : 127 : switch (TREE_CODE (_q40))
11605 : : {
11606 : 127 : case SSA_NAME:
11607 : 127 : if (gimple *_d4 = get_def (valueize, _q40))
11608 : : {
11609 : 127 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
11610 : 254 : switch (gimple_assign_rhs_code (_a4))
11611 : : {
11612 : 3 : case ADDR_EXPR:
11613 : 3 : {
11614 : 3 : {
11615 : 3 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q40 };
11616 : 3 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11617 : 2 : return true;
11618 : : }
11619 : 1 : break;
11620 : : }
11621 : : default:;
11622 : : }
11623 : : }
11624 : : break;
11625 : 0 : case ADDR_EXPR:
11626 : 0 : {
11627 : 0 : {
11628 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q40 };
11629 : 0 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11630 : 0 : return true;
11631 : : }
11632 : 0 : break;
11633 : : }
11634 : : default:;
11635 : : }
11636 : : break;
11637 : : }
11638 : 0 : case ADDR_EXPR:
11639 : 0 : {
11640 : 0 : {
11641 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
11642 : 0 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11643 : 0 : return true;
11644 : : }
11645 : 0 : break;
11646 : : }
11647 : : default:;
11648 : : }
11649 : : }
11650 : : break;
11651 : 0 : case ADDR_EXPR:
11652 : 0 : {
11653 : 0 : {
11654 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
11655 : 0 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11656 : 0 : return true;
11657 : : }
11658 : 0 : break;
11659 : : }
11660 : : default:;
11661 : : }
11662 : : break;
11663 : : }
11664 : : default:;
11665 : : }
11666 : : }
11667 : : break;
11668 : 200 : case ADDR_EXPR:
11669 : 200 : {
11670 : 200 : switch (TREE_CODE (_p1))
11671 : : {
11672 : 184 : case SSA_NAME:
11673 : 184 : if (gimple *_d2 = get_def (valueize, _p1))
11674 : : {
11675 : 184 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11676 : 184 : switch (gimple_assign_rhs_code (_a2))
11677 : : {
11678 : 184 : CASE_CONVERT:
11679 : 184 : {
11680 : 184 : tree _q40 = gimple_assign_rhs1 (_a2);
11681 : 184 : _q40 = do_valueize (valueize, _q40);
11682 : 184 : switch (TREE_CODE (_q40))
11683 : : {
11684 : 52 : case SSA_NAME:
11685 : 52 : if (gimple *_d3 = get_def (valueize, _q40))
11686 : : {
11687 : 52 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
11688 : 48 : switch (gimple_assign_rhs_code (_a3))
11689 : : {
11690 : 0 : case ADDR_EXPR:
11691 : 0 : {
11692 : 0 : {
11693 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q40 };
11694 : 0 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11695 : 0 : return true;
11696 : : }
11697 : 0 : break;
11698 : : }
11699 : : default:;
11700 : : }
11701 : : }
11702 : : break;
11703 : 132 : case ADDR_EXPR:
11704 : 132 : {
11705 : 132 : {
11706 : 132 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q40 };
11707 : 132 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11708 : 3 : return true;
11709 : : }
11710 : 129 : break;
11711 : : }
11712 : : default:;
11713 : : }
11714 : : break;
11715 : : }
11716 : 0 : case ADDR_EXPR:
11717 : 0 : {
11718 : 0 : {
11719 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
11720 : 0 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11721 : 0 : return true;
11722 : : }
11723 : 0 : break;
11724 : : }
11725 : : default:;
11726 : : }
11727 : : }
11728 : : break;
11729 : 0 : case ADDR_EXPR:
11730 : 0 : {
11731 : 0 : {
11732 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
11733 : 0 : if (gimple_simplify_281 (res_op, seq, valueize, type, captures, LE_EXPR))
11734 : 0 : return true;
11735 : : }
11736 : 0 : break;
11737 : : }
11738 : : default:;
11739 : : }
11740 : : break;
11741 : : }
11742 : 507242 : default:;
11743 : : }
11744 : 507242 : if (uniform_integer_cst_p (_p1))
11745 : : {
11746 : 400252 : {
11747 : 400252 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
11748 : 400252 : if (gimple_simplify_351 (res_op, seq, valueize, type, captures, LE_EXPR))
11749 : 5439 : return true;
11750 : : }
11751 : : }
11752 : : break;
11753 : : }
11754 : 7 : case ADDR_EXPR:
11755 : 7 : {
11756 : 7 : switch (TREE_CODE (_p1))
11757 : : {
11758 : 7 : case SSA_NAME:
11759 : 7 : if (gimple *_d2 = get_def (valueize, _p1))
11760 : : {
11761 : 7 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11762 : 7 : switch (gimple_assign_rhs_code (_a2))
11763 : : {
11764 : 0 : CASE_CONVERT:
11765 : 0 : {
11766 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
11767 : 0 : _q30 = do_valueize (valueize, _q30);
11768 : 0 : switch (TREE_CODE (_q30))
11769 : : {
11770 : 0 : case SSA_NAME:
11771 : 0 : if (gimple *_d3 = get_def (valueize, _q30))
11772 : : {
11773 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
11774 : 0 : switch (gimple_assign_rhs_code (_a3))
11775 : : {
11776 : 0 : case ADDR_EXPR:
11777 : 0 : {
11778 : 0 : {
11779 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q30 };
11780 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11781 : 0 : return true;
11782 : : }
11783 : 0 : break;
11784 : : }
11785 : : default:;
11786 : : }
11787 : : }
11788 : : break;
11789 : 0 : case ADDR_EXPR:
11790 : 0 : {
11791 : 0 : {
11792 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q30 };
11793 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11794 : 0 : return true;
11795 : : }
11796 : 0 : break;
11797 : : }
11798 : : default:;
11799 : : }
11800 : : break;
11801 : : }
11802 : 0 : case ADDR_EXPR:
11803 : 0 : {
11804 : 0 : {
11805 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _p1 };
11806 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11807 : 0 : return true;
11808 : : }
11809 : 0 : break;
11810 : : }
11811 : : default:;
11812 : : }
11813 : : }
11814 : : break;
11815 : 0 : case ADDR_EXPR:
11816 : 0 : {
11817 : 0 : {
11818 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _p1 };
11819 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11820 : 0 : return true;
11821 : : }
11822 : 0 : break;
11823 : : }
11824 : : default:;
11825 : : }
11826 : : break;
11827 : : }
11828 : : default:;
11829 : : }
11830 : : }
11831 : : break;
11832 : 56505 : case ADDR_EXPR:
11833 : 56505 : {
11834 : 56505 : switch (TREE_CODE (_p1))
11835 : : {
11836 : 53313 : case SSA_NAME:
11837 : 53313 : if (gimple *_d1 = get_def (valueize, _p1))
11838 : : {
11839 : 11273 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
11840 : 9363 : switch (gimple_assign_rhs_code (_a1))
11841 : : {
11842 : 303 : CASE_CONVERT:
11843 : 303 : {
11844 : 303 : tree _q30 = gimple_assign_rhs1 (_a1);
11845 : 303 : _q30 = do_valueize (valueize, _q30);
11846 : 303 : switch (TREE_CODE (_q30))
11847 : : {
11848 : 303 : case SSA_NAME:
11849 : 303 : if (gimple *_d2 = get_def (valueize, _q30))
11850 : : {
11851 : 299 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11852 : 49 : switch (gimple_assign_rhs_code (_a2))
11853 : : {
11854 : 0 : case ADDR_EXPR:
11855 : 0 : {
11856 : 0 : {
11857 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q30 };
11858 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11859 : 0 : return true;
11860 : : }
11861 : 0 : break;
11862 : : }
11863 : : default:;
11864 : : }
11865 : : }
11866 : : break;
11867 : 0 : case ADDR_EXPR:
11868 : 0 : {
11869 : 0 : {
11870 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _q30 };
11871 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11872 : 0 : return true;
11873 : : }
11874 : 0 : break;
11875 : : }
11876 : : default:;
11877 : : }
11878 : : break;
11879 : : }
11880 : 0 : case ADDR_EXPR:
11881 : 0 : {
11882 : 0 : {
11883 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _p1 };
11884 : 0 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11885 : 0 : return true;
11886 : : }
11887 : 0 : break;
11888 : : }
11889 : : default:;
11890 : : }
11891 : : }
11892 : : break;
11893 : 3114 : case ADDR_EXPR:
11894 : 3114 : {
11895 : 3114 : {
11896 : 3114 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _p1 };
11897 : 3114 : if (gimple_simplify_282 (res_op, seq, valueize, type, captures, LE_EXPR))
11898 : 3063 : return true;
11899 : : }
11900 : 51 : break;
11901 : : }
11902 : : default:;
11903 : : }
11904 : : break;
11905 : : }
11906 : 11991059 : default:;
11907 : : }
11908 : 11991059 : if (uniform_integer_cst_p (_p1))
11909 : : {
11910 : 9034660 : {
11911 : 9034660 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p0, _p1 };
11912 : 9034660 : if (gimple_simplify_352 (res_op, seq, valueize, type, captures, LE_EXPR))
11913 : 57436 : return true;
11914 : : }
11915 : : }
11916 : 11933623 : switch (TREE_CODE (_p0))
11917 : : {
11918 : 11447201 : case SSA_NAME:
11919 : 11447201 : if (gimple *_d1 = get_def (valueize, _p0))
11920 : : {
11921 : 3624807 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
11922 : 3233771 : switch (gimple_assign_rhs_code (_a1))
11923 : : {
11924 : 500175 : CASE_CONVERT:
11925 : 500175 : {
11926 : 500175 : tree _q20 = gimple_assign_rhs1 (_a1);
11927 : 500175 : _q20 = do_valueize (valueize, _q20);
11928 : 500175 : switch (TREE_CODE (_q20))
11929 : : {
11930 : 499978 : case SSA_NAME:
11931 : 499978 : if (gimple *_d2 = get_def (valueize, _q20))
11932 : : {
11933 : 484905 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
11934 : 484532 : switch (gimple_assign_rhs_code (_a2))
11935 : : {
11936 : 65809 : case PLUS_EXPR:
11937 : 65809 : {
11938 : 65809 : tree _q30 = gimple_assign_rhs1 (_a2);
11939 : 65809 : _q30 = do_valueize (valueize, _q30);
11940 : 65809 : tree _q31 = gimple_assign_rhs2 (_a2);
11941 : 65809 : _q31 = do_valueize (valueize, _q31);
11942 : 65809 : if (tree_swap_operands_p (_q30, _q31))
11943 : 929 : std::swap (_q30, _q31);
11944 : 65809 : switch (TREE_CODE (_q30))
11945 : : {
11946 : 65809 : case SSA_NAME:
11947 : 65809 : if (gimple *_d3 = get_def (valueize, _q30))
11948 : : {
11949 : 64128 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
11950 : 55774 : switch (gimple_assign_rhs_code (_a3))
11951 : : {
11952 : 27499 : CASE_CONVERT:
11953 : 27499 : {
11954 : 27499 : tree _q40 = gimple_assign_rhs1 (_a3);
11955 : 27499 : _q40 = do_valueize (valueize, _q40);
11956 : 27499 : switch (TREE_CODE (_q31))
11957 : : {
11958 : 25231 : case INTEGER_CST:
11959 : 25231 : {
11960 : 25231 : if ((_p1 == _q40 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q40, 0) && types_match (_p1, _q40)))
11961 : : {
11962 : 12 : {
11963 : 12 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q40, _q31 };
11964 : 12 : if (gimple_simplify_353 (res_op, seq, valueize, type, captures, LE_EXPR, GT_EXPR))
11965 : 12 : return true;
11966 : : }
11967 : : }
11968 : : break;
11969 : : }
11970 : : default:;
11971 : : }
11972 : : break;
11973 : : }
11974 : : default:;
11975 : : }
11976 : : }
11977 : : break;
11978 : : default:;
11979 : : }
11980 : 11933611 : break;
11981 : : }
11982 : : default:;
11983 : : }
11984 : : }
11985 : : break;
11986 : : default:;
11987 : : }
11988 : : break;
11989 : : }
11990 : : default:;
11991 : : }
11992 : : }
11993 : : break;
11994 : 11933611 : default:;
11995 : : }
11996 : 11933611 : switch (TREE_CODE (_p1))
11997 : : {
11998 : 2733583 : case SSA_NAME:
11999 : 2733583 : if (gimple *_d1 = get_def (valueize, _p1))
12000 : : {
12001 : 949933 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12002 : 1049945 : switch (gimple_assign_rhs_code (_a1))
12003 : : {
12004 : 47504 : CASE_CONVERT:
12005 : 47504 : {
12006 : 47504 : tree _q30 = gimple_assign_rhs1 (_a1);
12007 : 47504 : _q30 = do_valueize (valueize, _q30);
12008 : 47504 : switch (TREE_CODE (_q30))
12009 : : {
12010 : 47171 : case SSA_NAME:
12011 : 47171 : if (gimple *_d2 = get_def (valueize, _q30))
12012 : : {
12013 : 45046 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
12014 : 42925 : switch (gimple_assign_rhs_code (_a2))
12015 : : {
12016 : 7610 : case PLUS_EXPR:
12017 : 7610 : {
12018 : 7610 : tree _q40 = gimple_assign_rhs1 (_a2);
12019 : 7610 : _q40 = do_valueize (valueize, _q40);
12020 : 7610 : tree _q41 = gimple_assign_rhs2 (_a2);
12021 : 7610 : _q41 = do_valueize (valueize, _q41);
12022 : 7610 : if (tree_swap_operands_p (_q40, _q41))
12023 : 354 : std::swap (_q40, _q41);
12024 : 7610 : switch (TREE_CODE (_q40))
12025 : : {
12026 : 7610 : case SSA_NAME:
12027 : 7610 : if (gimple *_d3 = get_def (valueize, _q40))
12028 : : {
12029 : 7391 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
12030 : 6565 : switch (gimple_assign_rhs_code (_a3))
12031 : : {
12032 : 1939 : CASE_CONVERT:
12033 : 1939 : {
12034 : 1939 : tree _q50 = gimple_assign_rhs1 (_a3);
12035 : 1939 : _q50 = do_valueize (valueize, _q50);
12036 : 1939 : if ((_q50 == _p0 && ! TREE_SIDE_EFFECTS (_q50)) || (operand_equal_p (_q50, _p0, 0) && types_match (_q50, _p0)))
12037 : : {
12038 : 32 : switch (TREE_CODE (_q41))
12039 : : {
12040 : 32 : case INTEGER_CST:
12041 : 32 : {
12042 : 32 : {
12043 : 32 : tree captures[5] ATTRIBUTE_UNUSED = { _p1, _q30, _q40, _p0, _q41 };
12044 : 32 : if (gimple_simplify_353 (res_op, seq, valueize, type, captures, GE_EXPR, LE_EXPR))
12045 : 26 : return true;
12046 : : }
12047 : 6 : break;
12048 : : }
12049 : : default:;
12050 : : }
12051 : : }
12052 : : break;
12053 : : }
12054 : : default:;
12055 : : }
12056 : : }
12057 : : break;
12058 : : default:;
12059 : : }
12060 : 11933524 : break;
12061 : : }
12062 : : default:;
12063 : : }
12064 : : }
12065 : : break;
12066 : : default:;
12067 : : }
12068 : : break;
12069 : : }
12070 : 196215 : case PLUS_EXPR:
12071 : 196215 : {
12072 : 196215 : tree _q30 = gimple_assign_rhs1 (_a1);
12073 : 196215 : _q30 = do_valueize (valueize, _q30);
12074 : 196215 : tree _q31 = gimple_assign_rhs2 (_a1);
12075 : 196215 : _q31 = do_valueize (valueize, _q31);
12076 : 196215 : if (tree_swap_operands_p (_q30, _q31))
12077 : 1598 : std::swap (_q30, _q31);
12078 : 196215 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
12079 : : {
12080 : 12766 : switch (TREE_CODE (_q31))
12081 : : {
12082 : 4860 : case INTEGER_CST:
12083 : 4860 : {
12084 : 4860 : {
12085 : 4860 : tree captures[5] ATTRIBUTE_UNUSED = { _p1, _p1, _q30, _p0, _q31 };
12086 : 4860 : if (gimple_simplify_348 (res_op, seq, valueize, type, captures, GE_EXPR, LE_EXPR))
12087 : 61 : return true;
12088 : : }
12089 : 4799 : break;
12090 : : }
12091 : : default:;
12092 : : }
12093 : : }
12094 : 11933524 : break;
12095 : : }
12096 : : default:;
12097 : : }
12098 : : }
12099 : : break;
12100 : 11933524 : default:;
12101 : : }
12102 : 11933524 : switch (TREE_CODE (_p0))
12103 : : {
12104 : 11447102 : case SSA_NAME:
12105 : 11447102 : if (gimple *_d1 = get_def (valueize, _p0))
12106 : : {
12107 : 3624710 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12108 : 3233739 : switch (gimple_assign_rhs_code (_a1))
12109 : : {
12110 : 172865 : case MINUS_EXPR:
12111 : 172865 : {
12112 : 172865 : tree _q20 = gimple_assign_rhs1 (_a1);
12113 : 172865 : _q20 = do_valueize (valueize, _q20);
12114 : 172865 : tree _q21 = gimple_assign_rhs2 (_a1);
12115 : 172865 : _q21 = do_valueize (valueize, _q21);
12116 : 172865 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
12117 : : {
12118 : 2945 : {
12119 : 2945 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
12120 : 2945 : if (gimple_simplify_354 (res_op, seq, valueize, type, captures, LE_EXPR))
12121 : 8 : return true;
12122 : : }
12123 : : }
12124 : : break;
12125 : : }
12126 : : default:;
12127 : : }
12128 : : }
12129 : : break;
12130 : 11933516 : default:;
12131 : : }
12132 : 11933516 : switch (TREE_CODE (_p1))
12133 : : {
12134 : 2733496 : case SSA_NAME:
12135 : 2733496 : if (gimple *_d1 = get_def (valueize, _p1))
12136 : : {
12137 : 949846 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12138 : 1049858 : switch (gimple_assign_rhs_code (_a1))
12139 : : {
12140 : 196154 : case PLUS_EXPR:
12141 : 196154 : {
12142 : 196154 : tree _q30 = gimple_assign_rhs1 (_a1);
12143 : 196154 : _q30 = do_valueize (valueize, _q30);
12144 : 196154 : tree _q31 = gimple_assign_rhs2 (_a1);
12145 : 196154 : _q31 = do_valueize (valueize, _q31);
12146 : 196154 : if (tree_swap_operands_p (_q30, _q31))
12147 : 1598 : std::swap (_q30, _q31);
12148 : 196154 : switch (TREE_CODE (_q30))
12149 : : {
12150 : 196154 : case SSA_NAME:
12151 : 196154 : if (gimple *_d2 = get_def (valueize, _q30))
12152 : : {
12153 : 188839 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
12154 : 115917 : switch (gimple_assign_rhs_code (_a2))
12155 : : {
12156 : 1023 : case MINUS_EXPR:
12157 : 1023 : {
12158 : 1023 : tree _q40 = gimple_assign_rhs1 (_a2);
12159 : 1023 : _q40 = do_valueize (valueize, _q40);
12160 : 1023 : tree _q41 = gimple_assign_rhs2 (_a2);
12161 : 1023 : _q41 = do_valueize (valueize, _q41);
12162 : 1023 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
12163 : : {
12164 : 4 : if (integer_minus_onep (_q31))
12165 : : {
12166 : 0 : {
12167 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q41 };
12168 : 0 : if (gimple_simplify_366 (res_op, seq, valueize, type, captures, GE_EXPR))
12169 : 0 : return true;
12170 : : }
12171 : : }
12172 : : }
12173 : : break;
12174 : : }
12175 : : default:;
12176 : : }
12177 : : }
12178 : : break;
12179 : : default:;
12180 : : }
12181 : 11933516 : break;
12182 : : }
12183 : : default:;
12184 : : }
12185 : : }
12186 : : break;
12187 : 11933516 : default:;
12188 : : }
12189 : 11933516 : switch (TREE_CODE (_p0))
12190 : : {
12191 : 11447094 : case SSA_NAME:
12192 : 11447094 : if (gimple *_d1 = get_def (valueize, _p0))
12193 : : {
12194 : 3624702 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12195 : 3233731 : switch (gimple_assign_rhs_code (_a1))
12196 : : {
12197 : 230 : case REALPART_EXPR:
12198 : 230 : {
12199 : 230 : tree _q20 = TREE_OPERAND (gimple_assign_rhs1 (_a1), 0);
12200 : 230 : if ((TREE_CODE (_q20) == SSA_NAME
12201 : 230 : || is_gimple_min_invariant (_q20)))
12202 : : {
12203 : 50 : _q20 = do_valueize (valueize, _q20);
12204 : 50 : switch (TREE_CODE (_q20))
12205 : : {
12206 : 50 : case SSA_NAME:
12207 : 50 : if (gimple *_d2 = get_def (valueize, _q20))
12208 : : {
12209 : 49 : if (gcall *_c2 = dyn_cast <gcall *> (_d2))
12210 : 16 : switch (gimple_call_combined_fn (_c2))
12211 : : {
12212 : 4 : case CFN_SUB_OVERFLOW:
12213 : 4 : if (gimple_call_num_args (_c2) == 2)
12214 : : {
12215 : 4 : tree _q30 = gimple_call_arg (_c2, 0);
12216 : 4 : _q30 = do_valueize (valueize, _q30);
12217 : 4 : tree _q31 = gimple_call_arg (_c2, 1);
12218 : 4 : _q31 = do_valueize (valueize, _q31);
12219 : 4 : if ((_p1 == _q30 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q30, 0) && types_match (_p1, _q30)))
12220 : : {
12221 : 4 : {
12222 : 4 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q30, _q31 };
12223 : 4 : if (gimple_simplify_367 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR))
12224 : 2 : return true;
12225 : : }
12226 : : }
12227 : : }
12228 : : break;
12229 : : default:;
12230 : : }
12231 : : }
12232 : : break;
12233 : : default:;
12234 : : }
12235 : : }
12236 : : break;
12237 : : }
12238 : : default:;
12239 : : }
12240 : : }
12241 : : break;
12242 : 11933514 : default:;
12243 : : }
12244 : 11933514 : switch (TREE_CODE (_p1))
12245 : : {
12246 : 2733494 : case SSA_NAME:
12247 : 2733494 : if (gimple *_d1 = get_def (valueize, _p1))
12248 : : {
12249 : 949844 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12250 : 1049858 : switch (gimple_assign_rhs_code (_a1))
12251 : : {
12252 : 4 : case REALPART_EXPR:
12253 : 4 : {
12254 : 4 : tree _q30 = TREE_OPERAND (gimple_assign_rhs1 (_a1), 0);
12255 : 4 : if ((TREE_CODE (_q30) == SSA_NAME
12256 : 4 : || is_gimple_min_invariant (_q30)))
12257 : : {
12258 : 4 : _q30 = do_valueize (valueize, _q30);
12259 : 4 : switch (TREE_CODE (_q30))
12260 : : {
12261 : 4 : case SSA_NAME:
12262 : 4 : if (gimple *_d2 = get_def (valueize, _q30))
12263 : : {
12264 : 4 : if (gcall *_c2 = dyn_cast <gcall *> (_d2))
12265 : 4 : switch (gimple_call_combined_fn (_c2))
12266 : : {
12267 : 4 : case CFN_ADD_OVERFLOW:
12268 : 4 : if (gimple_call_num_args (_c2) == 2)
12269 : : {
12270 : 4 : tree _q40 = gimple_call_arg (_c2, 0);
12271 : 4 : _q40 = do_valueize (valueize, _q40);
12272 : 4 : tree _q41 = gimple_call_arg (_c2, 1);
12273 : 4 : _q41 = do_valueize (valueize, _q41);
12274 : 4 : if ((_q40 == _p0 && ! TREE_SIDE_EFFECTS (_q40)) || (operand_equal_p (_q40, _p0, 0) && types_match (_q40, _p0)))
12275 : : {
12276 : 0 : {
12277 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _p0, _q41 };
12278 : 0 : if (gimple_simplify_368 (res_op, seq, valueize, type, captures, GE_EXPR, EQ_EXPR))
12279 : 0 : return true;
12280 : : }
12281 : : }
12282 : 4 : if ((_q41 == _p0 && ! TREE_SIDE_EFFECTS (_q41)) || (operand_equal_p (_q41, _p0, 0) && types_match (_q41, _p0)))
12283 : : {
12284 : 0 : {
12285 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _p0, _q40 };
12286 : 0 : if (gimple_simplify_368 (res_op, seq, valueize, type, captures, GE_EXPR, EQ_EXPR))
12287 : 0 : return true;
12288 : : }
12289 : : }
12290 : : }
12291 : : break;
12292 : : default:;
12293 : : }
12294 : : }
12295 : : break;
12296 : : default:;
12297 : : }
12298 : : }
12299 : : break;
12300 : : }
12301 : 1683 : case TRUNC_DIV_EXPR:
12302 : 1683 : {
12303 : 1683 : tree _q30 = gimple_assign_rhs1 (_a1);
12304 : 1683 : _q30 = do_valueize (valueize, _q30);
12305 : 1683 : tree _q31 = gimple_assign_rhs2 (_a1);
12306 : 1683 : _q31 = do_valueize (valueize, _q31);
12307 : 1683 : if (integer_all_onesp (_q30))
12308 : : {
12309 : 16 : {
12310 : 16 : tree captures[3] ATTRIBUTE_UNUSED = { _p1, _q31, _p0 };
12311 : 16 : if (gimple_simplify_369 (res_op, seq, valueize, type, captures, GE_EXPR, EQ_EXPR))
12312 : 0 : return true;
12313 : : }
12314 : : }
12315 : : break;
12316 : : }
12317 : : default:;
12318 : : }
12319 : : }
12320 : : break;
12321 : 11933514 : default:;
12322 : : }
12323 : 11933514 : switch (TREE_CODE (_p0))
12324 : : {
12325 : 11447092 : case SSA_NAME:
12326 : 11447092 : if (gimple *_d1 = get_def (valueize, _p0))
12327 : : {
12328 : 3624700 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12329 : 3233727 : switch (gimple_assign_rhs_code (_a1))
12330 : : {
12331 : 57820 : case MULT_EXPR:
12332 : 57820 : {
12333 : 57820 : tree _q20 = gimple_assign_rhs1 (_a1);
12334 : 57820 : _q20 = do_valueize (valueize, _q20);
12335 : 57820 : tree _q21 = gimple_assign_rhs2 (_a1);
12336 : 57820 : _q21 = do_valueize (valueize, _q21);
12337 : 57820 : if (tree_swap_operands_p (_q20, _q21))
12338 : 822 : std::swap (_q20, _q21);
12339 : 57820 : switch (TREE_CODE (_q21))
12340 : : {
12341 : 1710 : case REAL_CST:
12342 : 1710 : {
12343 : 1710 : switch (TREE_CODE (_p1))
12344 : : {
12345 : 1226 : case REAL_CST:
12346 : 1226 : {
12347 : 1226 : {
12348 : 1226 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
12349 : 1226 : if (gimple_simplify_359 (res_op, seq, valueize, type, captures, LE_EXPR, GE_EXPR))
12350 : 0 : return true;
12351 : : }
12352 : 1226 : break;
12353 : : }
12354 : : default:;
12355 : : }
12356 : : break;
12357 : : }
12358 : : default:;
12359 : : }
12360 : 12048600 : break;
12361 : : }
12362 : 673030 : case PLUS_EXPR:
12363 : 673030 : {
12364 : 673030 : tree _q20 = gimple_assign_rhs1 (_a1);
12365 : 673030 : _q20 = do_valueize (valueize, _q20);
12366 : 673030 : tree _q21 = gimple_assign_rhs2 (_a1);
12367 : 673030 : _q21 = do_valueize (valueize, _q21);
12368 : 673030 : if (tree_swap_operands_p (_q20, _q21))
12369 : 12772 : std::swap (_q20, _q21);
12370 : 673030 : switch (TREE_CODE (_q21))
12371 : : {
12372 : 553797 : case INTEGER_CST:
12373 : 553797 : {
12374 : 553797 : switch (TREE_CODE (_p1))
12375 : : {
12376 : 458382 : case INTEGER_CST:
12377 : 458382 : {
12378 : 458382 : {
12379 : 458382 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
12380 : 458382 : if (gimple_simplify_360 (res_op, seq, valueize, type, captures, PLUS_EXPR, MINUS_EXPR, LE_EXPR))
12381 : 12622 : return true;
12382 : : }
12383 : 445760 : break;
12384 : : }
12385 : : default:;
12386 : : }
12387 : : break;
12388 : : }
12389 : : default:;
12390 : : }
12391 : 12048600 : break;
12392 : : }
12393 : 172857 : case MINUS_EXPR:
12394 : 172857 : {
12395 : 172857 : tree _q20 = gimple_assign_rhs1 (_a1);
12396 : 172857 : _q20 = do_valueize (valueize, _q20);
12397 : 172857 : tree _q21 = gimple_assign_rhs2 (_a1);
12398 : 172857 : _q21 = do_valueize (valueize, _q21);
12399 : 172857 : switch (TREE_CODE (_q21))
12400 : : {
12401 : 157 : case INTEGER_CST:
12402 : 157 : {
12403 : 157 : switch (TREE_CODE (_p1))
12404 : : {
12405 : 110 : case INTEGER_CST:
12406 : 110 : {
12407 : 110 : {
12408 : 110 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
12409 : 110 : if (gimple_simplify_360 (res_op, seq, valueize, type, captures, MINUS_EXPR, PLUS_EXPR, LE_EXPR))
12410 : 0 : return true;
12411 : : }
12412 : 110 : break;
12413 : : }
12414 : : default:;
12415 : : }
12416 : : break;
12417 : : }
12418 : : default:;
12419 : : }
12420 : : break;
12421 : : }
12422 : : default:;
12423 : : }
12424 : 1237227 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
12425 : 115961 : switch (gimple_call_combined_fn (_c1))
12426 : : {
12427 : 0 : case CFN_BUILT_IN_CTZ:
12428 : 0 : if (gimple_call_num_args (_c1) == 1)
12429 : : {
12430 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12431 : 0 : _q20 = do_valueize (valueize, _q20);
12432 : 0 : switch (TREE_CODE (_p1))
12433 : : {
12434 : 0 : case INTEGER_CST:
12435 : 0 : {
12436 : 0 : {
12437 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12438 : 0 : if (gimple_simplify_361 (res_op, seq, valueize, type, captures, LE_EXPR, NE_EXPR, CFN_BUILT_IN_CTZ))
12439 : 0 : return true;
12440 : : }
12441 : 0 : break;
12442 : : }
12443 : : default:;
12444 : : }
12445 : : }
12446 : : break;
12447 : 4 : case CFN_BUILT_IN_FFS:
12448 : 4 : if (gimple_call_num_args (_c1) == 1)
12449 : : {
12450 : 4 : tree _q20 = gimple_call_arg (_c1, 0);
12451 : 4 : _q20 = do_valueize (valueize, _q20);
12452 : 4 : switch (TREE_CODE (_p1))
12453 : : {
12454 : 4 : case INTEGER_CST:
12455 : 4 : {
12456 : 4 : {
12457 : 4 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12458 : 4 : if (gimple_simplify_370 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, NE_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_FFS))
12459 : 2 : return true;
12460 : : }
12461 : 2 : break;
12462 : : }
12463 : : default:;
12464 : : }
12465 : : }
12466 : : break;
12467 : 0 : case CFN_BUILT_IN_FFSIMAX:
12468 : 0 : if (gimple_call_num_args (_c1) == 1)
12469 : : {
12470 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12471 : 0 : _q20 = do_valueize (valueize, _q20);
12472 : 0 : switch (TREE_CODE (_p1))
12473 : : {
12474 : 0 : case INTEGER_CST:
12475 : 0 : {
12476 : 0 : {
12477 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12478 : 0 : if (gimple_simplify_370 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, NE_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_FFSIMAX))
12479 : 0 : return true;
12480 : : }
12481 : 0 : break;
12482 : : }
12483 : : default:;
12484 : : }
12485 : : }
12486 : : break;
12487 : 4 : case CFN_BUILT_IN_POPCOUNT:
12488 : 4 : if (gimple_call_num_args (_c1) == 1)
12489 : : {
12490 : 4 : tree _q20 = gimple_call_arg (_c1, 0);
12491 : 4 : _q20 = do_valueize (valueize, _q20);
12492 : 4 : if (integer_zerop (_p1))
12493 : : {
12494 : 0 : {
12495 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
12496 : 0 : if (gimple_simplify_292 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, CFN_BUILT_IN_POPCOUNT))
12497 : 0 : return true;
12498 : : }
12499 : : }
12500 : : }
12501 : : break;
12502 : 15 : case CFN_BUILT_IN_CTZL:
12503 : 15 : if (gimple_call_num_args (_c1) == 1)
12504 : : {
12505 : 15 : tree _q20 = gimple_call_arg (_c1, 0);
12506 : 15 : _q20 = do_valueize (valueize, _q20);
12507 : 15 : switch (TREE_CODE (_p1))
12508 : : {
12509 : 15 : case INTEGER_CST:
12510 : 15 : {
12511 : 15 : {
12512 : 15 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12513 : 15 : if (gimple_simplify_361 (res_op, seq, valueize, type, captures, LE_EXPR, NE_EXPR, CFN_BUILT_IN_CTZL))
12514 : 0 : return true;
12515 : : }
12516 : 15 : break;
12517 : : }
12518 : : default:;
12519 : : }
12520 : : }
12521 : : break;
12522 : 0 : case CFN_BUILT_IN_FFSL:
12523 : 0 : if (gimple_call_num_args (_c1) == 1)
12524 : : {
12525 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12526 : 0 : _q20 = do_valueize (valueize, _q20);
12527 : 0 : switch (TREE_CODE (_p1))
12528 : : {
12529 : 0 : case INTEGER_CST:
12530 : 0 : {
12531 : 0 : {
12532 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12533 : 0 : if (gimple_simplify_370 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, NE_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_FFSL))
12534 : 0 : return true;
12535 : : }
12536 : 0 : break;
12537 : : }
12538 : : default:;
12539 : : }
12540 : : }
12541 : : break;
12542 : 0 : case CFN_BUILT_IN_POPCOUNTLL:
12543 : 0 : if (gimple_call_num_args (_c1) == 1)
12544 : : {
12545 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12546 : 0 : _q20 = do_valueize (valueize, _q20);
12547 : 0 : if (integer_zerop (_p1))
12548 : : {
12549 : 0 : {
12550 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
12551 : 0 : if (gimple_simplify_292 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, CFN_BUILT_IN_POPCOUNTLL))
12552 : 0 : return true;
12553 : : }
12554 : : }
12555 : : }
12556 : : break;
12557 : 0 : case CFN_BUILT_IN_CTZIMAX:
12558 : 0 : if (gimple_call_num_args (_c1) == 1)
12559 : : {
12560 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12561 : 0 : _q20 = do_valueize (valueize, _q20);
12562 : 0 : switch (TREE_CODE (_p1))
12563 : : {
12564 : 0 : case INTEGER_CST:
12565 : 0 : {
12566 : 0 : {
12567 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12568 : 0 : if (gimple_simplify_361 (res_op, seq, valueize, type, captures, LE_EXPR, NE_EXPR, CFN_BUILT_IN_CTZIMAX))
12569 : 0 : return true;
12570 : : }
12571 : 0 : break;
12572 : : }
12573 : : default:;
12574 : : }
12575 : : }
12576 : : break;
12577 : 0 : case CFN_POPCOUNT:
12578 : 0 : if (gimple_call_num_args (_c1) == 1)
12579 : : {
12580 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12581 : 0 : _q20 = do_valueize (valueize, _q20);
12582 : 0 : if (integer_zerop (_p1))
12583 : : {
12584 : 0 : {
12585 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
12586 : 0 : if (gimple_simplify_292 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, CFN_POPCOUNT))
12587 : 0 : return true;
12588 : : }
12589 : : }
12590 : : }
12591 : : break;
12592 : 0 : case CFN_CTZ:
12593 : 0 : if (gimple_call_num_args (_c1) == 2)
12594 : : {
12595 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12596 : 0 : _q20 = do_valueize (valueize, _q20);
12597 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
12598 : 0 : _q21 = do_valueize (valueize, _q21);
12599 : 0 : switch (TREE_CODE (_p1))
12600 : : {
12601 : 0 : case INTEGER_CST:
12602 : 0 : {
12603 : 0 : {
12604 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _p1 };
12605 : 0 : if (gimple_simplify_362 (res_op, seq, valueize, type, captures, LE_EXPR, NE_EXPR))
12606 : 0 : return true;
12607 : : }
12608 : 0 : break;
12609 : : }
12610 : : default:;
12611 : : }
12612 : : }
12613 : 0 : if (gimple_call_num_args (_c1) == 1)
12614 : : {
12615 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12616 : 0 : _q20 = do_valueize (valueize, _q20);
12617 : 0 : switch (TREE_CODE (_p1))
12618 : : {
12619 : 0 : case INTEGER_CST:
12620 : 0 : {
12621 : 0 : {
12622 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12623 : 0 : if (gimple_simplify_361 (res_op, seq, valueize, type, captures, LE_EXPR, NE_EXPR, CFN_CTZ))
12624 : 0 : return true;
12625 : : }
12626 : 0 : break;
12627 : : }
12628 : : default:;
12629 : : }
12630 : : }
12631 : : break;
12632 : 0 : case CFN_FFS:
12633 : 0 : if (gimple_call_num_args (_c1) == 1)
12634 : : {
12635 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12636 : 0 : _q20 = do_valueize (valueize, _q20);
12637 : 0 : switch (TREE_CODE (_p1))
12638 : : {
12639 : 0 : case INTEGER_CST:
12640 : 0 : {
12641 : 0 : {
12642 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12643 : 0 : if (gimple_simplify_370 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, NE_EXPR, BIT_IOR_EXPR, CFN_FFS))
12644 : 0 : return true;
12645 : : }
12646 : 0 : break;
12647 : : }
12648 : : default:;
12649 : : }
12650 : : }
12651 : : break;
12652 : 0 : case CFN_BUILT_IN_POPCOUNTIMAX:
12653 : 0 : if (gimple_call_num_args (_c1) == 1)
12654 : : {
12655 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12656 : 0 : _q20 = do_valueize (valueize, _q20);
12657 : 0 : if (integer_zerop (_p1))
12658 : : {
12659 : 0 : {
12660 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
12661 : 0 : if (gimple_simplify_292 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, CFN_BUILT_IN_POPCOUNTIMAX))
12662 : 0 : return true;
12663 : : }
12664 : : }
12665 : : }
12666 : : break;
12667 : 0 : case CFN_BUILT_IN_POPCOUNTL:
12668 : 0 : if (gimple_call_num_args (_c1) == 1)
12669 : : {
12670 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12671 : 0 : _q20 = do_valueize (valueize, _q20);
12672 : 0 : if (integer_zerop (_p1))
12673 : : {
12674 : 0 : {
12675 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
12676 : 0 : if (gimple_simplify_292 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, CFN_BUILT_IN_POPCOUNTL))
12677 : 0 : return true;
12678 : : }
12679 : : }
12680 : : }
12681 : : break;
12682 : 0 : case CFN_BUILT_IN_CTZLL:
12683 : 0 : if (gimple_call_num_args (_c1) == 1)
12684 : : {
12685 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12686 : 0 : _q20 = do_valueize (valueize, _q20);
12687 : 0 : switch (TREE_CODE (_p1))
12688 : : {
12689 : 0 : case INTEGER_CST:
12690 : 0 : {
12691 : 0 : {
12692 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12693 : 0 : if (gimple_simplify_361 (res_op, seq, valueize, type, captures, LE_EXPR, NE_EXPR, CFN_BUILT_IN_CTZLL))
12694 : 0 : return true;
12695 : : }
12696 : 0 : break;
12697 : : }
12698 : : default:;
12699 : : }
12700 : : }
12701 : : break;
12702 : 0 : case CFN_BUILT_IN_FFSLL:
12703 : 0 : if (gimple_call_num_args (_c1) == 1)
12704 : : {
12705 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
12706 : 0 : _q20 = do_valueize (valueize, _q20);
12707 : 0 : switch (TREE_CODE (_p1))
12708 : : {
12709 : 0 : case INTEGER_CST:
12710 : 0 : {
12711 : 0 : {
12712 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _p1 };
12713 : 0 : if (gimple_simplify_370 (res_op, seq, valueize, type, captures, LE_EXPR, EQ_EXPR, NE_EXPR, BIT_IOR_EXPR, CFN_BUILT_IN_FFSLL))
12714 : 0 : return true;
12715 : : }
12716 : 0 : break;
12717 : : }
12718 : : default:;
12719 : : }
12720 : : }
12721 : : break;
12722 : : default:;
12723 : : }
12724 : : }
12725 : : break;
12726 : : default:;
12727 : : }
12728 : : return false;
12729 : : }
12730 : :
12731 : : bool
12732 : 500 : gimple_simplify_CEIL_MOD_EXPR (gimple_match_op *res_op, gimple_seq *seq,
12733 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
12734 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
12735 : : {
12736 : 500 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
12737 : 500 : if (integer_zerop (_p0))
12738 : : {
12739 : 0 : {
12740 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
12741 : 0 : if (gimple_simplify_319 (res_op, seq, valueize, type, captures, CEIL_MOD_EXPR))
12742 : 0 : return true;
12743 : : }
12744 : : }
12745 : 500 : if (integer_onep (_p1))
12746 : : {
12747 : 0 : {
12748 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
12749 : 0 : if (gimple_simplify_320 (res_op, seq, valueize, type, captures, CEIL_MOD_EXPR))
12750 : 0 : return true;
12751 : : }
12752 : : }
12753 : 500 : if (integer_minus_onep (_p1))
12754 : : {
12755 : 0 : {
12756 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
12757 : 0 : if (gimple_simplify_321 (res_op, seq, valueize, type, captures, CEIL_MOD_EXPR))
12758 : 0 : return true;
12759 : : }
12760 : : }
12761 : 500 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
12762 : : {
12763 : 0 : {
12764 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
12765 : 0 : if (gimple_simplify_322 (res_op, seq, valueize, type, captures, CEIL_MOD_EXPR))
12766 : 0 : return true;
12767 : : }
12768 : : }
12769 : 500 : switch (TREE_CODE (_p0))
12770 : : {
12771 : 408 : case SSA_NAME:
12772 : 408 : if (gimple *_d1 = get_def (valueize, _p0))
12773 : : {
12774 : 300 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12775 : 96 : switch (gimple_assign_rhs_code (_a1))
12776 : : {
12777 : 0 : case CEIL_MOD_EXPR:
12778 : 0 : {
12779 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
12780 : 0 : _q20 = do_valueize (valueize, _q20);
12781 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
12782 : 0 : _q21 = do_valueize (valueize, _q21);
12783 : 0 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
12784 : : {
12785 : 0 : {
12786 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
12787 : 0 : if (gimple_simplify_323 (res_op, seq, valueize, type, captures, CEIL_MOD_EXPR))
12788 : 0 : return true;
12789 : : }
12790 : : }
12791 : : break;
12792 : : }
12793 : 0 : case MULT_EXPR:
12794 : 0 : {
12795 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
12796 : 0 : _q20 = do_valueize (valueize, _q20);
12797 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
12798 : 0 : _q21 = do_valueize (valueize, _q21);
12799 : 0 : if (tree_swap_operands_p (_q20, _q21))
12800 : 0 : std::swap (_q20, _q21);
12801 : 0 : switch (TREE_CODE (_q21))
12802 : : {
12803 : 0 : case INTEGER_CST:
12804 : 0 : {
12805 : 0 : switch (TREE_CODE (_p1))
12806 : : {
12807 : 0 : case INTEGER_CST:
12808 : 0 : {
12809 : 0 : {
12810 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
12811 : 0 : if (gimple_simplify_324 (res_op, seq, valueize, type, captures, CEIL_MOD_EXPR))
12812 : 0 : return true;
12813 : : }
12814 : 0 : break;
12815 : : }
12816 : : default:;
12817 : : }
12818 : : break;
12819 : : }
12820 : : default:;
12821 : : }
12822 : 500 : break;
12823 : : }
12824 : 0 : case VEC_COND_EXPR:
12825 : 0 : {
12826 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
12827 : 0 : _q20 = do_valueize (valueize, _q20);
12828 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
12829 : 0 : _q21 = do_valueize (valueize, _q21);
12830 : 0 : tree _q22 = gimple_assign_rhs3 (_a1);
12831 : 0 : _q22 = do_valueize (valueize, _q22);
12832 : 0 : switch (TREE_CODE (_p1))
12833 : : {
12834 : 0 : case SSA_NAME:
12835 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
12836 : : {
12837 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
12838 : 0 : switch (gimple_assign_rhs_code (_a2))
12839 : : {
12840 : 0 : case VEC_COND_EXPR:
12841 : 0 : {
12842 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
12843 : 0 : _q60 = do_valueize (valueize, _q60);
12844 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
12845 : 0 : _q61 = do_valueize (valueize, _q61);
12846 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
12847 : 0 : _q62 = do_valueize (valueize, _q62);
12848 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
12849 : : {
12850 : 0 : {
12851 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
12852 : 0 : if (TREE_CODE_CLASS (CEIL_MOD_EXPR) != tcc_comparison
12853 : : || types_match (type, TREE_TYPE (captures[2]))
12854 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
12855 : : || (optimize_vectors_before_lowering_p ()
12856 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
12857 : : TREE_TYPE (captures[1]), ERROR_MARK))
12858 : : )
12859 : : {
12860 : 0 : gimple_seq *lseq = seq;
12861 : 0 : if (lseq
12862 : 0 : && (!single_use (captures[0])
12863 : 0 : || !single_use (captures[4])))
12864 : 0 : lseq = NULL;
12865 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1957;
12866 : 0 : {
12867 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
12868 : 0 : res_op->ops[0] = captures[1];
12869 : 0 : {
12870 : 0 : tree _o1[2], _r1;
12871 : 0 : _o1[0] = captures[2];
12872 : 0 : _o1[1] = captures[5];
12873 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CEIL_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
12874 : 0 : tem_op.resimplify (NULL, valueize);
12875 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
12876 : 0 : if (!_r1) goto next_after_fail1957;
12877 : 0 : res_op->ops[1] = _r1;
12878 : : }
12879 : 0 : {
12880 : 0 : tree _o1[2], _r1;
12881 : 0 : _o1[0] = captures[3];
12882 : 0 : _o1[1] = captures[6];
12883 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CEIL_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
12884 : 0 : tem_op.resimplify (NULL, valueize);
12885 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
12886 : 0 : if (!_r1) goto next_after_fail1957;
12887 : 0 : res_op->ops[2] = _r1;
12888 : : }
12889 : 0 : res_op->resimplify (lseq, valueize);
12890 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
12891 : 0 : return true;
12892 : : }
12893 : 0 : next_after_fail1957:;
12894 : : }
12895 : : }
12896 : : }
12897 : : break;
12898 : : }
12899 : : default:;
12900 : : }
12901 : : }
12902 : : break;
12903 : 0 : default:;
12904 : : }
12905 : 0 : {
12906 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
12907 : 0 : if (TREE_CODE_CLASS (CEIL_MOD_EXPR) != tcc_comparison
12908 : : || types_match (type, TREE_TYPE (captures[2]))
12909 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
12910 : : || (optimize_vectors_before_lowering_p ()
12911 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
12912 : : TREE_TYPE (captures[1]), ERROR_MARK))
12913 : : )
12914 : : {
12915 : 0 : gimple_seq *lseq = seq;
12916 : 0 : if (lseq
12917 : 0 : && (!single_use (captures[0])))
12918 : 0 : lseq = NULL;
12919 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1958;
12920 : 0 : {
12921 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
12922 : 0 : res_op->ops[0] = captures[1];
12923 : 0 : {
12924 : 0 : tree _o1[2], _r1;
12925 : 0 : _o1[0] = captures[2];
12926 : 0 : _o1[1] = captures[4];
12927 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CEIL_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
12928 : 0 : tem_op.resimplify (NULL, valueize);
12929 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
12930 : 0 : if (!_r1) goto next_after_fail1958;
12931 : 0 : res_op->ops[1] = _r1;
12932 : : }
12933 : 0 : {
12934 : 0 : tree _o1[2], _r1;
12935 : 0 : _o1[0] = captures[3];
12936 : 0 : _o1[1] = captures[4];
12937 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CEIL_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
12938 : 0 : tem_op.resimplify (NULL, valueize);
12939 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
12940 : 0 : if (!_r1) goto next_after_fail1958;
12941 : 0 : res_op->ops[2] = _r1;
12942 : : }
12943 : 0 : res_op->resimplify (lseq, valueize);
12944 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
12945 : 0 : return true;
12946 : : }
12947 : 0 : next_after_fail1958:;
12948 : : }
12949 : : }
12950 : 0 : break;
12951 : : }
12952 : : default:;
12953 : : }
12954 : : }
12955 : : break;
12956 : 500 : default:;
12957 : : }
12958 : 500 : switch (TREE_CODE (_p1))
12959 : : {
12960 : 396 : case SSA_NAME:
12961 : 396 : if (gimple *_d1 = get_def (valueize, _p1))
12962 : : {
12963 : 300 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
12964 : 252 : switch (gimple_assign_rhs_code (_a1))
12965 : : {
12966 : 0 : case VEC_COND_EXPR:
12967 : 0 : {
12968 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
12969 : 0 : _q30 = do_valueize (valueize, _q30);
12970 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
12971 : 0 : _q31 = do_valueize (valueize, _q31);
12972 : 0 : tree _q32 = gimple_assign_rhs3 (_a1);
12973 : 0 : _q32 = do_valueize (valueize, _q32);
12974 : 0 : {
12975 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
12976 : 0 : if (TREE_CODE_CLASS (CEIL_MOD_EXPR) != tcc_comparison
12977 : : || types_match (type, TREE_TYPE (captures[3]))
12978 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
12979 : : || (optimize_vectors_before_lowering_p ()
12980 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
12981 : : TREE_TYPE (captures[2]), ERROR_MARK))
12982 : : )
12983 : : {
12984 : 0 : gimple_seq *lseq = seq;
12985 : 0 : if (lseq
12986 : 0 : && (!single_use (captures[1])))
12987 : 0 : lseq = NULL;
12988 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1959;
12989 : 0 : {
12990 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
12991 : 0 : res_op->ops[0] = captures[2];
12992 : 0 : {
12993 : 0 : tree _o1[2], _r1;
12994 : 0 : _o1[0] = captures[0];
12995 : 0 : _o1[1] = captures[3];
12996 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CEIL_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
12997 : 0 : tem_op.resimplify (NULL, valueize);
12998 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
12999 : 0 : if (!_r1) goto next_after_fail1959;
13000 : 0 : res_op->ops[1] = _r1;
13001 : : }
13002 : 0 : {
13003 : 0 : tree _o1[2], _r1;
13004 : 0 : _o1[0] = captures[0];
13005 : 0 : _o1[1] = captures[4];
13006 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), CEIL_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13007 : 0 : tem_op.resimplify (NULL, valueize);
13008 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13009 : 0 : if (!_r1) goto next_after_fail1959;
13010 : 0 : res_op->ops[2] = _r1;
13011 : : }
13012 : 0 : res_op->resimplify (lseq, valueize);
13013 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
13014 : 0 : return true;
13015 : : }
13016 : 0 : next_after_fail1959:;
13017 : : }
13018 : : }
13019 : 0 : break;
13020 : : }
13021 : : default:;
13022 : : }
13023 : : }
13024 : : break;
13025 : : default:;
13026 : : }
13027 : : return false;
13028 : : }
13029 : :
13030 : : bool
13031 : 0 : gimple_simplify_ROUND_MOD_EXPR (gimple_match_op *res_op, gimple_seq *seq,
13032 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
13033 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
13034 : : {
13035 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
13036 : 0 : if (integer_zerop (_p0))
13037 : : {
13038 : 0 : {
13039 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
13040 : 0 : if (gimple_simplify_319 (res_op, seq, valueize, type, captures, ROUND_MOD_EXPR))
13041 : 0 : return true;
13042 : : }
13043 : : }
13044 : 0 : if (integer_onep (_p1))
13045 : : {
13046 : 0 : {
13047 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
13048 : 0 : if (gimple_simplify_320 (res_op, seq, valueize, type, captures, ROUND_MOD_EXPR))
13049 : 0 : return true;
13050 : : }
13051 : : }
13052 : 0 : if (integer_minus_onep (_p1))
13053 : : {
13054 : 0 : {
13055 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
13056 : 0 : if (gimple_simplify_321 (res_op, seq, valueize, type, captures, ROUND_MOD_EXPR))
13057 : 0 : return true;
13058 : : }
13059 : : }
13060 : 0 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
13061 : : {
13062 : 0 : {
13063 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
13064 : 0 : if (gimple_simplify_322 (res_op, seq, valueize, type, captures, ROUND_MOD_EXPR))
13065 : 0 : return true;
13066 : : }
13067 : : }
13068 : 0 : switch (TREE_CODE (_p0))
13069 : : {
13070 : 0 : case SSA_NAME:
13071 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
13072 : : {
13073 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13074 : 0 : switch (gimple_assign_rhs_code (_a1))
13075 : : {
13076 : 0 : case ROUND_MOD_EXPR:
13077 : 0 : {
13078 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
13079 : 0 : _q20 = do_valueize (valueize, _q20);
13080 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
13081 : 0 : _q21 = do_valueize (valueize, _q21);
13082 : 0 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
13083 : : {
13084 : 0 : {
13085 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
13086 : 0 : if (gimple_simplify_323 (res_op, seq, valueize, type, captures, ROUND_MOD_EXPR))
13087 : 0 : return true;
13088 : : }
13089 : : }
13090 : : break;
13091 : : }
13092 : 0 : case MULT_EXPR:
13093 : 0 : {
13094 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
13095 : 0 : _q20 = do_valueize (valueize, _q20);
13096 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
13097 : 0 : _q21 = do_valueize (valueize, _q21);
13098 : 0 : if (tree_swap_operands_p (_q20, _q21))
13099 : 0 : std::swap (_q20, _q21);
13100 : 0 : switch (TREE_CODE (_q21))
13101 : : {
13102 : 0 : case INTEGER_CST:
13103 : 0 : {
13104 : 0 : switch (TREE_CODE (_p1))
13105 : : {
13106 : 0 : case INTEGER_CST:
13107 : 0 : {
13108 : 0 : {
13109 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
13110 : 0 : if (gimple_simplify_324 (res_op, seq, valueize, type, captures, ROUND_MOD_EXPR))
13111 : 0 : return true;
13112 : : }
13113 : 0 : break;
13114 : : }
13115 : : default:;
13116 : : }
13117 : : break;
13118 : : }
13119 : : default:;
13120 : : }
13121 : 0 : break;
13122 : : }
13123 : 0 : case VEC_COND_EXPR:
13124 : 0 : {
13125 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
13126 : 0 : _q20 = do_valueize (valueize, _q20);
13127 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
13128 : 0 : _q21 = do_valueize (valueize, _q21);
13129 : 0 : tree _q22 = gimple_assign_rhs3 (_a1);
13130 : 0 : _q22 = do_valueize (valueize, _q22);
13131 : 0 : switch (TREE_CODE (_p1))
13132 : : {
13133 : 0 : case SSA_NAME:
13134 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
13135 : : {
13136 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
13137 : 0 : switch (gimple_assign_rhs_code (_a2))
13138 : : {
13139 : 0 : case VEC_COND_EXPR:
13140 : 0 : {
13141 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
13142 : 0 : _q60 = do_valueize (valueize, _q60);
13143 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
13144 : 0 : _q61 = do_valueize (valueize, _q61);
13145 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
13146 : 0 : _q62 = do_valueize (valueize, _q62);
13147 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
13148 : : {
13149 : 0 : {
13150 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
13151 : 0 : if (TREE_CODE_CLASS (ROUND_MOD_EXPR) != tcc_comparison
13152 : : || types_match (type, TREE_TYPE (captures[2]))
13153 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
13154 : : || (optimize_vectors_before_lowering_p ()
13155 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
13156 : : TREE_TYPE (captures[1]), ERROR_MARK))
13157 : : )
13158 : : {
13159 : 0 : gimple_seq *lseq = seq;
13160 : 0 : if (lseq
13161 : 0 : && (!single_use (captures[0])
13162 : 0 : || !single_use (captures[4])))
13163 : 0 : lseq = NULL;
13164 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1960;
13165 : 0 : {
13166 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
13167 : 0 : res_op->ops[0] = captures[1];
13168 : 0 : {
13169 : 0 : tree _o1[2], _r1;
13170 : 0 : _o1[0] = captures[2];
13171 : 0 : _o1[1] = captures[5];
13172 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), ROUND_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13173 : 0 : tem_op.resimplify (NULL, valueize);
13174 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13175 : 0 : if (!_r1) goto next_after_fail1960;
13176 : 0 : res_op->ops[1] = _r1;
13177 : : }
13178 : 0 : {
13179 : 0 : tree _o1[2], _r1;
13180 : 0 : _o1[0] = captures[3];
13181 : 0 : _o1[1] = captures[6];
13182 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), ROUND_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13183 : 0 : tem_op.resimplify (NULL, valueize);
13184 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13185 : 0 : if (!_r1) goto next_after_fail1960;
13186 : 0 : res_op->ops[2] = _r1;
13187 : : }
13188 : 0 : res_op->resimplify (lseq, valueize);
13189 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
13190 : 0 : return true;
13191 : : }
13192 : 0 : next_after_fail1960:;
13193 : : }
13194 : : }
13195 : : }
13196 : : break;
13197 : : }
13198 : : default:;
13199 : : }
13200 : : }
13201 : : break;
13202 : 0 : default:;
13203 : : }
13204 : 0 : {
13205 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
13206 : 0 : if (TREE_CODE_CLASS (ROUND_MOD_EXPR) != tcc_comparison
13207 : : || types_match (type, TREE_TYPE (captures[2]))
13208 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
13209 : : || (optimize_vectors_before_lowering_p ()
13210 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
13211 : : TREE_TYPE (captures[1]), ERROR_MARK))
13212 : : )
13213 : : {
13214 : 0 : gimple_seq *lseq = seq;
13215 : 0 : if (lseq
13216 : 0 : && (!single_use (captures[0])))
13217 : 0 : lseq = NULL;
13218 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1961;
13219 : 0 : {
13220 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
13221 : 0 : res_op->ops[0] = captures[1];
13222 : 0 : {
13223 : 0 : tree _o1[2], _r1;
13224 : 0 : _o1[0] = captures[2];
13225 : 0 : _o1[1] = captures[4];
13226 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), ROUND_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13227 : 0 : tem_op.resimplify (NULL, valueize);
13228 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13229 : 0 : if (!_r1) goto next_after_fail1961;
13230 : 0 : res_op->ops[1] = _r1;
13231 : : }
13232 : 0 : {
13233 : 0 : tree _o1[2], _r1;
13234 : 0 : _o1[0] = captures[3];
13235 : 0 : _o1[1] = captures[4];
13236 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), ROUND_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13237 : 0 : tem_op.resimplify (NULL, valueize);
13238 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13239 : 0 : if (!_r1) goto next_after_fail1961;
13240 : 0 : res_op->ops[2] = _r1;
13241 : : }
13242 : 0 : res_op->resimplify (lseq, valueize);
13243 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
13244 : 0 : return true;
13245 : : }
13246 : 0 : next_after_fail1961:;
13247 : : }
13248 : : }
13249 : 0 : break;
13250 : : }
13251 : : default:;
13252 : : }
13253 : : }
13254 : : break;
13255 : 0 : default:;
13256 : : }
13257 : 0 : switch (TREE_CODE (_p1))
13258 : : {
13259 : 0 : case SSA_NAME:
13260 : 0 : if (gimple *_d1 = get_def (valueize, _p1))
13261 : : {
13262 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13263 : 0 : switch (gimple_assign_rhs_code (_a1))
13264 : : {
13265 : 0 : case VEC_COND_EXPR:
13266 : 0 : {
13267 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
13268 : 0 : _q30 = do_valueize (valueize, _q30);
13269 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
13270 : 0 : _q31 = do_valueize (valueize, _q31);
13271 : 0 : tree _q32 = gimple_assign_rhs3 (_a1);
13272 : 0 : _q32 = do_valueize (valueize, _q32);
13273 : 0 : {
13274 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
13275 : 0 : if (TREE_CODE_CLASS (ROUND_MOD_EXPR) != tcc_comparison
13276 : : || types_match (type, TREE_TYPE (captures[3]))
13277 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
13278 : : || (optimize_vectors_before_lowering_p ()
13279 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
13280 : : TREE_TYPE (captures[2]), ERROR_MARK))
13281 : : )
13282 : : {
13283 : 0 : gimple_seq *lseq = seq;
13284 : 0 : if (lseq
13285 : 0 : && (!single_use (captures[1])))
13286 : 0 : lseq = NULL;
13287 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1962;
13288 : 0 : {
13289 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
13290 : 0 : res_op->ops[0] = captures[2];
13291 : 0 : {
13292 : 0 : tree _o1[2], _r1;
13293 : 0 : _o1[0] = captures[0];
13294 : 0 : _o1[1] = captures[3];
13295 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), ROUND_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13296 : 0 : tem_op.resimplify (NULL, valueize);
13297 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13298 : 0 : if (!_r1) goto next_after_fail1962;
13299 : 0 : res_op->ops[1] = _r1;
13300 : : }
13301 : 0 : {
13302 : 0 : tree _o1[2], _r1;
13303 : 0 : _o1[0] = captures[0];
13304 : 0 : _o1[1] = captures[4];
13305 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), ROUND_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13306 : 0 : tem_op.resimplify (NULL, valueize);
13307 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13308 : 0 : if (!_r1) goto next_after_fail1962;
13309 : 0 : res_op->ops[2] = _r1;
13310 : : }
13311 : 0 : res_op->resimplify (lseq, valueize);
13312 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
13313 : 0 : return true;
13314 : : }
13315 : 0 : next_after_fail1962:;
13316 : : }
13317 : : }
13318 : 0 : break;
13319 : : }
13320 : : default:;
13321 : : }
13322 : : }
13323 : : break;
13324 : : default:;
13325 : : }
13326 : : return false;
13327 : : }
13328 : :
13329 : : bool
13330 : 1564541 : gimple_simplify_TRUNC_MOD_EXPR (gimple_match_op *res_op, gimple_seq *seq,
13331 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
13332 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
13333 : : {
13334 : 1564541 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
13335 : 1564541 : if (integer_zerop (_p0))
13336 : : {
13337 : 23547 : {
13338 : 23547 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
13339 : 23547 : if (gimple_simplify_319 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13340 : 23173 : return true;
13341 : : }
13342 : : }
13343 : 1541368 : if (integer_onep (_p1))
13344 : : {
13345 : 1882 : {
13346 : 1882 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
13347 : 1882 : if (gimple_simplify_320 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13348 : 1882 : return true;
13349 : : }
13350 : : }
13351 : 1539486 : if (integer_minus_onep (_p1))
13352 : : {
13353 : 290 : {
13354 : 290 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
13355 : 290 : if (gimple_simplify_321 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13356 : 30 : return true;
13357 : : }
13358 : : }
13359 : 1539456 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
13360 : : {
13361 : 407 : {
13362 : 407 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
13363 : 407 : if (gimple_simplify_322 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13364 : 33 : return true;
13365 : : }
13366 : : }
13367 : 1539423 : switch (TREE_CODE (_p0))
13368 : : {
13369 : 1432073 : case SSA_NAME:
13370 : 1432073 : if (gimple *_d1 = get_def (valueize, _p0))
13371 : : {
13372 : 706917 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13373 : 623980 : switch (gimple_assign_rhs_code (_a1))
13374 : : {
13375 : 5682 : case TRUNC_MOD_EXPR:
13376 : 5682 : {
13377 : 5682 : tree _q20 = gimple_assign_rhs1 (_a1);
13378 : 5682 : _q20 = do_valueize (valueize, _q20);
13379 : 5682 : tree _q21 = gimple_assign_rhs2 (_a1);
13380 : 5682 : _q21 = do_valueize (valueize, _q21);
13381 : 5682 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
13382 : : {
13383 : 77 : {
13384 : 77 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
13385 : 77 : if (gimple_simplify_323 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13386 : 77 : return true;
13387 : : }
13388 : : }
13389 : : break;
13390 : : }
13391 : 29054 : case MULT_EXPR:
13392 : 29054 : {
13393 : 29054 : tree _q20 = gimple_assign_rhs1 (_a1);
13394 : 29054 : _q20 = do_valueize (valueize, _q20);
13395 : 29054 : tree _q21 = gimple_assign_rhs2 (_a1);
13396 : 29054 : _q21 = do_valueize (valueize, _q21);
13397 : 29054 : if (tree_swap_operands_p (_q20, _q21))
13398 : 577 : std::swap (_q20, _q21);
13399 : 29054 : switch (TREE_CODE (_q21))
13400 : : {
13401 : 16031 : case INTEGER_CST:
13402 : 16031 : {
13403 : 16031 : switch (TREE_CODE (_p1))
13404 : : {
13405 : 10533 : case INTEGER_CST:
13406 : 10533 : {
13407 : 10533 : {
13408 : 10533 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
13409 : 10533 : if (gimple_simplify_324 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13410 : 26 : return true;
13411 : : }
13412 : 10507 : break;
13413 : : }
13414 : : default:;
13415 : : }
13416 : : break;
13417 : : }
13418 : : default:;
13419 : : }
13420 : 1539320 : break;
13421 : : }
13422 : : default:;
13423 : : }
13424 : : }
13425 : : break;
13426 : 1539320 : default:;
13427 : : }
13428 : 1539320 : switch (TREE_CODE (_p1))
13429 : : {
13430 : 903781 : case SSA_NAME:
13431 : 903781 : if (gimple *_d1 = get_def (valueize, _p1))
13432 : : {
13433 : 705615 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13434 : 1064261 : switch (gimple_assign_rhs_code (_a1))
13435 : : {
13436 : 140787 : CASE_CONVERT:
13437 : 140787 : {
13438 : 140787 : tree _q30 = gimple_assign_rhs1 (_a1);
13439 : 140787 : _q30 = do_valueize (valueize, _q30);
13440 : 140787 : switch (TREE_CODE (_q30))
13441 : : {
13442 : 140787 : case SSA_NAME:
13443 : 140787 : if (gimple *_d2 = get_def (valueize, _q30))
13444 : : {
13445 : 139636 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
13446 : 99089 : switch (gimple_assign_rhs_code (_a2))
13447 : : {
13448 : 87 : case NEGATE_EXPR:
13449 : 87 : {
13450 : 87 : tree _q40 = gimple_assign_rhs1 (_a2);
13451 : 87 : _q40 = do_valueize (valueize, _q40);
13452 : 87 : {
13453 : 87 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q40 };
13454 : 87 : if (gimple_simplify_371 (res_op, seq, valueize, type, captures))
13455 : 0 : return true;
13456 : : }
13457 : 87 : break;
13458 : : }
13459 : : default:;
13460 : : }
13461 : : }
13462 : : break;
13463 : 140787 : default:;
13464 : : }
13465 : 140787 : {
13466 : 140787 : tree _q30_pops[1];
13467 : 140787 : if (gimple_power_of_two_cand (_q30, _q30_pops, valueize))
13468 : : {
13469 : 108 : tree _q40 = _q30_pops[0];
13470 : 108 : {
13471 : 108 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q40 };
13472 : 108 : if (gimple_simplify_325 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13473 : 0 : return true;
13474 : : }
13475 : : }
13476 : : }
13477 : 140787 : break;
13478 : : }
13479 : 884 : case NEGATE_EXPR:
13480 : 884 : {
13481 : 884 : tree _q30 = gimple_assign_rhs1 (_a1);
13482 : 884 : _q30 = do_valueize (valueize, _q30);
13483 : 884 : {
13484 : 884 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
13485 : 884 : if (gimple_simplify_371 (res_op, seq, valueize, type, captures))
13486 : 17 : return true;
13487 : : }
13488 : 867 : break;
13489 : : }
13490 : : default:;
13491 : : }
13492 : : }
13493 : : break;
13494 : 622838 : case INTEGER_CST:
13495 : 622838 : {
13496 : 622838 : {
13497 : 622838 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
13498 : 622838 : if (TYPE_SIGN (type) == SIGNED
13499 : 350807 : && !TREE_OVERFLOW (captures[1])
13500 : 623415 : && wi::neg_p (wi::to_wide (captures[1]))
13501 : 923 : && !TYPE_OVERFLOW_TRAPS (type)
13502 : 623761 : && !sign_bit_p (captures[1], captures[1])
13503 : : )
13504 : : {
13505 : 346 : gimple_seq *lseq = seq;
13506 : 346 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1963;
13507 : 346 : {
13508 : 346 : res_op->set_op (TRUNC_MOD_EXPR, type, 2);
13509 : 346 : res_op->ops[0] = captures[0];
13510 : 346 : {
13511 : 346 : tree _o1[1], _r1;
13512 : 346 : _o1[0] = captures[1];
13513 : 346 : gimple_match_op tem_op (res_op->cond.any_else (), NEGATE_EXPR, TREE_TYPE (_o1[0]), _o1[0]);
13514 : 346 : tem_op.resimplify (lseq, valueize);
13515 : 346 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
13516 : 346 : if (!_r1) goto next_after_fail1963;
13517 : 346 : res_op->ops[1] = _r1;
13518 : : }
13519 : 346 : res_op->resimplify (lseq, valueize);
13520 : 346 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1033, __FILE__, __LINE__, true);
13521 : 346 : return true;
13522 : : }
13523 : 622492 : next_after_fail1963:;
13524 : : }
13525 : : }
13526 : 622492 : break;
13527 : : }
13528 : 1538957 : default:;
13529 : : }
13530 : 1538957 : {
13531 : 1538957 : tree _p1_pops[1];
13532 : 1538957 : if (gimple_power_of_two_cand (_p1, _p1_pops, valueize))
13533 : : {
13534 : 622599 : tree _q30 = _p1_pops[0];
13535 : 622599 : {
13536 : 622599 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p1, _q30 };
13537 : 622599 : if (gimple_simplify_325 (res_op, seq, valueize, type, captures, TRUNC_MOD_EXPR))
13538 : 1751 : return true;
13539 : : }
13540 : : }
13541 : : }
13542 : 1537206 : switch (TREE_CODE (_p0))
13543 : : {
13544 : 1429856 : case SSA_NAME:
13545 : 1429856 : if (gimple *_d1 = get_def (valueize, _p0))
13546 : : {
13547 : 705778 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13548 : 622629 : switch (gimple_assign_rhs_code (_a1))
13549 : : {
13550 : 4 : case VEC_COND_EXPR:
13551 : 4 : {
13552 : 4 : tree _q20 = gimple_assign_rhs1 (_a1);
13553 : 4 : _q20 = do_valueize (valueize, _q20);
13554 : 4 : tree _q21 = gimple_assign_rhs2 (_a1);
13555 : 4 : _q21 = do_valueize (valueize, _q21);
13556 : 4 : tree _q22 = gimple_assign_rhs3 (_a1);
13557 : 4 : _q22 = do_valueize (valueize, _q22);
13558 : 4 : switch (TREE_CODE (_p1))
13559 : : {
13560 : 0 : case SSA_NAME:
13561 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
13562 : : {
13563 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
13564 : 0 : switch (gimple_assign_rhs_code (_a2))
13565 : : {
13566 : 0 : case VEC_COND_EXPR:
13567 : 0 : {
13568 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
13569 : 0 : _q60 = do_valueize (valueize, _q60);
13570 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
13571 : 0 : _q61 = do_valueize (valueize, _q61);
13572 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
13573 : 0 : _q62 = do_valueize (valueize, _q62);
13574 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
13575 : : {
13576 : 0 : {
13577 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
13578 : 0 : if (TREE_CODE_CLASS (TRUNC_MOD_EXPR) != tcc_comparison
13579 : : || types_match (type, TREE_TYPE (captures[2]))
13580 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
13581 : : || (optimize_vectors_before_lowering_p ()
13582 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
13583 : : TREE_TYPE (captures[1]), ERROR_MARK))
13584 : : )
13585 : : {
13586 : 0 : gimple_seq *lseq = seq;
13587 : 0 : if (lseq
13588 : 0 : && (!single_use (captures[0])
13589 : 0 : || !single_use (captures[4])))
13590 : 0 : lseq = NULL;
13591 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1964;
13592 : 0 : {
13593 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
13594 : 0 : res_op->ops[0] = captures[1];
13595 : 0 : {
13596 : 0 : tree _o1[2], _r1;
13597 : 0 : _o1[0] = captures[2];
13598 : 0 : _o1[1] = captures[5];
13599 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13600 : 0 : tem_op.resimplify (NULL, valueize);
13601 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13602 : 0 : if (!_r1) goto next_after_fail1964;
13603 : 0 : res_op->ops[1] = _r1;
13604 : : }
13605 : 0 : {
13606 : 0 : tree _o1[2], _r1;
13607 : 0 : _o1[0] = captures[3];
13608 : 0 : _o1[1] = captures[6];
13609 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13610 : 0 : tem_op.resimplify (NULL, valueize);
13611 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13612 : 0 : if (!_r1) goto next_after_fail1964;
13613 : 0 : res_op->ops[2] = _r1;
13614 : : }
13615 : 0 : res_op->resimplify (lseq, valueize);
13616 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
13617 : 0 : return true;
13618 : : }
13619 : 0 : next_after_fail1964:;
13620 : : }
13621 : : }
13622 : : }
13623 : : break;
13624 : : }
13625 : : default:;
13626 : : }
13627 : : }
13628 : : break;
13629 : 4 : default:;
13630 : : }
13631 : 4 : {
13632 : 4 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
13633 : 4 : if (TREE_CODE_CLASS (TRUNC_MOD_EXPR) != tcc_comparison
13634 : : || types_match (type, TREE_TYPE (captures[2]))
13635 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
13636 : : || (optimize_vectors_before_lowering_p ()
13637 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
13638 : : TREE_TYPE (captures[1]), ERROR_MARK))
13639 : : )
13640 : : {
13641 : 4 : gimple_seq *lseq = seq;
13642 : 4 : if (lseq
13643 : 3 : && (!single_use (captures[0])))
13644 : 1 : lseq = NULL;
13645 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1965;
13646 : 4 : {
13647 : 4 : res_op->set_op (VEC_COND_EXPR, type, 3);
13648 : 4 : res_op->ops[0] = captures[1];
13649 : 4 : {
13650 : 4 : tree _o1[2], _r1;
13651 : 4 : _o1[0] = captures[2];
13652 : 4 : _o1[1] = captures[4];
13653 : 4 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13654 : 4 : tem_op.resimplify (NULL, valueize);
13655 : 4 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13656 : 4 : if (!_r1) goto next_after_fail1965;
13657 : 4 : res_op->ops[1] = _r1;
13658 : : }
13659 : 4 : {
13660 : 4 : tree _o1[2], _r1;
13661 : 4 : _o1[0] = captures[3];
13662 : 4 : _o1[1] = captures[4];
13663 : 4 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13664 : 4 : tem_op.resimplify (NULL, valueize);
13665 : 4 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13666 : 4 : if (!_r1) goto next_after_fail1965;
13667 : 4 : res_op->ops[2] = _r1;
13668 : : }
13669 : 4 : res_op->resimplify (lseq, valueize);
13670 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
13671 : 4 : return true;
13672 : : }
13673 : 0 : next_after_fail1965:;
13674 : : }
13675 : : }
13676 : 0 : break;
13677 : : }
13678 : : default:;
13679 : : }
13680 : : }
13681 : : break;
13682 : 1537202 : default:;
13683 : : }
13684 : 1537202 : switch (TREE_CODE (_p1))
13685 : : {
13686 : 903744 : case SSA_NAME:
13687 : 903744 : if (gimple *_d1 = get_def (valueize, _p1))
13688 : : {
13689 : 705578 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13690 : 1064224 : switch (gimple_assign_rhs_code (_a1))
13691 : : {
13692 : 23 : case VEC_COND_EXPR:
13693 : 23 : {
13694 : 23 : tree _q30 = gimple_assign_rhs1 (_a1);
13695 : 23 : _q30 = do_valueize (valueize, _q30);
13696 : 23 : tree _q31 = gimple_assign_rhs2 (_a1);
13697 : 23 : _q31 = do_valueize (valueize, _q31);
13698 : 23 : tree _q32 = gimple_assign_rhs3 (_a1);
13699 : 23 : _q32 = do_valueize (valueize, _q32);
13700 : 23 : {
13701 : 23 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
13702 : 23 : if (TREE_CODE_CLASS (TRUNC_MOD_EXPR) != tcc_comparison
13703 : : || types_match (type, TREE_TYPE (captures[3]))
13704 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
13705 : : || (optimize_vectors_before_lowering_p ()
13706 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
13707 : : TREE_TYPE (captures[2]), ERROR_MARK))
13708 : : )
13709 : : {
13710 : 23 : gimple_seq *lseq = seq;
13711 : 23 : if (lseq
13712 : 11 : && (!single_use (captures[1])))
13713 : 12 : lseq = NULL;
13714 : 23 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1966;
13715 : 23 : {
13716 : 23 : res_op->set_op (VEC_COND_EXPR, type, 3);
13717 : 23 : res_op->ops[0] = captures[2];
13718 : 23 : {
13719 : 23 : tree _o1[2], _r1;
13720 : 23 : _o1[0] = captures[0];
13721 : 23 : _o1[1] = captures[3];
13722 : 23 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13723 : 23 : tem_op.resimplify (NULL, valueize);
13724 : 23 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13725 : 23 : if (!_r1) goto next_after_fail1966;
13726 : 23 : res_op->ops[1] = _r1;
13727 : : }
13728 : 23 : {
13729 : 23 : tree _o1[2], _r1;
13730 : 23 : _o1[0] = captures[0];
13731 : 23 : _o1[1] = captures[4];
13732 : 23 : gimple_match_op tem_op (res_op->cond.any_else (), TRUNC_MOD_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13733 : 23 : tem_op.resimplify (NULL, valueize);
13734 : 23 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
13735 : 23 : if (!_r1) goto next_after_fail1966;
13736 : 0 : res_op->ops[2] = _r1;
13737 : : }
13738 : 0 : res_op->resimplify (lseq, valueize);
13739 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
13740 : 0 : return true;
13741 : : }
13742 : 23 : next_after_fail1966:;
13743 : : }
13744 : : }
13745 : 23 : break;
13746 : : }
13747 : : default:;
13748 : : }
13749 : : }
13750 : : break;
13751 : : default:;
13752 : : }
13753 : : return false;
13754 : : }
13755 : :
13756 : : bool
13757 : 1764867 : gimple_simplify_LSHIFT_EXPR (gimple_match_op *res_op, gimple_seq *seq,
13758 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
13759 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
13760 : : {
13761 : 1764867 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
13762 : 1764867 : switch (TREE_CODE (_p1))
13763 : : {
13764 : 614567 : case SSA_NAME:
13765 : 614567 : if (gimple *_d1 = get_def (valueize, _p1))
13766 : : {
13767 : 376218 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13768 : 324425 : switch (gimple_assign_rhs_code (_a1))
13769 : : {
13770 : 261 : case TRUNC_MOD_EXPR:
13771 : 261 : {
13772 : 261 : tree _q30 = gimple_assign_rhs1 (_a1);
13773 : 261 : _q30 = do_valueize (valueize, _q30);
13774 : 261 : tree _q31 = gimple_assign_rhs2 (_a1);
13775 : 261 : _q31 = do_valueize (valueize, _q31);
13776 : 261 : {
13777 : 261 : tree _q31_pops[1];
13778 : 261 : if (gimple_power_of_two_cand (_q31, _q31_pops, valueize))
13779 : : {
13780 : 243 : tree _q50 = _q31_pops[0];
13781 : 243 : {
13782 : 243 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q30, _q31, _q50 };
13783 : 243 : if (gimple_simplify_372 (res_op, seq, valueize, type, captures, LSHIFT_EXPR, TRUNC_MOD_EXPR))
13784 : 92 : return true;
13785 : : }
13786 : : }
13787 : : }
13788 : 169 : break;
13789 : : }
13790 : 0 : case FLOOR_MOD_EXPR:
13791 : 0 : {
13792 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
13793 : 0 : _q30 = do_valueize (valueize, _q30);
13794 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
13795 : 0 : _q31 = do_valueize (valueize, _q31);
13796 : 0 : {
13797 : 0 : tree _q31_pops[1];
13798 : 0 : if (gimple_power_of_two_cand (_q31, _q31_pops, valueize))
13799 : : {
13800 : 0 : tree _q50 = _q31_pops[0];
13801 : 0 : {
13802 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q30, _q31, _q50 };
13803 : 0 : if (gimple_simplify_372 (res_op, seq, valueize, type, captures, LSHIFT_EXPR, FLOOR_MOD_EXPR))
13804 : 0 : return true;
13805 : : }
13806 : : }
13807 : : }
13808 : 0 : break;
13809 : : }
13810 : : default:;
13811 : : }
13812 : : }
13813 : : break;
13814 : 1764775 : default:;
13815 : : }
13816 : 1764775 : if (uniform_integer_cst_p (_p1))
13817 : : {
13818 : 1139120 : {
13819 : 1139120 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
13820 : 1139120 : if (gimple_simplify_373 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
13821 : 63 : return true;
13822 : : }
13823 : : }
13824 : 1764712 : switch (TREE_CODE (_p0))
13825 : : {
13826 : 1312655 : case SSA_NAME:
13827 : 1312655 : if (gimple *_d1 = get_def (valueize, _p0))
13828 : : {
13829 : 768054 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
13830 : 743408 : switch (gimple_assign_rhs_code (_a1))
13831 : : {
13832 : 280706 : CASE_CONVERT:
13833 : 280706 : {
13834 : 280706 : tree _q20 = gimple_assign_rhs1 (_a1);
13835 : 280706 : _q20 = do_valueize (valueize, _q20);
13836 : 280706 : switch (TREE_CODE (_q20))
13837 : : {
13838 : 280706 : case SSA_NAME:
13839 : 280706 : if (gimple *_d2 = get_def (valueize, _q20))
13840 : : {
13841 : 273298 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
13842 : 350114 : switch (gimple_assign_rhs_code (_a2))
13843 : : {
13844 : 1234 : case LT_EXPR:
13845 : 1234 : {
13846 : 1234 : tree _q30 = gimple_assign_rhs1 (_a2);
13847 : 1234 : _q30 = do_valueize (valueize, _q30);
13848 : 1234 : tree _q31 = gimple_assign_rhs2 (_a2);
13849 : 1234 : _q31 = do_valueize (valueize, _q31);
13850 : 1234 : if (integer_zerop (_q31))
13851 : : {
13852 : 207 : switch (TREE_CODE (_p1))
13853 : : {
13854 : 207 : case INTEGER_CST:
13855 : 207 : {
13856 : 207 : {
13857 : 207 : tree captures[3] ATTRIBUTE_UNUSED = { _q30, _q31, _p1 };
13858 : 207 : if (TYPE_SIGN (TREE_TYPE (captures[0])) == SIGNED
13859 : 207 : && wi::eq_p (wi::to_wide (captures[2]), TYPE_PRECISION (TREE_TYPE (captures[0])) - 1)
13860 : : )
13861 : : {
13862 : 7 : {
13863 : 7 : wide_int wone = wi::one (TYPE_PRECISION (type));
13864 : 7 : gimple_seq *lseq = seq;
13865 : 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1967;
13866 : 7 : {
13867 : 7 : res_op->set_op (BIT_AND_EXPR, type, 2);
13868 : 7 : {
13869 : 7 : tree _o1[1], _r1;
13870 : 7 : _o1[0] = captures[0];
13871 : 7 : if (type != TREE_TYPE (_o1[0])
13872 : 7 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
13873 : : {
13874 : 3 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
13875 : 3 : tem_op.resimplify (lseq, valueize);
13876 : 3 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
13877 : 3 : if (!_r1) goto next_after_fail1967;
13878 : : }
13879 : : else
13880 : : _r1 = _o1[0];
13881 : 6 : res_op->ops[0] = _r1;
13882 : : }
13883 : 6 : res_op->ops[1] = wide_int_to_tree (type,
13884 : 6 : wi::lshift (wone, wi::to_wide (captures[2])));
13885 : 6 : res_op->resimplify (lseq, valueize);
13886 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1034, __FILE__, __LINE__, true);
13887 : 6 : return true;
13888 : : }
13889 : 1 : next_after_fail1967:;
13890 : 7 : }
13891 : : }
13892 : : }
13893 : 201 : break;
13894 : : }
13895 : : default:;
13896 : : }
13897 : : }
13898 : : break;
13899 : : }
13900 : 4504 : CASE_CONVERT:
13901 : 4504 : {
13902 : 4504 : tree _q30 = gimple_assign_rhs1 (_a2);
13903 : 4504 : _q30 = do_valueize (valueize, _q30);
13904 : 4504 : switch (TREE_CODE (_q30))
13905 : : {
13906 : 4454 : case SSA_NAME:
13907 : 4454 : if (gimple *_d3 = get_def (valueize, _q30))
13908 : : {
13909 : 4378 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
13910 : 6132 : switch (gimple_assign_rhs_code (_a3))
13911 : : {
13912 : 948 : case RSHIFT_EXPR:
13913 : 948 : {
13914 : 948 : tree _q40 = gimple_assign_rhs1 (_a3);
13915 : 948 : _q40 = do_valueize (valueize, _q40);
13916 : 948 : tree _q41 = gimple_assign_rhs2 (_a3);
13917 : 948 : _q41 = do_valueize (valueize, _q41);
13918 : 948 : switch (TREE_CODE (_q41))
13919 : : {
13920 : 903 : case INTEGER_CST:
13921 : 903 : {
13922 : 903 : if ((_p1 == _q41 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q41, 0) && types_match (_p1, _q41)))
13923 : : {
13924 : 396 : {
13925 : 396 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q40, _q41 };
13926 : 396 : if (wi::ltu_p (wi::to_wide (captures[2]), element_precision (type))
13927 : 396 : && INTEGRAL_TYPE_P (type)
13928 : 396 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[0]))
13929 : 396 : && INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
13930 : 396 : && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (captures[1]))
13931 : 739 : && (TYPE_PRECISION (TREE_TYPE (captures[0])) >= TYPE_PRECISION (type)
13932 : 327 : || wi::geu_p (wi::to_wide (captures[2]),
13933 : 327 : TYPE_PRECISION (type)
13934 : 390 : - TYPE_PRECISION (TREE_TYPE (captures[0]))))
13935 : : )
13936 : : {
13937 : 333 : gimple_seq *lseq = seq;
13938 : 333 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1968;
13939 : 333 : {
13940 : 333 : res_op->set_op (BIT_AND_EXPR, type, 2);
13941 : 333 : {
13942 : 333 : tree _o1[1], _r1;
13943 : 333 : _o1[0] = captures[1];
13944 : 333 : if (type != TREE_TYPE (_o1[0])
13945 : 333 : && !useless_type_conversion_p (type, TREE_TYPE (_o1[0])))
13946 : : {
13947 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, type, _o1[0]);
13948 : 0 : tem_op.resimplify (lseq, valueize);
13949 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
13950 : 0 : if (!_r1) goto next_after_fail1968;
13951 : : }
13952 : : else
13953 : : _r1 = _o1[0];
13954 : 333 : res_op->ops[0] = _r1;
13955 : : }
13956 : 333 : {
13957 : 333 : tree _o1[2], _r1;
13958 : 333 : _o1[0] = build_minus_one_cst (type);
13959 : 333 : _o1[1] = captures[2];
13960 : 333 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
13961 : 333 : tem_op.resimplify (lseq, valueize);
13962 : 333 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
13963 : 333 : if (!_r1) goto next_after_fail1968;
13964 : 333 : res_op->ops[1] = _r1;
13965 : : }
13966 : 333 : res_op->resimplify (lseq, valueize);
13967 : 333 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1035, __FILE__, __LINE__, true);
13968 : 333 : return true;
13969 : : }
13970 : 63 : next_after_fail1968:;
13971 : : }
13972 : : }
13973 : : }
13974 : : break;
13975 : : }
13976 : : default:;
13977 : : }
13978 : : break;
13979 : : }
13980 : : default:;
13981 : : }
13982 : : }
13983 : : break;
13984 : : default:;
13985 : : }
13986 : : break;
13987 : : }
13988 : : default:;
13989 : : }
13990 : : }
13991 : : break;
13992 : : default:;
13993 : : }
13994 : : break;
13995 : : }
13996 : 60695 : case RSHIFT_EXPR:
13997 : 60695 : {
13998 : 60695 : tree _q20 = gimple_assign_rhs1 (_a1);
13999 : 60695 : _q20 = do_valueize (valueize, _q20);
14000 : 60695 : tree _q21 = gimple_assign_rhs2 (_a1);
14001 : 60695 : _q21 = do_valueize (valueize, _q21);
14002 : 60695 : switch (TREE_CODE (_q21))
14003 : : {
14004 : 58555 : case INTEGER_CST:
14005 : 58555 : {
14006 : 58555 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
14007 : : {
14008 : 54479 : {
14009 : 54479 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
14010 : 54479 : if (gimple_simplify_374 (res_op, seq, valueize, type, captures))
14011 : 54479 : return true;
14012 : : }
14013 : : }
14014 : : break;
14015 : : }
14016 : : default:;
14017 : : }
14018 : : break;
14019 : : }
14020 : : default:;
14021 : : }
14022 : : }
14023 : : break;
14024 : 1709894 : default:;
14025 : : }
14026 : 1709894 : {
14027 : 1709894 : tree _p0_pops[1];
14028 : 1709894 : if (gimple_nop_convert (_p0, _p0_pops, valueize))
14029 : : {
14030 : 22778 : tree _q20 = _p0_pops[0];
14031 : 22778 : switch (TREE_CODE (_q20))
14032 : : {
14033 : 22778 : case SSA_NAME:
14034 : 22778 : if (gimple *_d1 = get_def (valueize, _q20))
14035 : : {
14036 : 21546 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14037 : 20472 : switch (gimple_assign_rhs_code (_a1))
14038 : : {
14039 : 2292 : case RSHIFT_EXPR:
14040 : 2292 : {
14041 : 2292 : tree _q30 = gimple_assign_rhs1 (_a1);
14042 : 2292 : _q30 = do_valueize (valueize, _q30);
14043 : 2292 : tree _q31 = gimple_assign_rhs2 (_a1);
14044 : 2292 : _q31 = do_valueize (valueize, _q31);
14045 : 2292 : switch (TREE_CODE (_q31))
14046 : : {
14047 : 2243 : case INTEGER_CST:
14048 : 2243 : {
14049 : 2243 : if ((_p1 == _q31 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q31, 0) && types_match (_p1, _q31)))
14050 : : {
14051 : 129 : {
14052 : 129 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _q31 };
14053 : 129 : if (gimple_simplify_374 (res_op, seq, valueize, type, captures))
14054 : 93 : return true;
14055 : : }
14056 : : }
14057 : : break;
14058 : : }
14059 : : default:;
14060 : : }
14061 : : break;
14062 : : }
14063 : : default:;
14064 : : }
14065 : : }
14066 : : break;
14067 : : default:;
14068 : : }
14069 : : }
14070 : : }
14071 : 1709801 : if (integer_onep (_p0))
14072 : : {
14073 : 365978 : switch (TREE_CODE (_p1))
14074 : : {
14075 : 360322 : case SSA_NAME:
14076 : 360322 : if (gimple *_d1 = get_def (valueize, _p1))
14077 : : {
14078 : 196790 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14079 : 167609 : switch (gimple_assign_rhs_code (_a1))
14080 : : {
14081 : 4919 : case MINUS_EXPR:
14082 : 4919 : {
14083 : 4919 : tree _q30 = gimple_assign_rhs1 (_a1);
14084 : 4919 : _q30 = do_valueize (valueize, _q30);
14085 : 4919 : tree _q31 = gimple_assign_rhs2 (_a1);
14086 : 4919 : _q31 = do_valueize (valueize, _q31);
14087 : 4919 : switch (TREE_CODE (_q30))
14088 : : {
14089 : 4599 : case INTEGER_CST:
14090 : 4599 : {
14091 : 4599 : {
14092 : 4599 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31 };
14093 : 4599 : if (INTEGRAL_TYPE_P (type)
14094 : 4795 : && wi::eq_p (wi::to_wide (captures[2]), TYPE_PRECISION (type) - 1)
14095 : 4801 : && single_use (captures[1])
14096 : : )
14097 : : {
14098 : 6 : if (TYPE_UNSIGNED (type)
14099 : : )
14100 : : {
14101 : 4 : gimple_seq *lseq = seq;
14102 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1969;
14103 : 4 : {
14104 : 4 : res_op->set_op (RSHIFT_EXPR, type, 2);
14105 : 4 : {
14106 : 4 : tree _o1[2], _r1;
14107 : 4 : _o1[0] = captures[0];
14108 : 4 : _o1[1] = captures[2];
14109 : 4 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14110 : 4 : tem_op.resimplify (lseq, valueize);
14111 : 4 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14112 : 4 : if (!_r1) goto next_after_fail1969;
14113 : 4 : res_op->ops[0] = _r1;
14114 : : }
14115 : 4 : res_op->ops[1] = captures[3];
14116 : 4 : res_op->resimplify (lseq, valueize);
14117 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1036, __FILE__, __LINE__, true);
14118 : 4 : return true;
14119 : : }
14120 : 4593 : next_after_fail1969:;
14121 : : }
14122 : : else
14123 : : {
14124 : 2 : {
14125 : 2 : tree utype = unsigned_type_for (type);
14126 : 2 : gimple_seq *lseq = seq;
14127 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1970;
14128 : 2 : {
14129 : 2 : res_op->set_op (NOP_EXPR, type, 1);
14130 : 2 : {
14131 : 2 : tree _o1[2], _r1;
14132 : 2 : {
14133 : 2 : tree _o2[2], _r2;
14134 : 2 : {
14135 : 2 : tree _o3[1], _r3;
14136 : 2 : _o3[0] = captures[0];
14137 : 2 : if (utype != TREE_TYPE (_o3[0])
14138 : 2 : && !useless_type_conversion_p (utype, TREE_TYPE (_o3[0])))
14139 : : {
14140 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, utype, _o3[0]);
14141 : 2 : tem_op.resimplify (lseq, valueize);
14142 : 2 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
14143 : 2 : if (!_r3) goto next_after_fail1970;
14144 : : }
14145 : : else
14146 : : _r3 = _o3[0];
14147 : 2 : _o2[0] = _r3;
14148 : : }
14149 : 2 : _o2[1] = captures[2];
14150 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o2[0]), _o2[0], _o2[1]);
14151 : 2 : tem_op.resimplify (lseq, valueize);
14152 : 2 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
14153 : 2 : if (!_r2) goto next_after_fail1970;
14154 : 2 : _o1[0] = _r2;
14155 : : }
14156 : 2 : _o1[1] = captures[3];
14157 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), RSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14158 : 2 : tem_op.resimplify (lseq, valueize);
14159 : 2 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14160 : 2 : if (!_r1) goto next_after_fail1970;
14161 : 2 : res_op->ops[0] = _r1;
14162 : : }
14163 : 2 : res_op->resimplify (lseq, valueize);
14164 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1037, __FILE__, __LINE__, true);
14165 : 2 : return true;
14166 : : }
14167 : 4593 : next_after_fail1970:;
14168 : : }
14169 : : }
14170 : : }
14171 : : }
14172 : 4593 : break;
14173 : : }
14174 : : default:;
14175 : : }
14176 : : break;
14177 : : }
14178 : : default:;
14179 : : }
14180 : : }
14181 : : break;
14182 : : default:;
14183 : : }
14184 : : }
14185 : 1709795 : if (integer_zerop (_p1))
14186 : : {
14187 : 10485 : {
14188 : 10485 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
14189 : 10485 : if (gimple_simplify_375 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
14190 : 10485 : return true;
14191 : : }
14192 : : }
14193 : 1699310 : if (integer_zerop (_p0))
14194 : : {
14195 : 2367 : {
14196 : 2367 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
14197 : 2367 : if (gimple_simplify_376 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
14198 : 2367 : return true;
14199 : : }
14200 : : }
14201 : 1696943 : switch (TREE_CODE (_p1))
14202 : : {
14203 : 612103 : case SSA_NAME:
14204 : 612103 : if (gimple *_d1 = get_def (valueize, _p1))
14205 : : {
14206 : 374969 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14207 : 323211 : switch (gimple_assign_rhs_code (_a1))
14208 : : {
14209 : 63 : case CONSTRUCTOR:
14210 : 63 : {
14211 : 63 : {
14212 : 63 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
14213 : 63 : if (gimple_simplify_378 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
14214 : 0 : return true;
14215 : : }
14216 : 63 : break;
14217 : : }
14218 : : default:;
14219 : : }
14220 : : }
14221 : 612103 : {
14222 : 612103 : {
14223 : 612103 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
14224 : 612103 : if (gimple_simplify_379 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
14225 : 3 : return true;
14226 : : }
14227 : : }
14228 : 612100 : break;
14229 : 321 : case VECTOR_CST:
14230 : 321 : {
14231 : 321 : {
14232 : 321 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
14233 : 321 : if (gimple_simplify_377 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
14234 : 163 : return true;
14235 : : }
14236 : 158 : break;
14237 : : }
14238 : 1696777 : default:;
14239 : : }
14240 : 1696777 : switch (TREE_CODE (_p0))
14241 : : {
14242 : 1247131 : case SSA_NAME:
14243 : 1247131 : if (gimple *_d1 = get_def (valueize, _p0))
14244 : : {
14245 : 705212 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14246 : 681378 : switch (gimple_assign_rhs_code (_a1))
14247 : : {
14248 : 3413 : case LSHIFT_EXPR:
14249 : 3413 : {
14250 : 3413 : tree _q20 = gimple_assign_rhs1 (_a1);
14251 : 3413 : _q20 = do_valueize (valueize, _q20);
14252 : 3413 : tree _q21 = gimple_assign_rhs2 (_a1);
14253 : 3413 : _q21 = do_valueize (valueize, _q21);
14254 : 3413 : switch (TREE_CODE (_q21))
14255 : : {
14256 : 1404 : case INTEGER_CST:
14257 : 1404 : {
14258 : 1404 : switch (TREE_CODE (_p1))
14259 : : {
14260 : 828 : case INTEGER_CST:
14261 : 828 : {
14262 : 828 : {
14263 : 828 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
14264 : 828 : if (gimple_simplify_380 (res_op, seq, valueize, type, captures, LSHIFT_EXPR))
14265 : 828 : return true;
14266 : : }
14267 : 0 : break;
14268 : : }
14269 : : default:;
14270 : : }
14271 : : break;
14272 : : }
14273 : : default:;
14274 : : }
14275 : : break;
14276 : : }
14277 : 274560 : CASE_CONVERT:
14278 : 274560 : {
14279 : 274560 : tree _q20 = gimple_assign_rhs1 (_a1);
14280 : 274560 : _q20 = do_valueize (valueize, _q20);
14281 : 274560 : switch (TREE_CODE (_q20))
14282 : : {
14283 : 274560 : case SSA_NAME:
14284 : 274560 : if (gimple *_d2 = get_def (valueize, _q20))
14285 : : {
14286 : 267184 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
14287 : 343339 : switch (gimple_assign_rhs_code (_a2))
14288 : : {
14289 : 24650 : case BIT_AND_EXPR:
14290 : 24650 : {
14291 : 24650 : tree _q30 = gimple_assign_rhs1 (_a2);
14292 : 24650 : _q30 = do_valueize (valueize, _q30);
14293 : 24650 : tree _q31 = gimple_assign_rhs2 (_a2);
14294 : 24650 : _q31 = do_valueize (valueize, _q31);
14295 : 24650 : if (tree_swap_operands_p (_q30, _q31))
14296 : 53 : std::swap (_q30, _q31);
14297 : 24650 : switch (TREE_CODE (_q31))
14298 : : {
14299 : 23909 : case INTEGER_CST:
14300 : 23909 : {
14301 : 23909 : switch (TREE_CODE (_p1))
14302 : : {
14303 : 7918 : case INTEGER_CST:
14304 : 7918 : {
14305 : 7918 : {
14306 : 7918 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _p1 };
14307 : 7918 : if (gimple_simplify_381 (res_op, seq, valueize, type, captures, BIT_AND_EXPR, LSHIFT_EXPR))
14308 : 167 : return true;
14309 : : }
14310 : 7751 : break;
14311 : : }
14312 : : default:;
14313 : : }
14314 : : break;
14315 : : }
14316 : : default:;
14317 : : }
14318 : 1694973 : break;
14319 : : }
14320 : 199 : case BIT_XOR_EXPR:
14321 : 199 : {
14322 : 199 : tree _q30 = gimple_assign_rhs1 (_a2);
14323 : 199 : _q30 = do_valueize (valueize, _q30);
14324 : 199 : tree _q31 = gimple_assign_rhs2 (_a2);
14325 : 199 : _q31 = do_valueize (valueize, _q31);
14326 : 199 : if (tree_swap_operands_p (_q30, _q31))
14327 : 6 : std::swap (_q30, _q31);
14328 : 199 : switch (TREE_CODE (_q31))
14329 : : {
14330 : 82 : case INTEGER_CST:
14331 : 82 : {
14332 : 82 : switch (TREE_CODE (_p1))
14333 : : {
14334 : 76 : case INTEGER_CST:
14335 : 76 : {
14336 : 76 : {
14337 : 76 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _p1 };
14338 : 76 : if (gimple_simplify_381 (res_op, seq, valueize, type, captures, BIT_XOR_EXPR, LSHIFT_EXPR))
14339 : 0 : return true;
14340 : : }
14341 : 76 : break;
14342 : : }
14343 : : default:;
14344 : : }
14345 : : break;
14346 : : }
14347 : : default:;
14348 : : }
14349 : 1694973 : break;
14350 : : }
14351 : 962 : case BIT_IOR_EXPR:
14352 : 962 : {
14353 : 962 : tree _q30 = gimple_assign_rhs1 (_a2);
14354 : 962 : _q30 = do_valueize (valueize, _q30);
14355 : 962 : tree _q31 = gimple_assign_rhs2 (_a2);
14356 : 962 : _q31 = do_valueize (valueize, _q31);
14357 : 962 : if (tree_swap_operands_p (_q30, _q31))
14358 : 28 : std::swap (_q30, _q31);
14359 : 962 : switch (TREE_CODE (_q31))
14360 : : {
14361 : 411 : case INTEGER_CST:
14362 : 411 : {
14363 : 411 : switch (TREE_CODE (_p1))
14364 : : {
14365 : 171 : case INTEGER_CST:
14366 : 171 : {
14367 : 171 : {
14368 : 171 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _p1 };
14369 : 171 : if (gimple_simplify_381 (res_op, seq, valueize, type, captures, BIT_IOR_EXPR, LSHIFT_EXPR))
14370 : 0 : return true;
14371 : : }
14372 : 171 : break;
14373 : : }
14374 : : default:;
14375 : : }
14376 : : break;
14377 : : }
14378 : : default:;
14379 : : }
14380 : 1694973 : break;
14381 : : }
14382 : : default:;
14383 : : }
14384 : : }
14385 : : break;
14386 : : default:;
14387 : : }
14388 : : break;
14389 : : }
14390 : 10493 : case BIT_AND_EXPR:
14391 : 10493 : {
14392 : 10493 : tree _q20 = gimple_assign_rhs1 (_a1);
14393 : 10493 : _q20 = do_valueize (valueize, _q20);
14394 : 10493 : tree _q21 = gimple_assign_rhs2 (_a1);
14395 : 10493 : _q21 = do_valueize (valueize, _q21);
14396 : 10493 : if (tree_swap_operands_p (_q20, _q21))
14397 : 292 : std::swap (_q20, _q21);
14398 : 10493 : switch (TREE_CODE (_q21))
14399 : : {
14400 : 7180 : case INTEGER_CST:
14401 : 7180 : {
14402 : 7180 : switch (TREE_CODE (_p1))
14403 : : {
14404 : 4148 : case INTEGER_CST:
14405 : 4148 : {
14406 : 4148 : {
14407 : 4148 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21, _p1 };
14408 : 4148 : if (gimple_simplify_382 (res_op, seq, valueize, type, captures, BIT_AND_EXPR, LSHIFT_EXPR))
14409 : 592 : return true;
14410 : : }
14411 : 3556 : break;
14412 : : }
14413 : : default:;
14414 : : }
14415 : : break;
14416 : : }
14417 : : default:;
14418 : : }
14419 : 1694973 : break;
14420 : : }
14421 : 8414 : case BIT_XOR_EXPR:
14422 : 8414 : {
14423 : 8414 : tree _q20 = gimple_assign_rhs1 (_a1);
14424 : 8414 : _q20 = do_valueize (valueize, _q20);
14425 : 8414 : tree _q21 = gimple_assign_rhs2 (_a1);
14426 : 8414 : _q21 = do_valueize (valueize, _q21);
14427 : 8414 : if (tree_swap_operands_p (_q20, _q21))
14428 : 723 : std::swap (_q20, _q21);
14429 : 8414 : switch (TREE_CODE (_q21))
14430 : : {
14431 : 165 : case INTEGER_CST:
14432 : 165 : {
14433 : 165 : switch (TREE_CODE (_p1))
14434 : : {
14435 : 165 : case INTEGER_CST:
14436 : 165 : {
14437 : 165 : {
14438 : 165 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21, _p1 };
14439 : 165 : if (gimple_simplify_382 (res_op, seq, valueize, type, captures, BIT_XOR_EXPR, LSHIFT_EXPR))
14440 : 0 : return true;
14441 : : }
14442 : 165 : break;
14443 : : }
14444 : : default:;
14445 : : }
14446 : : break;
14447 : : }
14448 : : default:;
14449 : : }
14450 : 1694973 : break;
14451 : : }
14452 : 11268 : case BIT_IOR_EXPR:
14453 : 11268 : {
14454 : 11268 : tree _q20 = gimple_assign_rhs1 (_a1);
14455 : 11268 : _q20 = do_valueize (valueize, _q20);
14456 : 11268 : tree _q21 = gimple_assign_rhs2 (_a1);
14457 : 11268 : _q21 = do_valueize (valueize, _q21);
14458 : 11268 : if (tree_swap_operands_p (_q20, _q21))
14459 : 432 : std::swap (_q20, _q21);
14460 : 11268 : switch (TREE_CODE (_q21))
14461 : : {
14462 : 1664 : case INTEGER_CST:
14463 : 1664 : {
14464 : 1664 : switch (TREE_CODE (_p1))
14465 : : {
14466 : 539 : case INTEGER_CST:
14467 : 539 : {
14468 : 539 : {
14469 : 539 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p0, _q20, _q21, _p1 };
14470 : 539 : if (gimple_simplify_382 (res_op, seq, valueize, type, captures, BIT_IOR_EXPR, LSHIFT_EXPR))
14471 : 22 : return true;
14472 : : }
14473 : 517 : break;
14474 : : }
14475 : : default:;
14476 : : }
14477 : : break;
14478 : : }
14479 : : default:;
14480 : : }
14481 : 1694973 : break;
14482 : : }
14483 : 517 : case VEC_COND_EXPR:
14484 : 517 : {
14485 : 517 : tree _q20 = gimple_assign_rhs1 (_a1);
14486 : 517 : _q20 = do_valueize (valueize, _q20);
14487 : 517 : tree _q21 = gimple_assign_rhs2 (_a1);
14488 : 517 : _q21 = do_valueize (valueize, _q21);
14489 : 517 : tree _q22 = gimple_assign_rhs3 (_a1);
14490 : 517 : _q22 = do_valueize (valueize, _q22);
14491 : 517 : switch (TREE_CODE (_p1))
14492 : : {
14493 : 43 : case SSA_NAME:
14494 : 43 : if (gimple *_d2 = get_def (valueize, _p1))
14495 : : {
14496 : 43 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
14497 : 37 : switch (gimple_assign_rhs_code (_a2))
14498 : : {
14499 : 0 : case VEC_COND_EXPR:
14500 : 0 : {
14501 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
14502 : 0 : _q60 = do_valueize (valueize, _q60);
14503 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
14504 : 0 : _q61 = do_valueize (valueize, _q61);
14505 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
14506 : 0 : _q62 = do_valueize (valueize, _q62);
14507 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
14508 : : {
14509 : 0 : {
14510 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
14511 : 0 : if (TREE_CODE_CLASS (LSHIFT_EXPR) != tcc_comparison
14512 : : || types_match (type, TREE_TYPE (captures[2]))
14513 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
14514 : : || (optimize_vectors_before_lowering_p ()
14515 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
14516 : : TREE_TYPE (captures[1]), ERROR_MARK))
14517 : : )
14518 : : {
14519 : 0 : gimple_seq *lseq = seq;
14520 : 0 : if (lseq
14521 : 0 : && (!single_use (captures[0])
14522 : 0 : || !single_use (captures[4])))
14523 : 0 : lseq = NULL;
14524 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1971;
14525 : 0 : {
14526 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
14527 : 0 : res_op->ops[0] = captures[1];
14528 : 0 : {
14529 : 0 : tree _o1[2], _r1;
14530 : 0 : _o1[0] = captures[2];
14531 : 0 : _o1[1] = captures[5];
14532 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14533 : 0 : tem_op.resimplify (NULL, valueize);
14534 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
14535 : 0 : if (!_r1) goto next_after_fail1971;
14536 : 0 : res_op->ops[1] = _r1;
14537 : : }
14538 : 0 : {
14539 : 0 : tree _o1[2], _r1;
14540 : 0 : _o1[0] = captures[3];
14541 : 0 : _o1[1] = captures[6];
14542 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14543 : 0 : tem_op.resimplify (NULL, valueize);
14544 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
14545 : 0 : if (!_r1) goto next_after_fail1971;
14546 : 0 : res_op->ops[2] = _r1;
14547 : : }
14548 : 0 : res_op->resimplify (lseq, valueize);
14549 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
14550 : 0 : return true;
14551 : : }
14552 : 0 : next_after_fail1971:;
14553 : : }
14554 : : }
14555 : : }
14556 : : break;
14557 : : }
14558 : : default:;
14559 : : }
14560 : : }
14561 : : break;
14562 : 517 : default:;
14563 : : }
14564 : 517 : {
14565 : 517 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
14566 : 517 : if (TREE_CODE_CLASS (LSHIFT_EXPR) != tcc_comparison
14567 : : || types_match (type, TREE_TYPE (captures[2]))
14568 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
14569 : : || (optimize_vectors_before_lowering_p ()
14570 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
14571 : : TREE_TYPE (captures[1]), ERROR_MARK))
14572 : : )
14573 : : {
14574 : 517 : gimple_seq *lseq = seq;
14575 : 517 : if (lseq
14576 : 128 : && (!single_use (captures[0])))
14577 : 420 : lseq = NULL;
14578 : 517 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1972;
14579 : 517 : {
14580 : 517 : res_op->set_op (VEC_COND_EXPR, type, 3);
14581 : 517 : res_op->ops[0] = captures[1];
14582 : 517 : {
14583 : 517 : tree _o1[2], _r1;
14584 : 517 : _o1[0] = captures[2];
14585 : 517 : _o1[1] = captures[4];
14586 : 517 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14587 : 517 : tem_op.resimplify (NULL, valueize);
14588 : 517 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
14589 : 517 : if (!_r1) goto next_after_fail1972;
14590 : 267 : res_op->ops[1] = _r1;
14591 : : }
14592 : 267 : {
14593 : 267 : tree _o1[2], _r1;
14594 : 267 : _o1[0] = captures[3];
14595 : 267 : _o1[1] = captures[4];
14596 : 267 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14597 : 267 : tem_op.resimplify (NULL, valueize);
14598 : 267 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
14599 : 267 : if (!_r1) goto next_after_fail1972;
14600 : 195 : res_op->ops[2] = _r1;
14601 : : }
14602 : 195 : res_op->resimplify (lseq, valueize);
14603 : 195 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
14604 : 195 : return true;
14605 : : }
14606 : 322 : next_after_fail1972:;
14607 : : }
14608 : : }
14609 : 322 : break;
14610 : : }
14611 : : default:;
14612 : : }
14613 : : }
14614 : : break;
14615 : 1694973 : default:;
14616 : : }
14617 : 1694973 : switch (TREE_CODE (_p1))
14618 : : {
14619 : 612100 : case SSA_NAME:
14620 : 612100 : if (gimple *_d1 = get_def (valueize, _p1))
14621 : : {
14622 : 374967 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14623 : 323209 : switch (gimple_assign_rhs_code (_a1))
14624 : : {
14625 : 45 : case VEC_COND_EXPR:
14626 : 45 : {
14627 : 45 : tree _q30 = gimple_assign_rhs1 (_a1);
14628 : 45 : _q30 = do_valueize (valueize, _q30);
14629 : 45 : tree _q31 = gimple_assign_rhs2 (_a1);
14630 : 45 : _q31 = do_valueize (valueize, _q31);
14631 : 45 : tree _q32 = gimple_assign_rhs3 (_a1);
14632 : 45 : _q32 = do_valueize (valueize, _q32);
14633 : 45 : {
14634 : 45 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
14635 : 45 : if (TREE_CODE_CLASS (LSHIFT_EXPR) != tcc_comparison
14636 : : || types_match (type, TREE_TYPE (captures[3]))
14637 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
14638 : : || (optimize_vectors_before_lowering_p ()
14639 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
14640 : : TREE_TYPE (captures[2]), ERROR_MARK))
14641 : : )
14642 : : {
14643 : 45 : gimple_seq *lseq = seq;
14644 : 45 : if (lseq
14645 : 21 : && (!single_use (captures[1])))
14646 : 24 : lseq = NULL;
14647 : 45 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1973;
14648 : 45 : {
14649 : 45 : res_op->set_op (VEC_COND_EXPR, type, 3);
14650 : 45 : res_op->ops[0] = captures[2];
14651 : 45 : {
14652 : 45 : tree _o1[2], _r1;
14653 : 45 : _o1[0] = captures[0];
14654 : 45 : _o1[1] = captures[3];
14655 : 45 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14656 : 45 : tem_op.resimplify (NULL, valueize);
14657 : 45 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
14658 : 45 : if (!_r1) goto next_after_fail1973;
14659 : 4 : res_op->ops[1] = _r1;
14660 : : }
14661 : 4 : {
14662 : 4 : tree _o1[2], _r1;
14663 : 4 : _o1[0] = captures[0];
14664 : 4 : _o1[1] = captures[4];
14665 : 4 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14666 : 4 : tem_op.resimplify (NULL, valueize);
14667 : 4 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
14668 : 4 : if (!_r1) goto next_after_fail1973;
14669 : 4 : res_op->ops[2] = _r1;
14670 : : }
14671 : 4 : res_op->resimplify (lseq, valueize);
14672 : 4 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
14673 : 4 : return true;
14674 : : }
14675 : 41 : next_after_fail1973:;
14676 : : }
14677 : : }
14678 : 41 : break;
14679 : : }
14680 : : default:;
14681 : : }
14682 : : }
14683 : : break;
14684 : 1694969 : default:;
14685 : : }
14686 : 1694969 : switch (TREE_CODE (_p0))
14687 : : {
14688 : 1245327 : case SSA_NAME:
14689 : 1245327 : if (gimple *_d1 = get_def (valueize, _p0))
14690 : : {
14691 : 703408 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14692 : 679574 : switch (gimple_assign_rhs_code (_a1))
14693 : : {
14694 : 196 : case VEC_PERM_EXPR:
14695 : 196 : {
14696 : 196 : tree _q20 = gimple_assign_rhs1 (_a1);
14697 : 196 : _q20 = do_valueize (valueize, _q20);
14698 : 196 : tree _q21 = gimple_assign_rhs2 (_a1);
14699 : 196 : _q21 = do_valueize (valueize, _q21);
14700 : 196 : tree _q22 = gimple_assign_rhs3 (_a1);
14701 : 196 : _q22 = do_valueize (valueize, _q22);
14702 : 196 : if ((_q21 == _q20 && ! TREE_SIDE_EFFECTS (_q21)) || (operand_equal_p (_q21, _q20, 0) && types_match (_q21, _q20)))
14703 : : {
14704 : 32 : switch (TREE_CODE (_p1))
14705 : : {
14706 : 20 : case SSA_NAME:
14707 : 20 : if (gimple *_d2 = get_def (valueize, _p1))
14708 : : {
14709 : 17 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
14710 : 13 : switch (gimple_assign_rhs_code (_a2))
14711 : : {
14712 : 2 : case VEC_PERM_EXPR:
14713 : 2 : {
14714 : 2 : tree _q60 = gimple_assign_rhs1 (_a2);
14715 : 2 : _q60 = do_valueize (valueize, _q60);
14716 : 2 : tree _q61 = gimple_assign_rhs2 (_a2);
14717 : 2 : _q61 = do_valueize (valueize, _q61);
14718 : 2 : tree _q62 = gimple_assign_rhs3 (_a2);
14719 : 2 : _q62 = do_valueize (valueize, _q62);
14720 : 2 : if ((_q61 == _q60 && ! TREE_SIDE_EFFECTS (_q61)) || (operand_equal_p (_q61, _q60, 0) && types_match (_q61, _q60)))
14721 : : {
14722 : 2 : if ((_q62 == _q22 && ! TREE_SIDE_EFFECTS (_q62)) || (operand_equal_p (_q62, _q22, 0) && types_match (_q62, _q22)))
14723 : : {
14724 : 2 : {
14725 : 2 : tree captures[4] ATTRIBUTE_UNUSED = { _q20, _q22, _q60 };
14726 : 2 : if (VECTOR_INTEGER_TYPE_P (type)
14727 : : )
14728 : : {
14729 : 2 : gimple_seq *lseq = seq;
14730 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail1974;
14731 : 2 : {
14732 : 2 : res_op->set_op (VEC_PERM_EXPR, type, 3);
14733 : 2 : {
14734 : 2 : tree _o1[2], _r1;
14735 : 2 : _o1[0] = captures[0];
14736 : 2 : _o1[1] = captures[2];
14737 : 2 : gimple_match_op tem_op (res_op->cond.any_else (), LSHIFT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14738 : 2 : tem_op.resimplify (lseq, valueize);
14739 : 2 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14740 : 2 : if (!_r1) goto next_after_fail1974;
14741 : 1 : captures[3] = _r1;
14742 : : }
14743 : 1 : res_op->ops[0] = captures[3];
14744 : 1 : res_op->ops[1] = captures[3];
14745 : 1 : res_op->ops[2] = captures[1];
14746 : 1 : res_op->resimplify (lseq, valueize);
14747 : 1 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 928, __FILE__, __LINE__, true);
14748 : 1 : return true;
14749 : : }
14750 : : next_after_fail1974:;
14751 : : }
14752 : : }
14753 : : }
14754 : : }
14755 : : break;
14756 : : }
14757 : : default:;
14758 : : }
14759 : : }
14760 : : break;
14761 : : default:;
14762 : : }
14763 : : }
14764 : : break;
14765 : : }
14766 : : default:;
14767 : : }
14768 : : }
14769 : : break;
14770 : : default:;
14771 : : }
14772 : : return false;
14773 : : }
14774 : :
14775 : : bool
14776 : 2995 : gimple_simplify_CFN_BUILT_IN_POWL (gimple_match_op *res_op, gimple_seq *seq,
14777 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
14778 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
14779 : : {
14780 : 2995 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
14781 : 2995 : switch (TREE_CODE (_p0))
14782 : : {
14783 : 1236 : case SSA_NAME:
14784 : 1236 : if (gimple *_d1 = get_def (valueize, _p0))
14785 : : {
14786 : 696 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
14787 : 428 : switch (gimple_assign_rhs_code (_a1))
14788 : : {
14789 : 2 : case NEGATE_EXPR:
14790 : 2 : {
14791 : 2 : tree _q20 = gimple_assign_rhs1 (_a1);
14792 : 2 : _q20 = do_valueize (valueize, _q20);
14793 : 2 : switch (TREE_CODE (_p1))
14794 : : {
14795 : 2 : case REAL_CST:
14796 : 2 : {
14797 : 2 : {
14798 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
14799 : 2 : const combined_fn pows = CFN_BUILT_IN_POWL;
14800 : 2 : {
14801 : 2 : HOST_WIDE_INT n;
14802 : 2 : if (real_isinteger (&TREE_REAL_CST (captures[1]), &n) && (n & 1) == 0
14803 : : )
14804 : : {
14805 : 2 : gimple_seq *lseq = seq;
14806 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2015;
14807 : 2 : {
14808 : 2 : res_op->set_op (pows, type, 2);
14809 : 2 : res_op->ops[0] = captures[0];
14810 : 2 : res_op->ops[1] = captures[1];
14811 : 2 : res_op->resimplify (lseq, valueize);
14812 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1042, __FILE__, __LINE__, true);
14813 : 2 : return true;
14814 : : }
14815 : 0 : next_after_fail2015:;
14816 : : }
14817 : : }
14818 : : }
14819 : 0 : break;
14820 : : }
14821 : : default:;
14822 : : }
14823 : : break;
14824 : : }
14825 : 30 : case ABS_EXPR:
14826 : 30 : {
14827 : 30 : tree _q20 = gimple_assign_rhs1 (_a1);
14828 : 30 : _q20 = do_valueize (valueize, _q20);
14829 : 30 : switch (TREE_CODE (_p1))
14830 : : {
14831 : 2 : case REAL_CST:
14832 : 2 : {
14833 : 2 : {
14834 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
14835 : 2 : const combined_fn pows = CFN_BUILT_IN_POWL;
14836 : 2 : {
14837 : 2 : HOST_WIDE_INT n;
14838 : 2 : if (real_isinteger (&TREE_REAL_CST (captures[1]), &n) && (n & 1) == 0
14839 : : )
14840 : : {
14841 : 2 : gimple_seq *lseq = seq;
14842 : 2 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2016;
14843 : 2 : {
14844 : 2 : res_op->set_op (pows, type, 2);
14845 : 2 : res_op->ops[0] = captures[0];
14846 : 2 : res_op->ops[1] = captures[1];
14847 : 2 : res_op->resimplify (lseq, valueize);
14848 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1042, __FILE__, __LINE__, true);
14849 : 2 : return true;
14850 : : }
14851 : 0 : next_after_fail2016:;
14852 : : }
14853 : : }
14854 : : }
14855 : 0 : break;
14856 : : }
14857 : : default:;
14858 : : }
14859 : : break;
14860 : : }
14861 : : default:;
14862 : : }
14863 : 318 : else if (gcall *_c1 = dyn_cast <gcall *> (_d1))
14864 : 99 : switch (gimple_call_combined_fn (_c1))
14865 : : {
14866 : 14 : case CFN_BUILT_IN_SQRTL:
14867 : 14 : if (gimple_call_num_args (_c1) == 1)
14868 : : {
14869 : 14 : tree _q20 = gimple_call_arg (_c1, 0);
14870 : 14 : _q20 = do_valueize (valueize, _q20);
14871 : 14 : {
14872 : 14 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
14873 : 14 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
14874 : : )
14875 : : {
14876 : 14 : gimple_seq *lseq = seq;
14877 : 14 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2017;
14878 : 14 : {
14879 : 14 : res_op->set_op (CFN_BUILT_IN_POWL, type, 2);
14880 : 14 : res_op->ops[0] = captures[0];
14881 : 14 : {
14882 : 14 : tree _o1[2], _r1;
14883 : 14 : _o1[0] = captures[1];
14884 : 14 : _o1[1] = build_real (type, dconsthalf);
14885 : 14 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14886 : 14 : tem_op.resimplify (lseq, valueize);
14887 : 14 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14888 : 14 : if (!_r1) goto next_after_fail2017;
14889 : 7 : res_op->ops[1] = _r1;
14890 : : }
14891 : 7 : res_op->resimplify (lseq, valueize);
14892 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1043, __FILE__, __LINE__, true);
14893 : 7 : return true;
14894 : : }
14895 : 7 : next_after_fail2017:;
14896 : : }
14897 : : }
14898 : : }
14899 : : break;
14900 : 12 : case CFN_BUILT_IN_EXP10L:
14901 : 12 : if (gimple_call_num_args (_c1) == 1)
14902 : : {
14903 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
14904 : 12 : _q20 = do_valueize (valueize, _q20);
14905 : 12 : {
14906 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
14907 : 12 : if (flag_unsafe_math_optimizations
14908 : : )
14909 : : {
14910 : 12 : gimple_seq *lseq = seq;
14911 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2018;
14912 : 12 : {
14913 : 12 : res_op->set_op (CFN_BUILT_IN_EXP10L, type, 1);
14914 : 12 : {
14915 : 12 : tree _o1[2], _r1;
14916 : 12 : _o1[0] = captures[0];
14917 : 12 : _o1[1] = captures[1];
14918 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14919 : 12 : tem_op.resimplify (lseq, valueize);
14920 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14921 : 12 : if (!_r1) goto next_after_fail2018;
14922 : 6 : res_op->ops[0] = _r1;
14923 : : }
14924 : 6 : res_op->resimplify (lseq, valueize);
14925 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1044, __FILE__, __LINE__, true);
14926 : 6 : return true;
14927 : : }
14928 : 6 : next_after_fail2018:;
14929 : : }
14930 : : }
14931 : : }
14932 : : break;
14933 : 14 : case CFN_BUILT_IN_EXPL:
14934 : 14 : if (gimple_call_num_args (_c1) == 1)
14935 : : {
14936 : 14 : tree _q20 = gimple_call_arg (_c1, 0);
14937 : 14 : _q20 = do_valueize (valueize, _q20);
14938 : 14 : {
14939 : 14 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
14940 : 14 : if (flag_unsafe_math_optimizations
14941 : : )
14942 : : {
14943 : 14 : gimple_seq *lseq = seq;
14944 : 14 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2019;
14945 : 14 : {
14946 : 14 : res_op->set_op (CFN_BUILT_IN_EXPL, type, 1);
14947 : 14 : {
14948 : 14 : tree _o1[2], _r1;
14949 : 14 : _o1[0] = captures[0];
14950 : 14 : _o1[1] = captures[1];
14951 : 14 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14952 : 14 : tem_op.resimplify (lseq, valueize);
14953 : 14 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14954 : 14 : if (!_r1) goto next_after_fail2019;
14955 : 7 : res_op->ops[0] = _r1;
14956 : : }
14957 : 7 : res_op->resimplify (lseq, valueize);
14958 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1044, __FILE__, __LINE__, true);
14959 : 7 : return true;
14960 : : }
14961 : 7 : next_after_fail2019:;
14962 : : }
14963 : : }
14964 : : }
14965 : : break;
14966 : 23 : case CFN_BUILT_IN_POWL:
14967 : 23 : if (gimple_call_num_args (_c1) == 2)
14968 : : {
14969 : 23 : tree _q20 = gimple_call_arg (_c1, 0);
14970 : 23 : _q20 = do_valueize (valueize, _q20);
14971 : 23 : tree _q21 = gimple_call_arg (_c1, 1);
14972 : 23 : _q21 = do_valueize (valueize, _q21);
14973 : 23 : if (tree_expr_nonnegative_p (_q20))
14974 : : {
14975 : 12 : {
14976 : 12 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
14977 : 12 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
14978 : : )
14979 : : {
14980 : 12 : gimple_seq *lseq = seq;
14981 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2020;
14982 : 12 : {
14983 : 12 : res_op->set_op (CFN_BUILT_IN_POWL, type, 2);
14984 : 12 : res_op->ops[0] = captures[0];
14985 : 12 : {
14986 : 12 : tree _o1[2], _r1;
14987 : 12 : _o1[0] = captures[1];
14988 : 12 : _o1[1] = captures[2];
14989 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
14990 : 12 : tem_op.resimplify (lseq, valueize);
14991 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
14992 : 12 : if (!_r1) goto next_after_fail2020;
14993 : 6 : res_op->ops[1] = _r1;
14994 : : }
14995 : 6 : res_op->resimplify (lseq, valueize);
14996 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1045, __FILE__, __LINE__, true);
14997 : 6 : return true;
14998 : : }
14999 : 6 : next_after_fail2020:;
15000 : : }
15001 : : }
15002 : : }
15003 : : }
15004 : : break;
15005 : 12 : case CFN_BUILT_IN_POW10L:
15006 : 12 : if (gimple_call_num_args (_c1) == 1)
15007 : : {
15008 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
15009 : 12 : _q20 = do_valueize (valueize, _q20);
15010 : 12 : {
15011 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
15012 : 12 : if (flag_unsafe_math_optimizations
15013 : : )
15014 : : {
15015 : 12 : gimple_seq *lseq = seq;
15016 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2021;
15017 : 12 : {
15018 : 12 : res_op->set_op (CFN_BUILT_IN_POW10L, type, 1);
15019 : 12 : {
15020 : 12 : tree _o1[2], _r1;
15021 : 12 : _o1[0] = captures[0];
15022 : 12 : _o1[1] = captures[1];
15023 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
15024 : 12 : tem_op.resimplify (lseq, valueize);
15025 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
15026 : 12 : if (!_r1) goto next_after_fail2021;
15027 : 6 : res_op->ops[0] = _r1;
15028 : : }
15029 : 6 : res_op->resimplify (lseq, valueize);
15030 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1044, __FILE__, __LINE__, true);
15031 : 6 : return true;
15032 : : }
15033 : 6 : next_after_fail2021:;
15034 : : }
15035 : : }
15036 : : }
15037 : : break;
15038 : 0 : case CFN_BUILT_IN_COPYSIGN:
15039 : 0 : if (gimple_call_num_args (_c1) == 2)
15040 : : {
15041 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
15042 : 0 : _q20 = do_valueize (valueize, _q20);
15043 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
15044 : 0 : _q21 = do_valueize (valueize, _q21);
15045 : 0 : switch (TREE_CODE (_p1))
15046 : : {
15047 : 0 : case REAL_CST:
15048 : 0 : {
15049 : 0 : {
15050 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15051 : 0 : if (gimple_simplify_401 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN, CFN_BUILT_IN_POWL))
15052 : 0 : return true;
15053 : : }
15054 : 0 : break;
15055 : : }
15056 : : default:;
15057 : : }
15058 : : }
15059 : : break;
15060 : 0 : case CFN_BUILT_IN_COPYSIGNF:
15061 : 0 : if (gimple_call_num_args (_c1) == 2)
15062 : : {
15063 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
15064 : 0 : _q20 = do_valueize (valueize, _q20);
15065 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
15066 : 0 : _q21 = do_valueize (valueize, _q21);
15067 : 0 : switch (TREE_CODE (_p1))
15068 : : {
15069 : 0 : case REAL_CST:
15070 : 0 : {
15071 : 0 : {
15072 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15073 : 0 : if (gimple_simplify_401 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF, CFN_BUILT_IN_POWL))
15074 : 0 : return true;
15075 : : }
15076 : 0 : break;
15077 : : }
15078 : : default:;
15079 : : }
15080 : : }
15081 : : break;
15082 : 0 : case CFN_BUILT_IN_COPYSIGNL:
15083 : 0 : if (gimple_call_num_args (_c1) == 2)
15084 : : {
15085 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
15086 : 0 : _q20 = do_valueize (valueize, _q20);
15087 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
15088 : 0 : _q21 = do_valueize (valueize, _q21);
15089 : 0 : switch (TREE_CODE (_p1))
15090 : : {
15091 : 0 : case REAL_CST:
15092 : 0 : {
15093 : 0 : {
15094 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15095 : 0 : if (gimple_simplify_401 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL, CFN_BUILT_IN_POWL))
15096 : 0 : return true;
15097 : : }
15098 : 0 : break;
15099 : : }
15100 : : default:;
15101 : : }
15102 : : }
15103 : : break;
15104 : 12 : case CFN_BUILT_IN_CBRTL:
15105 : 12 : if (gimple_call_num_args (_c1) == 1)
15106 : : {
15107 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
15108 : 12 : _q20 = do_valueize (valueize, _q20);
15109 : 12 : if (tree_expr_nonnegative_p (_q20))
15110 : : {
15111 : 12 : {
15112 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
15113 : 12 : if (flag_unsafe_math_optimizations && canonicalize_math_p ()
15114 : : )
15115 : : {
15116 : 12 : gimple_seq *lseq = seq;
15117 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2022;
15118 : 12 : {
15119 : 12 : res_op->set_op (CFN_BUILT_IN_POWL, type, 2);
15120 : 12 : res_op->ops[0] = captures[0];
15121 : 12 : {
15122 : 12 : tree _o1[2], _r1;
15123 : 12 : _o1[0] = captures[1];
15124 : 12 : _o1[1] = build_real_truncate (type, dconst_third ());
15125 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
15126 : 12 : tem_op.resimplify (lseq, valueize);
15127 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
15128 : 12 : if (!_r1) goto next_after_fail2022;
15129 : 6 : res_op->ops[1] = _r1;
15130 : : }
15131 : 6 : res_op->resimplify (lseq, valueize);
15132 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1046, __FILE__, __LINE__, true);
15133 : 6 : return true;
15134 : : }
15135 : 6 : next_after_fail2022:;
15136 : : }
15137 : : }
15138 : : }
15139 : : }
15140 : : break;
15141 : 12 : case CFN_BUILT_IN_EXP2L:
15142 : 12 : if (gimple_call_num_args (_c1) == 1)
15143 : : {
15144 : 12 : tree _q20 = gimple_call_arg (_c1, 0);
15145 : 12 : _q20 = do_valueize (valueize, _q20);
15146 : 12 : {
15147 : 12 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
15148 : 12 : if (flag_unsafe_math_optimizations
15149 : : )
15150 : : {
15151 : 12 : gimple_seq *lseq = seq;
15152 : 12 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2023;
15153 : 12 : {
15154 : 12 : res_op->set_op (CFN_BUILT_IN_EXP2L, type, 1);
15155 : 12 : {
15156 : 12 : tree _o1[2], _r1;
15157 : 12 : _o1[0] = captures[0];
15158 : 12 : _o1[1] = captures[1];
15159 : 12 : gimple_match_op tem_op (res_op->cond.any_else (), MULT_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
15160 : 12 : tem_op.resimplify (lseq, valueize);
15161 : 12 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
15162 : 12 : if (!_r1) goto next_after_fail2023;
15163 : 6 : res_op->ops[0] = _r1;
15164 : : }
15165 : 6 : res_op->resimplify (lseq, valueize);
15166 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1044, __FILE__, __LINE__, true);
15167 : 6 : return true;
15168 : : }
15169 : 6 : next_after_fail2023:;
15170 : : }
15171 : : }
15172 : : }
15173 : : break;
15174 : 0 : case CFN_COPYSIGN:
15175 : 0 : if (gimple_call_num_args (_c1) == 2)
15176 : : {
15177 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
15178 : 0 : _q20 = do_valueize (valueize, _q20);
15179 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
15180 : 0 : _q21 = do_valueize (valueize, _q21);
15181 : 0 : switch (TREE_CODE (_p1))
15182 : : {
15183 : 0 : case REAL_CST:
15184 : 0 : {
15185 : 0 : {
15186 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15187 : 0 : if (gimple_simplify_401 (res_op, seq, valueize, type, captures, CFN_COPYSIGN, CFN_BUILT_IN_POWL))
15188 : 0 : return true;
15189 : : }
15190 : 0 : break;
15191 : : }
15192 : : default:;
15193 : : }
15194 : : }
15195 : : break;
15196 : : default:;
15197 : : }
15198 : : }
15199 : : break;
15200 : 1687 : case REAL_CST:
15201 : 1687 : {
15202 : 1687 : {
15203 : 1687 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
15204 : 1687 : if (gimple_simplify_402 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_POWL, CFN_BUILT_IN_EXPL, CFN_BUILT_IN_LOGL, CFN_BUILT_IN_EXP2L, CFN_BUILT_IN_LOG2L))
15205 : 2 : return true;
15206 : : }
15207 : 1685 : break;
15208 : : }
15209 : 2945 : default:;
15210 : : }
15211 : 2945 : if (real_onep (_p0))
15212 : : {
15213 : 100 : {
15214 : 100 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
15215 : 100 : if (gimple_simplify_403 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_POWL))
15216 : 100 : return true;
15217 : : }
15218 : : }
15219 : 2845 : switch (TREE_CODE (_p1))
15220 : : {
15221 : 1549 : case REAL_CST:
15222 : 1549 : {
15223 : 1549 : {
15224 : 1549 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
15225 : 1549 : {
15226 : 1549 : const REAL_VALUE_TYPE *value = TREE_REAL_CST_PTR (captures[1]);
15227 : 1549 : REAL_VALUE_TYPE tmp;
15228 : 1549 : if (real_equal (value, &dconst0)
15229 : : )
15230 : : {
15231 : 6 : gimple_seq *lseq = seq;
15232 : 6 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2024;
15233 : 6 : {
15234 : 6 : tree tem;
15235 : 6 : tem = build_real (type, dconst1);
15236 : 6 : res_op->set_value (tem);
15237 : 6 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1047, __FILE__, __LINE__, true);
15238 : 7 : return true;
15239 : : }
15240 : 0 : next_after_fail2024:;
15241 : : }
15242 : : else
15243 : : {
15244 : 1543 : if (real_equal (value, &dconst1)
15245 : : )
15246 : : {
15247 : 1 : gimple_seq *lseq = seq;
15248 : 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2025;
15249 : 1 : {
15250 : 1 : tree tem;
15251 : 1 : tem = captures[0];
15252 : 1 : res_op->set_value (tem);
15253 : 1 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1048, __FILE__, __LINE__, true);
15254 : 1 : return true;
15255 : : }
15256 : 0 : next_after_fail2025:;
15257 : : }
15258 : : else
15259 : : {
15260 : 1542 : if (real_equal (value, &dconstm1)
15261 : : )
15262 : : {
15263 : 0 : gimple_seq *lseq = seq;
15264 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2026;
15265 : 0 : {
15266 : 0 : res_op->set_op (RDIV_EXPR, type, 2);
15267 : 0 : res_op->ops[0] = build_real (type, dconst1);
15268 : 0 : res_op->ops[1] = captures[0];
15269 : 0 : res_op->resimplify (lseq, valueize);
15270 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1049, __FILE__, __LINE__, true);
15271 : 0 : return true;
15272 : : }
15273 : 0 : next_after_fail2026:;
15274 : : }
15275 : : else
15276 : : {
15277 : 1542 : if (flag_unsafe_math_optimizations
15278 : : && canonicalize_math_p ()
15279 : 1730 : && real_equal (value, &dconsthalf)
15280 : : )
15281 : : {
15282 : 0 : gimple_seq *lseq = seq;
15283 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2027;
15284 : 0 : {
15285 : 0 : res_op->set_op (CFN_BUILT_IN_SQRTL, type, 1);
15286 : 0 : res_op->ops[0] = captures[0];
15287 : 0 : res_op->resimplify (lseq, valueize);
15288 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1050, __FILE__, __LINE__, true);
15289 : 0 : return true;
15290 : : }
15291 : 0 : next_after_fail2027:;
15292 : : }
15293 : : else
15294 : : {
15295 : 1542 : if (flag_unsafe_math_optimizations
15296 : : && canonicalize_math_p ()
15297 : 1918 : && (tmp = real_value_truncate (TYPE_MODE (type), dconst_third ()),
15298 : 188 : real_equal (value, &tmp))
15299 : : )
15300 : : {
15301 : 0 : gimple_seq *lseq = seq;
15302 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2028;
15303 : 0 : {
15304 : 0 : res_op->set_op (CFN_BUILT_IN_CBRTL, type, 1);
15305 : 0 : res_op->ops[0] = captures[0];
15306 : 0 : res_op->resimplify (lseq, valueize);
15307 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1051, __FILE__, __LINE__, true);
15308 : 0 : return true;
15309 : : }
15310 : 0 : next_after_fail2028:;
15311 : : }
15312 : : }
15313 : : }
15314 : : }
15315 : : }
15316 : : }
15317 : : }
15318 : 1542 : break;
15319 : : }
15320 : : default:;
15321 : : }
15322 : : return false;
15323 : : }
15324 : :
15325 : : bool
15326 : 379 : gimple_simplify_CFN_BUILT_IN_HYPOTF (gimple_match_op *res_op, gimple_seq *seq,
15327 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
15328 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
15329 : : {
15330 : 379 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
15331 : 379 : switch (TREE_CODE (_p0))
15332 : : {
15333 : 345 : case SSA_NAME:
15334 : 345 : if (gimple *_d1 = get_def (valueize, _p0))
15335 : : {
15336 : 221 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15337 : 154 : switch (gimple_assign_rhs_code (_a1))
15338 : : {
15339 : 7 : case NEGATE_EXPR:
15340 : 7 : {
15341 : 7 : tree _q20 = gimple_assign_rhs1 (_a1);
15342 : 7 : _q20 = do_valueize (valueize, _q20);
15343 : 7 : {
15344 : 7 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
15345 : 7 : const combined_fn hypots = CFN_BUILT_IN_HYPOTF;
15346 : 7 : gimple_seq *lseq = seq;
15347 : 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2063;
15348 : 7 : {
15349 : 7 : res_op->set_op (hypots, type, 2);
15350 : 7 : res_op->ops[0] = captures[0];
15351 : 7 : res_op->ops[1] = captures[1];
15352 : 7 : res_op->resimplify (lseq, valueize);
15353 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1057, __FILE__, __LINE__, true);
15354 : 7 : return true;
15355 : : }
15356 : 0 : next_after_fail2063:;
15357 : : }
15358 : 0 : break;
15359 : : }
15360 : 5 : case ABS_EXPR:
15361 : 5 : {
15362 : 5 : tree _q20 = gimple_assign_rhs1 (_a1);
15363 : 5 : _q20 = do_valueize (valueize, _q20);
15364 : 5 : {
15365 : 5 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
15366 : 5 : const combined_fn hypots = CFN_BUILT_IN_HYPOTF;
15367 : 5 : gimple_seq *lseq = seq;
15368 : 5 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2064;
15369 : 5 : {
15370 : 5 : res_op->set_op (hypots, type, 2);
15371 : 5 : res_op->ops[0] = captures[0];
15372 : 5 : res_op->ops[1] = captures[1];
15373 : 5 : res_op->resimplify (lseq, valueize);
15374 : 5 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1057, __FILE__, __LINE__, true);
15375 : 5 : return true;
15376 : : }
15377 : 0 : next_after_fail2064:;
15378 : : }
15379 : 0 : break;
15380 : : }
15381 : : default:;
15382 : : }
15383 : : }
15384 : : break;
15385 : 367 : default:;
15386 : : }
15387 : 367 : switch (TREE_CODE (_p1))
15388 : : {
15389 : 331 : case SSA_NAME:
15390 : 331 : if (gimple *_d1 = get_def (valueize, _p1))
15391 : : {
15392 : 209 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15393 : 182 : switch (gimple_assign_rhs_code (_a1))
15394 : : {
15395 : 7 : case NEGATE_EXPR:
15396 : 7 : {
15397 : 7 : tree _q30 = gimple_assign_rhs1 (_a1);
15398 : 7 : _q30 = do_valueize (valueize, _q30);
15399 : 7 : {
15400 : 7 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
15401 : 7 : const combined_fn hypots = CFN_BUILT_IN_HYPOTF;
15402 : 7 : gimple_seq *lseq = seq;
15403 : 7 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2065;
15404 : 7 : {
15405 : 7 : res_op->set_op (hypots, type, 2);
15406 : 7 : res_op->ops[0] = captures[0];
15407 : 7 : res_op->ops[1] = captures[1];
15408 : 7 : res_op->resimplify (lseq, valueize);
15409 : 7 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1058, __FILE__, __LINE__, true);
15410 : 7 : return true;
15411 : : }
15412 : 0 : next_after_fail2065:;
15413 : : }
15414 : 0 : break;
15415 : : }
15416 : 5 : case ABS_EXPR:
15417 : 5 : {
15418 : 5 : tree _q30 = gimple_assign_rhs1 (_a1);
15419 : 5 : _q30 = do_valueize (valueize, _q30);
15420 : 5 : {
15421 : 5 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _q30 };
15422 : 5 : const combined_fn hypots = CFN_BUILT_IN_HYPOTF;
15423 : 5 : gimple_seq *lseq = seq;
15424 : 5 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2066;
15425 : 5 : {
15426 : 5 : res_op->set_op (hypots, type, 2);
15427 : 5 : res_op->ops[0] = captures[0];
15428 : 5 : res_op->ops[1] = captures[1];
15429 : 5 : res_op->resimplify (lseq, valueize);
15430 : 5 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1058, __FILE__, __LINE__, true);
15431 : 5 : return true;
15432 : : }
15433 : 0 : next_after_fail2066:;
15434 : : }
15435 : 0 : break;
15436 : : }
15437 : : default:;
15438 : : }
15439 : : }
15440 : : break;
15441 : 355 : default:;
15442 : : }
15443 : 355 : switch (TREE_CODE (_p0))
15444 : : {
15445 : 321 : case SSA_NAME:
15446 : 321 : if (gimple *_d1 = get_def (valueize, _p0))
15447 : : {
15448 : 197 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
15449 : 19 : switch (gimple_call_combined_fn (_c1))
15450 : : {
15451 : 0 : case CFN_BUILT_IN_COPYSIGN:
15452 : 0 : if (gimple_call_num_args (_c1) == 2)
15453 : : {
15454 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
15455 : 0 : _q20 = do_valueize (valueize, _q20);
15456 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
15457 : 0 : _q21 = do_valueize (valueize, _q21);
15458 : 0 : {
15459 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15460 : 0 : if (gimple_simplify_405 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN, CFN_BUILT_IN_HYPOTF))
15461 : 0 : return true;
15462 : : }
15463 : : }
15464 : : break;
15465 : 4 : case CFN_BUILT_IN_COPYSIGNF:
15466 : 4 : if (gimple_call_num_args (_c1) == 2)
15467 : : {
15468 : 4 : tree _q20 = gimple_call_arg (_c1, 0);
15469 : 4 : _q20 = do_valueize (valueize, _q20);
15470 : 4 : tree _q21 = gimple_call_arg (_c1, 1);
15471 : 4 : _q21 = do_valueize (valueize, _q21);
15472 : 4 : {
15473 : 4 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15474 : 4 : if (gimple_simplify_405 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF, CFN_BUILT_IN_HYPOTF))
15475 : 4 : return true;
15476 : : }
15477 : : }
15478 : : break;
15479 : 0 : case CFN_BUILT_IN_COPYSIGNL:
15480 : 0 : if (gimple_call_num_args (_c1) == 2)
15481 : : {
15482 : 0 : tree _q20 = gimple_call_arg (_c1, 0);
15483 : 0 : _q20 = do_valueize (valueize, _q20);
15484 : 0 : tree _q21 = gimple_call_arg (_c1, 1);
15485 : 0 : _q21 = do_valueize (valueize, _q21);
15486 : 0 : {
15487 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15488 : 0 : if (gimple_simplify_405 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL, CFN_BUILT_IN_HYPOTF))
15489 : 0 : return true;
15490 : : }
15491 : : }
15492 : : break;
15493 : 1 : case CFN_COPYSIGN:
15494 : 1 : if (gimple_call_num_args (_c1) == 2)
15495 : : {
15496 : 1 : tree _q20 = gimple_call_arg (_c1, 0);
15497 : 1 : _q20 = do_valueize (valueize, _q20);
15498 : 1 : tree _q21 = gimple_call_arg (_c1, 1);
15499 : 1 : _q21 = do_valueize (valueize, _q21);
15500 : 1 : {
15501 : 1 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _q21, _p1 };
15502 : 1 : if (gimple_simplify_405 (res_op, seq, valueize, type, captures, CFN_COPYSIGN, CFN_BUILT_IN_HYPOTF))
15503 : 1 : return true;
15504 : : }
15505 : : }
15506 : : break;
15507 : : default:;
15508 : : }
15509 : : }
15510 : : break;
15511 : 350 : default:;
15512 : : }
15513 : 350 : switch (TREE_CODE (_p1))
15514 : : {
15515 : 314 : case SSA_NAME:
15516 : 314 : if (gimple *_d1 = get_def (valueize, _p1))
15517 : : {
15518 : 192 : if (gcall *_c1 = dyn_cast <gcall *> (_d1))
15519 : 15 : switch (gimple_call_combined_fn (_c1))
15520 : : {
15521 : 0 : case CFN_BUILT_IN_COPYSIGN:
15522 : 0 : if (gimple_call_num_args (_c1) == 2)
15523 : : {
15524 : 0 : tree _q30 = gimple_call_arg (_c1, 0);
15525 : 0 : _q30 = do_valueize (valueize, _q30);
15526 : 0 : tree _q31 = gimple_call_arg (_c1, 1);
15527 : 0 : _q31 = do_valueize (valueize, _q31);
15528 : 0 : {
15529 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
15530 : 0 : if (gimple_simplify_406 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGN, CFN_BUILT_IN_HYPOTF))
15531 : 0 : return true;
15532 : : }
15533 : : }
15534 : : break;
15535 : 0 : case CFN_BUILT_IN_COPYSIGNF:
15536 : 0 : if (gimple_call_num_args (_c1) == 2)
15537 : : {
15538 : 0 : tree _q30 = gimple_call_arg (_c1, 0);
15539 : 0 : _q30 = do_valueize (valueize, _q30);
15540 : 0 : tree _q31 = gimple_call_arg (_c1, 1);
15541 : 0 : _q31 = do_valueize (valueize, _q31);
15542 : 0 : {
15543 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
15544 : 0 : if (gimple_simplify_406 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNF, CFN_BUILT_IN_HYPOTF))
15545 : 0 : return true;
15546 : : }
15547 : : }
15548 : : break;
15549 : 0 : case CFN_BUILT_IN_COPYSIGNL:
15550 : 0 : if (gimple_call_num_args (_c1) == 2)
15551 : : {
15552 : 0 : tree _q30 = gimple_call_arg (_c1, 0);
15553 : 0 : _q30 = do_valueize (valueize, _q30);
15554 : 0 : tree _q31 = gimple_call_arg (_c1, 1);
15555 : 0 : _q31 = do_valueize (valueize, _q31);
15556 : 0 : {
15557 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
15558 : 0 : if (gimple_simplify_406 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_COPYSIGNL, CFN_BUILT_IN_HYPOTF))
15559 : 0 : return true;
15560 : : }
15561 : : }
15562 : : break;
15563 : 1 : case CFN_COPYSIGN:
15564 : 1 : if (gimple_call_num_args (_c1) == 2)
15565 : : {
15566 : 1 : tree _q30 = gimple_call_arg (_c1, 0);
15567 : 1 : _q30 = do_valueize (valueize, _q30);
15568 : 1 : tree _q31 = gimple_call_arg (_c1, 1);
15569 : 1 : _q31 = do_valueize (valueize, _q31);
15570 : 1 : {
15571 : 1 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q30, _q31 };
15572 : 1 : if (gimple_simplify_406 (res_op, seq, valueize, type, captures, CFN_COPYSIGN, CFN_BUILT_IN_HYPOTF))
15573 : 1 : return true;
15574 : : }
15575 : : }
15576 : : break;
15577 : : default:;
15578 : : }
15579 : : }
15580 : : break;
15581 : 349 : default:;
15582 : : }
15583 : 349 : if (real_zerop (_p1))
15584 : : {
15585 : 2 : {
15586 : 2 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
15587 : 2 : if (gimple_simplify_407 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_HYPOTF))
15588 : 2 : return true;
15589 : : }
15590 : : }
15591 : 347 : if (real_zerop (_p0))
15592 : : {
15593 : 1 : {
15594 : 1 : tree captures[2] ATTRIBUTE_UNUSED = { _p1, _p0 };
15595 : 1 : if (gimple_simplify_407 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_HYPOTF))
15596 : 1 : return true;
15597 : : }
15598 : : }
15599 : 346 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
15600 : : {
15601 : 7 : {
15602 : 7 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
15603 : 7 : if (gimple_simplify_408 (res_op, seq, valueize, type, captures, CFN_BUILT_IN_HYPOTF))
15604 : 3 : return true;
15605 : : }
15606 : : }
15607 : : return false;
15608 : : }
15609 : :
15610 : : bool
15611 : 707468 : gimple_simplify_MIN_EXPR (gimple_match_op *res_op, gimple_seq *seq,
15612 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
15613 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
15614 : : {
15615 : 707468 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
15616 : 707468 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
15617 : : {
15618 : 3037 : {
15619 : 3037 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
15620 : 3037 : if (gimple_simplify_479 (res_op, seq, valueize, type, captures, MIN_EXPR))
15621 : 3037 : return true;
15622 : : }
15623 : : }
15624 : 704431 : switch (TREE_CODE (_p0))
15625 : : {
15626 : 686766 : case SSA_NAME:
15627 : 686766 : if (gimple *_d1 = get_def (valueize, _p0))
15628 : : {
15629 : 512195 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15630 : 543512 : switch (gimple_assign_rhs_code (_a1))
15631 : : {
15632 : 8418 : case MIN_EXPR:
15633 : 8418 : {
15634 : 8418 : tree _q20 = gimple_assign_rhs1 (_a1);
15635 : 8418 : _q20 = do_valueize (valueize, _q20);
15636 : 8418 : tree _q21 = gimple_assign_rhs2 (_a1);
15637 : 8418 : _q21 = do_valueize (valueize, _q21);
15638 : 8418 : if (tree_swap_operands_p (_q20, _q21))
15639 : 716 : std::swap (_q20, _q21);
15640 : 8418 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
15641 : : {
15642 : 30 : {
15643 : 30 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q21 };
15644 : 30 : if (gimple_simplify_480 (res_op, seq, valueize, type, captures, MIN_EXPR))
15645 : 30 : return true;
15646 : : }
15647 : : }
15648 : 8388 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
15649 : : {
15650 : 592 : {
15651 : 592 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q21, _q20 };
15652 : 592 : if (gimple_simplify_480 (res_op, seq, valueize, type, captures, MIN_EXPR))
15653 : 592 : return true;
15654 : : }
15655 : : }
15656 : 703809 : break;
15657 : : }
15658 : : default:;
15659 : : }
15660 : : }
15661 : : break;
15662 : 703809 : default:;
15663 : : }
15664 : 703809 : switch (TREE_CODE (_p1))
15665 : : {
15666 : 458368 : case SSA_NAME:
15667 : 458368 : if (gimple *_d1 = get_def (valueize, _p1))
15668 : : {
15669 : 369553 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15670 : 412358 : switch (gimple_assign_rhs_code (_a1))
15671 : : {
15672 : 9687 : case MIN_EXPR:
15673 : 9687 : {
15674 : 9687 : tree _q30 = gimple_assign_rhs1 (_a1);
15675 : 9687 : _q30 = do_valueize (valueize, _q30);
15676 : 9687 : tree _q31 = gimple_assign_rhs2 (_a1);
15677 : 9687 : _q31 = do_valueize (valueize, _q31);
15678 : 9687 : if (tree_swap_operands_p (_q30, _q31))
15679 : 975 : std::swap (_q30, _q31);
15680 : 9687 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
15681 : : {
15682 : 22 : {
15683 : 22 : tree captures[3] ATTRIBUTE_UNUSED = { _p1, _p0, _q31 };
15684 : 22 : if (gimple_simplify_481 (res_op, seq, valueize, type, captures, MIN_EXPR))
15685 : 22 : return true;
15686 : : }
15687 : : }
15688 : 9665 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
15689 : : {
15690 : 9 : {
15691 : 9 : tree captures[3] ATTRIBUTE_UNUSED = { _p1, _p0, _q30 };
15692 : 9 : if (gimple_simplify_481 (res_op, seq, valueize, type, captures, MIN_EXPR))
15693 : 9 : return true;
15694 : : }
15695 : : }
15696 : 703778 : break;
15697 : : }
15698 : : default:;
15699 : : }
15700 : : }
15701 : : break;
15702 : 703778 : default:;
15703 : : }
15704 : 703778 : switch (TREE_CODE (_p0))
15705 : : {
15706 : 686113 : case SSA_NAME:
15707 : 686113 : if (gimple *_d1 = get_def (valueize, _p0))
15708 : : {
15709 : 511542 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15710 : 542857 : switch (gimple_assign_rhs_code (_a1))
15711 : : {
15712 : 3648 : case MAX_EXPR:
15713 : 3648 : {
15714 : 3648 : tree _q20 = gimple_assign_rhs1 (_a1);
15715 : 3648 : _q20 = do_valueize (valueize, _q20);
15716 : 3648 : tree _q21 = gimple_assign_rhs2 (_a1);
15717 : 3648 : _q21 = do_valueize (valueize, _q21);
15718 : 3648 : if (tree_swap_operands_p (_q20, _q21))
15719 : 51 : std::swap (_q20, _q21);
15720 : 3648 : if ((_p1 == _q21 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q21, 0) && types_match (_p1, _q21)))
15721 : : {
15722 : 6 : {
15723 : 6 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q21 };
15724 : 6 : if (gimple_simplify_482 (res_op, seq, valueize, type, captures))
15725 : 6 : return true;
15726 : : }
15727 : : }
15728 : 3642 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
15729 : : {
15730 : 6 : {
15731 : 6 : tree captures[2] ATTRIBUTE_UNUSED = { _q21, _q20 };
15732 : 6 : if (gimple_simplify_482 (res_op, seq, valueize, type, captures))
15733 : 6 : return true;
15734 : : }
15735 : : }
15736 : 703766 : break;
15737 : : }
15738 : : default:;
15739 : : }
15740 : : }
15741 : : break;
15742 : 703766 : default:;
15743 : : }
15744 : 703766 : switch (TREE_CODE (_p1))
15745 : : {
15746 : 458325 : case SSA_NAME:
15747 : 458325 : if (gimple *_d1 = get_def (valueize, _p1))
15748 : : {
15749 : 369510 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15750 : 412321 : switch (gimple_assign_rhs_code (_a1))
15751 : : {
15752 : 1331 : case MAX_EXPR:
15753 : 1331 : {
15754 : 1331 : tree _q30 = gimple_assign_rhs1 (_a1);
15755 : 1331 : _q30 = do_valueize (valueize, _q30);
15756 : 1331 : tree _q31 = gimple_assign_rhs2 (_a1);
15757 : 1331 : _q31 = do_valueize (valueize, _q31);
15758 : 1331 : if (tree_swap_operands_p (_q30, _q31))
15759 : 54 : std::swap (_q30, _q31);
15760 : 1331 : if ((_q31 == _p0 && ! TREE_SIDE_EFFECTS (_q31)) || (operand_equal_p (_q31, _p0, 0) && types_match (_q31, _p0)))
15761 : : {
15762 : 0 : {
15763 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q30, _p0 };
15764 : 0 : if (gimple_simplify_482 (res_op, seq, valueize, type, captures))
15765 : 0 : return true;
15766 : : }
15767 : : }
15768 : 1331 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
15769 : : {
15770 : 0 : {
15771 : 0 : tree captures[2] ATTRIBUTE_UNUSED = { _q31, _p0 };
15772 : 0 : if (gimple_simplify_482 (res_op, seq, valueize, type, captures))
15773 : 0 : return true;
15774 : : }
15775 : : }
15776 : 703764 : break;
15777 : : }
15778 : 92 : case NEGATE_EXPR:
15779 : 92 : {
15780 : 92 : tree _q30 = gimple_assign_rhs1 (_a1);
15781 : 92 : _q30 = do_valueize (valueize, _q30);
15782 : 92 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
15783 : : {
15784 : 6 : {
15785 : 6 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
15786 : 6 : if (gimple_simplify_483 (res_op, seq, valueize, type, captures))
15787 : 2 : return true;
15788 : : }
15789 : : }
15790 : : break;
15791 : : }
15792 : : default:;
15793 : : }
15794 : : }
15795 : : break;
15796 : 703764 : default:;
15797 : : }
15798 : 703764 : switch (TREE_CODE (_p0))
15799 : : {
15800 : 686099 : case SSA_NAME:
15801 : 686099 : if (gimple *_d1 = get_def (valueize, _p0))
15802 : : {
15803 : 511528 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15804 : 542843 : switch (gimple_assign_rhs_code (_a1))
15805 : : {
15806 : 295 : case NEGATE_EXPR:
15807 : 295 : {
15808 : 295 : tree _q20 = gimple_assign_rhs1 (_a1);
15809 : 295 : _q20 = do_valueize (valueize, _q20);
15810 : 295 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
15811 : : {
15812 : 0 : {
15813 : 0 : tree captures[1] ATTRIBUTE_UNUSED = { _q20 };
15814 : 0 : if (gimple_simplify_483 (res_op, seq, valueize, type, captures))
15815 : 0 : return true;
15816 : : }
15817 : : }
15818 : : break;
15819 : : }
15820 : : default:;
15821 : : }
15822 : : }
15823 : : break;
15824 : 703764 : default:;
15825 : : }
15826 : 703764 : {
15827 : 703764 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
15828 : 703764 : if (INTEGRAL_TYPE_P (type)
15829 : 690169 : && TYPE_MIN_VALUE (type)
15830 : 1393933 : && operand_equal_p (captures[1], TYPE_MIN_VALUE (type), OEP_ONLY_CONST)
15831 : : )
15832 : : {
15833 : 2352 : gimple_seq *lseq = seq;
15834 : 2352 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2094;
15835 : 2352 : {
15836 : 2352 : tree tem;
15837 : 2352 : tem = captures[1];
15838 : 2352 : res_op->set_value (tem);
15839 : 2352 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1069, __FILE__, __LINE__, true);
15840 : 2352 : return true;
15841 : : }
15842 : 0 : next_after_fail2094:;
15843 : : }
15844 : : else
15845 : : {
15846 : 701412 : if (INTEGRAL_TYPE_P (type)
15847 : 687817 : && TYPE_MAX_VALUE (type)
15848 : 1389229 : && operand_equal_p (captures[1], TYPE_MAX_VALUE (type), OEP_ONLY_CONST)
15849 : : )
15850 : : {
15851 : 4211 : gimple_seq *lseq = seq;
15852 : 4211 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2095;
15853 : 4211 : {
15854 : 4211 : tree tem;
15855 : 4211 : tem = captures[0];
15856 : 4211 : res_op->set_value (tem);
15857 : 4211 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1070, __FILE__, __LINE__, true);
15858 : 4211 : return true;
15859 : : }
15860 : 0 : next_after_fail2095:;
15861 : : }
15862 : : }
15863 : : }
15864 : 697201 : switch (TREE_CODE (_p1))
15865 : : {
15866 : 458323 : case SSA_NAME:
15867 : 458323 : if (gimple *_d1 = get_def (valueize, _p1))
15868 : : {
15869 : 369508 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15870 : 412319 : switch (gimple_assign_rhs_code (_a1))
15871 : : {
15872 : 62905 : case PLUS_EXPR:
15873 : 62905 : {
15874 : 62905 : tree _q30 = gimple_assign_rhs1 (_a1);
15875 : 62905 : _q30 = do_valueize (valueize, _q30);
15876 : 62905 : tree _q31 = gimple_assign_rhs2 (_a1);
15877 : 62905 : _q31 = do_valueize (valueize, _q31);
15878 : 62905 : if (tree_swap_operands_p (_q30, _q31))
15879 : 107 : std::swap (_q30, _q31);
15880 : 62905 : if ((_q30 == _p0 && ! TREE_SIDE_EFFECTS (_q30)) || (operand_equal_p (_q30, _p0, 0) && types_match (_q30, _p0)))
15881 : : {
15882 : 267 : switch (TREE_CODE (_q31))
15883 : : {
15884 : 243 : case INTEGER_CST:
15885 : 243 : {
15886 : 243 : {
15887 : 243 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _p1, _q31 };
15888 : 243 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
15889 : : )
15890 : : {
15891 : 10 : if (tree_int_cst_sgn (captures[2]) > 0
15892 : : )
15893 : : {
15894 : 10 : gimple_seq *lseq = seq;
15895 : 10 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2096;
15896 : 10 : {
15897 : 10 : tree tem;
15898 : 10 : tem = captures[0];
15899 : 10 : res_op->set_value (tem);
15900 : 10 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1071, __FILE__, __LINE__, true);
15901 : 10 : return true;
15902 : : }
15903 : 0 : next_after_fail2096:;
15904 : : }
15905 : : else
15906 : : {
15907 : 0 : gimple_seq *lseq = seq;
15908 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2097;
15909 : 0 : {
15910 : 0 : tree tem;
15911 : 0 : tem = captures[1];
15912 : 0 : res_op->set_value (tem);
15913 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1072, __FILE__, __LINE__, true);
15914 : 0 : return true;
15915 : : }
15916 : 0 : next_after_fail2097:;
15917 : : }
15918 : : }
15919 : : }
15920 : 233 : break;
15921 : : }
15922 : : default:;
15923 : : }
15924 : : }
15925 : 697191 : break;
15926 : : }
15927 : : default:;
15928 : : }
15929 : : }
15930 : : break;
15931 : 697191 : default:;
15932 : : }
15933 : 697191 : switch (TREE_CODE (_p0))
15934 : : {
15935 : 679526 : case SSA_NAME:
15936 : 679526 : if (gimple *_d1 = get_def (valueize, _p0))
15937 : : {
15938 : 508083 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
15939 : 537519 : switch (gimple_assign_rhs_code (_a1))
15940 : : {
15941 : 97419 : case PLUS_EXPR:
15942 : 97419 : {
15943 : 97419 : tree _q20 = gimple_assign_rhs1 (_a1);
15944 : 97419 : _q20 = do_valueize (valueize, _q20);
15945 : 97419 : tree _q21 = gimple_assign_rhs2 (_a1);
15946 : 97419 : _q21 = do_valueize (valueize, _q21);
15947 : 97419 : if (tree_swap_operands_p (_q20, _q21))
15948 : 2469 : std::swap (_q20, _q21);
15949 : 97419 : switch (TREE_CODE (_q21))
15950 : : {
15951 : 66722 : case INTEGER_CST:
15952 : 66722 : {
15953 : 66722 : if ((_p1 == _q20 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _q20, 0) && types_match (_p1, _q20)))
15954 : : {
15955 : 126 : {
15956 : 126 : tree captures[3] ATTRIBUTE_UNUSED = { _q20, _p0, _q21 };
15957 : 126 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[0]))
15958 : : )
15959 : : {
15960 : 4 : if (tree_int_cst_sgn (captures[2]) > 0
15961 : : )
15962 : : {
15963 : 1 : gimple_seq *lseq = seq;
15964 : 1 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2098;
15965 : 1 : {
15966 : 1 : tree tem;
15967 : 1 : tem = captures[0];
15968 : 1 : res_op->set_value (tem);
15969 : 1 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1071, __FILE__, __LINE__, true);
15970 : 1 : return true;
15971 : : }
15972 : 0 : next_after_fail2098:;
15973 : : }
15974 : : else
15975 : : {
15976 : 3 : gimple_seq *lseq = seq;
15977 : 3 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2099;
15978 : 3 : {
15979 : 3 : tree tem;
15980 : 3 : tem = captures[1];
15981 : 3 : res_op->set_value (tem);
15982 : 3 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1072, __FILE__, __LINE__, true);
15983 : 3 : return true;
15984 : : }
15985 : 0 : next_after_fail2099:;
15986 : : }
15987 : : }
15988 : : }
15989 : : }
15990 : : break;
15991 : : }
15992 : : default:;
15993 : : }
15994 : 697178 : break;
15995 : : }
15996 : 24773 : CASE_CONVERT:
15997 : 24773 : {
15998 : 24773 : tree _q20 = gimple_assign_rhs1 (_a1);
15999 : 24773 : _q20 = do_valueize (valueize, _q20);
16000 : 24773 : switch (TREE_CODE (_q20))
16001 : : {
16002 : 24773 : case SSA_NAME:
16003 : 24773 : if (gimple *_d2 = get_def (valueize, _q20))
16004 : : {
16005 : 24305 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16006 : 23894 : switch (gimple_assign_rhs_code (_a2))
16007 : : {
16008 : 34 : case ADDR_EXPR:
16009 : 34 : {
16010 : 34 : switch (TREE_CODE (_p1))
16011 : : {
16012 : 34 : case SSA_NAME:
16013 : 34 : if (gimple *_d3 = get_def (valueize, _p1))
16014 : : {
16015 : 34 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
16016 : 34 : switch (gimple_assign_rhs_code (_a3))
16017 : : {
16018 : 28 : CASE_CONVERT:
16019 : 28 : {
16020 : 28 : tree _q40 = gimple_assign_rhs1 (_a3);
16021 : 28 : _q40 = do_valueize (valueize, _q40);
16022 : 28 : switch (TREE_CODE (_q40))
16023 : : {
16024 : 28 : case SSA_NAME:
16025 : 28 : if (gimple *_d4 = get_def (valueize, _q40))
16026 : : {
16027 : 28 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
16028 : 56 : switch (gimple_assign_rhs_code (_a4))
16029 : : {
16030 : 28 : case ADDR_EXPR:
16031 : 28 : {
16032 : 28 : {
16033 : 28 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
16034 : 28 : if (gimple_simplify_484 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16035 : 0 : return true;
16036 : : }
16037 : 28 : break;
16038 : : }
16039 : : default:;
16040 : : }
16041 : : }
16042 : : break;
16043 : 0 : case ADDR_EXPR:
16044 : 0 : {
16045 : 0 : {
16046 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
16047 : 0 : if (gimple_simplify_484 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16048 : 0 : return true;
16049 : : }
16050 : 0 : break;
16051 : : }
16052 : : default:;
16053 : : }
16054 : : break;
16055 : : }
16056 : 0 : case ADDR_EXPR:
16057 : 0 : {
16058 : 0 : {
16059 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _p1 };
16060 : 0 : if (gimple_simplify_485 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16061 : 0 : return true;
16062 : : }
16063 : 0 : break;
16064 : : }
16065 : : default:;
16066 : : }
16067 : : }
16068 : : break;
16069 : 0 : case ADDR_EXPR:
16070 : 0 : {
16071 : 0 : {
16072 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _p1 };
16073 : 0 : if (gimple_simplify_485 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16074 : 0 : return true;
16075 : : }
16076 : 0 : break;
16077 : : }
16078 : : default:;
16079 : : }
16080 : : break;
16081 : : }
16082 : : default:;
16083 : : }
16084 : : }
16085 : : break;
16086 : 0 : case ADDR_EXPR:
16087 : 0 : {
16088 : 0 : switch (TREE_CODE (_p1))
16089 : : {
16090 : 0 : case SSA_NAME:
16091 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
16092 : : {
16093 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16094 : 0 : switch (gimple_assign_rhs_code (_a2))
16095 : : {
16096 : 0 : CASE_CONVERT:
16097 : 0 : {
16098 : 0 : tree _q40 = gimple_assign_rhs1 (_a2);
16099 : 0 : _q40 = do_valueize (valueize, _q40);
16100 : 0 : switch (TREE_CODE (_q40))
16101 : : {
16102 : 0 : case SSA_NAME:
16103 : 0 : if (gimple *_d3 = get_def (valueize, _q40))
16104 : : {
16105 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
16106 : 0 : switch (gimple_assign_rhs_code (_a3))
16107 : : {
16108 : 0 : case ADDR_EXPR:
16109 : 0 : {
16110 : 0 : {
16111 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
16112 : 0 : if (gimple_simplify_484 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16113 : 0 : return true;
16114 : : }
16115 : 0 : break;
16116 : : }
16117 : : default:;
16118 : : }
16119 : : }
16120 : : break;
16121 : 0 : case ADDR_EXPR:
16122 : 0 : {
16123 : 0 : {
16124 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
16125 : 0 : if (gimple_simplify_484 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16126 : 0 : return true;
16127 : : }
16128 : 0 : break;
16129 : : }
16130 : : default:;
16131 : : }
16132 : : break;
16133 : : }
16134 : 0 : case ADDR_EXPR:
16135 : 0 : {
16136 : 0 : {
16137 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _p1 };
16138 : 0 : if (gimple_simplify_485 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16139 : 0 : return true;
16140 : : }
16141 : 0 : break;
16142 : : }
16143 : : default:;
16144 : : }
16145 : : }
16146 : : break;
16147 : 0 : case ADDR_EXPR:
16148 : 0 : {
16149 : 0 : {
16150 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _p1 };
16151 : 0 : if (gimple_simplify_485 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16152 : 0 : return true;
16153 : : }
16154 : 0 : break;
16155 : : }
16156 : : default:;
16157 : : }
16158 : : break;
16159 : : }
16160 : : default:;
16161 : : }
16162 : : break;
16163 : : }
16164 : 0 : case ADDR_EXPR:
16165 : 0 : {
16166 : 0 : switch (TREE_CODE (_p1))
16167 : : {
16168 : 0 : case SSA_NAME:
16169 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
16170 : : {
16171 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16172 : 0 : switch (gimple_assign_rhs_code (_a2))
16173 : : {
16174 : 0 : CASE_CONVERT:
16175 : 0 : {
16176 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
16177 : 0 : _q30 = do_valueize (valueize, _q30);
16178 : 0 : switch (TREE_CODE (_q30))
16179 : : {
16180 : 0 : case SSA_NAME:
16181 : 0 : if (gimple *_d3 = get_def (valueize, _q30))
16182 : : {
16183 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
16184 : 0 : switch (gimple_assign_rhs_code (_a3))
16185 : : {
16186 : 0 : case ADDR_EXPR:
16187 : 0 : {
16188 : 0 : {
16189 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _q30 };
16190 : 0 : if (gimple_simplify_486 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16191 : 0 : return true;
16192 : : }
16193 : 0 : break;
16194 : : }
16195 : : default:;
16196 : : }
16197 : : }
16198 : : break;
16199 : 0 : case ADDR_EXPR:
16200 : 0 : {
16201 : 0 : {
16202 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _q30 };
16203 : 0 : if (gimple_simplify_486 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16204 : 0 : return true;
16205 : : }
16206 : 0 : break;
16207 : : }
16208 : : default:;
16209 : : }
16210 : : break;
16211 : : }
16212 : 0 : case ADDR_EXPR:
16213 : 0 : {
16214 : 0 : {
16215 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _p1 };
16216 : 0 : if (gimple_simplify_487 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16217 : 0 : return true;
16218 : : }
16219 : 0 : break;
16220 : : }
16221 : : default:;
16222 : : }
16223 : : }
16224 : : break;
16225 : 0 : case ADDR_EXPR:
16226 : 0 : {
16227 : 0 : {
16228 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _p1 };
16229 : 0 : if (gimple_simplify_487 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16230 : 0 : return true;
16231 : : }
16232 : 0 : break;
16233 : : }
16234 : : default:;
16235 : : }
16236 : : break;
16237 : : }
16238 : 295 : case NEGATE_EXPR:
16239 : 295 : {
16240 : 295 : tree _q20 = gimple_assign_rhs1 (_a1);
16241 : 295 : _q20 = do_valueize (valueize, _q20);
16242 : 295 : switch (TREE_CODE (_p1))
16243 : : {
16244 : 29 : case SSA_NAME:
16245 : 29 : if (gimple *_d2 = get_def (valueize, _p1))
16246 : : {
16247 : 29 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16248 : 29 : switch (gimple_assign_rhs_code (_a2))
16249 : : {
16250 : 4 : case NEGATE_EXPR:
16251 : 4 : {
16252 : 4 : tree _q40 = gimple_assign_rhs1 (_a2);
16253 : 4 : _q40 = do_valueize (valueize, _q40);
16254 : 4 : {
16255 : 4 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
16256 : 4 : if (FLOAT_TYPE_P (TREE_TYPE (captures[1]))
16257 : 4 : || (ANY_INTEGRAL_TYPE_P (TREE_TYPE (captures[1]))
16258 : 0 : && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[1])))
16259 : : )
16260 : : {
16261 : 4 : gimple_seq *lseq = seq;
16262 : 4 : if (lseq
16263 : 2 : && (!single_use (captures[0])
16264 : 2 : || !single_use (captures[2])))
16265 : 2 : lseq = NULL;
16266 : 4 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2100;
16267 : 4 : {
16268 : 4 : res_op->set_op (NEGATE_EXPR, type, 1);
16269 : 4 : {
16270 : 4 : tree _o1[2], _r1;
16271 : 4 : _o1[0] = captures[1];
16272 : 4 : _o1[1] = captures[3];
16273 : 4 : gimple_match_op tem_op (res_op->cond.any_else (), MAX_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16274 : 4 : tem_op.resimplify (lseq, valueize);
16275 : 4 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
16276 : 4 : if (!_r1) goto next_after_fail2100;
16277 : 2 : res_op->ops[0] = _r1;
16278 : : }
16279 : 2 : res_op->resimplify (lseq, valueize);
16280 : 2 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1073, __FILE__, __LINE__, true);
16281 : 2 : return true;
16282 : : }
16283 : 2 : next_after_fail2100:;
16284 : : }
16285 : : }
16286 : 2 : break;
16287 : : }
16288 : : default:;
16289 : : }
16290 : : }
16291 : : break;
16292 : : default:;
16293 : : }
16294 : : break;
16295 : : }
16296 : 223 : case BIT_NOT_EXPR:
16297 : 223 : {
16298 : 223 : tree _q20 = gimple_assign_rhs1 (_a1);
16299 : 223 : _q20 = do_valueize (valueize, _q20);
16300 : 223 : switch (TREE_CODE (_p1))
16301 : : {
16302 : 167 : case SSA_NAME:
16303 : 167 : if (gimple *_d2 = get_def (valueize, _p1))
16304 : : {
16305 : 167 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16306 : 165 : switch (gimple_assign_rhs_code (_a2))
16307 : : {
16308 : 101 : case BIT_NOT_EXPR:
16309 : 101 : {
16310 : 101 : tree _q40 = gimple_assign_rhs1 (_a2);
16311 : 101 : _q40 = do_valueize (valueize, _q40);
16312 : 101 : {
16313 : 101 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _q20, _p1, _q40 };
16314 : 101 : if (gimple_simplify_488 (res_op, seq, valueize, type, captures, MIN_EXPR, MAX_EXPR))
16315 : 4 : return true;
16316 : : }
16317 : 97 : break;
16318 : : }
16319 : : default:;
16320 : : }
16321 : : }
16322 : : break;
16323 : : default:;
16324 : : }
16325 : : break;
16326 : : }
16327 : 0 : case VEC_COND_EXPR:
16328 : 0 : {
16329 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
16330 : 0 : _q20 = do_valueize (valueize, _q20);
16331 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
16332 : 0 : _q21 = do_valueize (valueize, _q21);
16333 : 0 : tree _q22 = gimple_assign_rhs3 (_a1);
16334 : 0 : _q22 = do_valueize (valueize, _q22);
16335 : 0 : switch (TREE_CODE (_p1))
16336 : : {
16337 : 0 : case SSA_NAME:
16338 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
16339 : : {
16340 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16341 : 0 : switch (gimple_assign_rhs_code (_a2))
16342 : : {
16343 : 0 : case VEC_COND_EXPR:
16344 : 0 : {
16345 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
16346 : 0 : _q60 = do_valueize (valueize, _q60);
16347 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
16348 : 0 : _q61 = do_valueize (valueize, _q61);
16349 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
16350 : 0 : _q62 = do_valueize (valueize, _q62);
16351 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
16352 : : {
16353 : 0 : {
16354 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
16355 : 0 : if (TREE_CODE_CLASS (MIN_EXPR) != tcc_comparison
16356 : : || types_match (type, TREE_TYPE (captures[2]))
16357 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
16358 : : || (optimize_vectors_before_lowering_p ()
16359 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
16360 : : TREE_TYPE (captures[1]), ERROR_MARK))
16361 : : )
16362 : : {
16363 : 0 : gimple_seq *lseq = seq;
16364 : 0 : if (lseq
16365 : 0 : && (!single_use (captures[0])
16366 : 0 : || !single_use (captures[4])))
16367 : 0 : lseq = NULL;
16368 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2101;
16369 : 0 : {
16370 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
16371 : 0 : res_op->ops[0] = captures[1];
16372 : 0 : {
16373 : 0 : tree _o1[2], _r1;
16374 : 0 : _o1[0] = captures[2];
16375 : 0 : _o1[1] = captures[5];
16376 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16377 : 0 : tem_op.resimplify (NULL, valueize);
16378 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16379 : 0 : if (!_r1) goto next_after_fail2101;
16380 : 0 : res_op->ops[1] = _r1;
16381 : : }
16382 : 0 : {
16383 : 0 : tree _o1[2], _r1;
16384 : 0 : _o1[0] = captures[3];
16385 : 0 : _o1[1] = captures[6];
16386 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16387 : 0 : tem_op.resimplify (NULL, valueize);
16388 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16389 : 0 : if (!_r1) goto next_after_fail2101;
16390 : 0 : res_op->ops[2] = _r1;
16391 : : }
16392 : 0 : res_op->resimplify (lseq, valueize);
16393 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
16394 : 0 : return true;
16395 : : }
16396 : 0 : next_after_fail2101:;
16397 : : }
16398 : : }
16399 : : }
16400 : : break;
16401 : : }
16402 : : default:;
16403 : : }
16404 : : }
16405 : : break;
16406 : 0 : default:;
16407 : : }
16408 : 0 : {
16409 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
16410 : 0 : if (TREE_CODE_CLASS (MIN_EXPR) != tcc_comparison
16411 : : || types_match (type, TREE_TYPE (captures[2]))
16412 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
16413 : : || (optimize_vectors_before_lowering_p ()
16414 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
16415 : : TREE_TYPE (captures[1]), ERROR_MARK))
16416 : : )
16417 : : {
16418 : 0 : gimple_seq *lseq = seq;
16419 : 0 : if (lseq
16420 : 0 : && (!single_use (captures[0])))
16421 : 0 : lseq = NULL;
16422 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2102;
16423 : 0 : {
16424 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
16425 : 0 : res_op->ops[0] = captures[1];
16426 : 0 : {
16427 : 0 : tree _o1[2], _r1;
16428 : 0 : _o1[0] = captures[2];
16429 : 0 : _o1[1] = captures[4];
16430 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16431 : 0 : tem_op.resimplify (NULL, valueize);
16432 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16433 : 0 : if (!_r1) goto next_after_fail2102;
16434 : 0 : res_op->ops[1] = _r1;
16435 : : }
16436 : 0 : {
16437 : 0 : tree _o1[2], _r1;
16438 : 0 : _o1[0] = captures[3];
16439 : 0 : _o1[1] = captures[4];
16440 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16441 : 0 : tem_op.resimplify (NULL, valueize);
16442 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16443 : 0 : if (!_r1) goto next_after_fail2102;
16444 : 0 : res_op->ops[2] = _r1;
16445 : : }
16446 : 0 : res_op->resimplify (lseq, valueize);
16447 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
16448 : 0 : return true;
16449 : : }
16450 : 0 : next_after_fail2102:;
16451 : : }
16452 : : }
16453 : 0 : break;
16454 : : }
16455 : : default:;
16456 : : }
16457 : : }
16458 : : break;
16459 : 762 : case ADDR_EXPR:
16460 : 762 : {
16461 : 762 : switch (TREE_CODE (_p1))
16462 : : {
16463 : 659 : case SSA_NAME:
16464 : 659 : if (gimple *_d1 = get_def (valueize, _p1))
16465 : : {
16466 : 539 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
16467 : 166 : switch (gimple_assign_rhs_code (_a1))
16468 : : {
16469 : 0 : CASE_CONVERT:
16470 : 0 : {
16471 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
16472 : 0 : _q30 = do_valueize (valueize, _q30);
16473 : 0 : switch (TREE_CODE (_q30))
16474 : : {
16475 : 0 : case SSA_NAME:
16476 : 0 : if (gimple *_d2 = get_def (valueize, _q30))
16477 : : {
16478 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16479 : 0 : switch (gimple_assign_rhs_code (_a2))
16480 : : {
16481 : 0 : case ADDR_EXPR:
16482 : 0 : {
16483 : 0 : {
16484 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _q30 };
16485 : 0 : if (gimple_simplify_486 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16486 : 0 : return true;
16487 : : }
16488 : 0 : break;
16489 : : }
16490 : : default:;
16491 : : }
16492 : : }
16493 : : break;
16494 : 0 : case ADDR_EXPR:
16495 : 0 : {
16496 : 0 : {
16497 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _q30 };
16498 : 0 : if (gimple_simplify_486 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16499 : 0 : return true;
16500 : : }
16501 : 0 : break;
16502 : : }
16503 : : default:;
16504 : : }
16505 : : break;
16506 : : }
16507 : 0 : case ADDR_EXPR:
16508 : 0 : {
16509 : 0 : {
16510 : 0 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _p1 };
16511 : 0 : if (gimple_simplify_487 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16512 : 0 : return true;
16513 : : }
16514 : 0 : break;
16515 : : }
16516 : : default:;
16517 : : }
16518 : : }
16519 : : break;
16520 : 94 : case ADDR_EXPR:
16521 : 94 : {
16522 : 94 : {
16523 : 94 : tree captures[4] ATTRIBUTE_UNUSED = { _p0, _p0, _p1, _p1 };
16524 : 94 : if (gimple_simplify_487 (res_op, seq, valueize, type, captures, MIN_EXPR, LT_EXPR))
16525 : 3 : return true;
16526 : : }
16527 : 91 : break;
16528 : : }
16529 : : default:;
16530 : : }
16531 : : break;
16532 : : }
16533 : 697178 : default:;
16534 : : }
16535 : 697178 : switch (TREE_CODE (_p1))
16536 : : {
16537 : 458303 : case SSA_NAME:
16538 : 458303 : if (gimple *_d1 = get_def (valueize, _p1))
16539 : : {
16540 : 369488 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
16541 : 412299 : switch (gimple_assign_rhs_code (_a1))
16542 : : {
16543 : 0 : case VEC_COND_EXPR:
16544 : 0 : {
16545 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
16546 : 0 : _q30 = do_valueize (valueize, _q30);
16547 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
16548 : 0 : _q31 = do_valueize (valueize, _q31);
16549 : 0 : tree _q32 = gimple_assign_rhs3 (_a1);
16550 : 0 : _q32 = do_valueize (valueize, _q32);
16551 : 0 : {
16552 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
16553 : 0 : if (TREE_CODE_CLASS (MIN_EXPR) != tcc_comparison
16554 : : || types_match (type, TREE_TYPE (captures[3]))
16555 : : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
16556 : : || (optimize_vectors_before_lowering_p ()
16557 : : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
16558 : : TREE_TYPE (captures[2]), ERROR_MARK))
16559 : : )
16560 : : {
16561 : 0 : gimple_seq *lseq = seq;
16562 : 0 : if (lseq
16563 : 0 : && (!single_use (captures[1])))
16564 : 0 : lseq = NULL;
16565 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2103;
16566 : 0 : {
16567 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
16568 : 0 : res_op->ops[0] = captures[2];
16569 : 0 : {
16570 : 0 : tree _o1[2], _r1;
16571 : 0 : _o1[0] = captures[0];
16572 : 0 : _o1[1] = captures[3];
16573 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16574 : 0 : tem_op.resimplify (NULL, valueize);
16575 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16576 : 0 : if (!_r1) goto next_after_fail2103;
16577 : 0 : res_op->ops[1] = _r1;
16578 : : }
16579 : 0 : {
16580 : 0 : tree _o1[2], _r1;
16581 : 0 : _o1[0] = captures[0];
16582 : 0 : _o1[1] = captures[4];
16583 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), MIN_EXPR, TREE_TYPE (_o1[0]), _o1[0], _o1[1]);
16584 : 0 : tem_op.resimplify (NULL, valueize);
16585 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16586 : 0 : if (!_r1) goto next_after_fail2103;
16587 : 0 : res_op->ops[2] = _r1;
16588 : : }
16589 : 0 : res_op->resimplify (lseq, valueize);
16590 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
16591 : 0 : return true;
16592 : : }
16593 : 0 : next_after_fail2103:;
16594 : : }
16595 : : }
16596 : 0 : break;
16597 : : }
16598 : : default:;
16599 : : }
16600 : : }
16601 : : break;
16602 : 697178 : default:;
16603 : : }
16604 : 697178 : if (gimple_zero_one_valued_p (_p0, valueize))
16605 : : {
16606 : 34 : if (gimple_zero_one_valued_p (_p1, valueize))
16607 : : {
16608 : 17 : {
16609 : 17 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
16610 : 17 : if (gimple_simplify_489 (res_op, seq, valueize, type, captures, MIN_EXPR, BIT_AND_EXPR))
16611 : 17 : return true;
16612 : : }
16613 : : }
16614 : : }
16615 : : return false;
16616 : : }
16617 : :
16618 : : bool
16619 : 278224 : gimple_simplify_UNGE_EXPR (gimple_match_op *res_op, gimple_seq *seq,
16620 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
16621 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
16622 : : {
16623 : 278224 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
16624 : 278224 : switch (TREE_CODE (_p0))
16625 : : {
16626 : 265455 : case SSA_NAME:
16627 : 265455 : if (gimple *_d1 = get_def (valueize, _p0))
16628 : : {
16629 : 122874 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
16630 : 119561 : switch (gimple_assign_rhs_code (_a1))
16631 : : {
16632 : 0 : case VEC_COND_EXPR:
16633 : 0 : {
16634 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
16635 : 0 : _q20 = do_valueize (valueize, _q20);
16636 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
16637 : 0 : _q21 = do_valueize (valueize, _q21);
16638 : 0 : tree _q22 = gimple_assign_rhs3 (_a1);
16639 : 0 : _q22 = do_valueize (valueize, _q22);
16640 : 0 : switch (TREE_CODE (_p1))
16641 : : {
16642 : 0 : case SSA_NAME:
16643 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
16644 : : {
16645 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16646 : 0 : switch (gimple_assign_rhs_code (_a2))
16647 : : {
16648 : 0 : case VEC_COND_EXPR:
16649 : 0 : {
16650 : 0 : tree _q60 = gimple_assign_rhs1 (_a2);
16651 : 0 : _q60 = do_valueize (valueize, _q60);
16652 : 0 : tree _q61 = gimple_assign_rhs2 (_a2);
16653 : 0 : _q61 = do_valueize (valueize, _q61);
16654 : 0 : tree _q62 = gimple_assign_rhs3 (_a2);
16655 : 0 : _q62 = do_valueize (valueize, _q62);
16656 : 0 : if ((_q60 == _q20 && ! TREE_SIDE_EFFECTS (_q60)) || (operand_equal_p (_q60, _q20, 0) && types_match (_q60, _q20)))
16657 : : {
16658 : 0 : {
16659 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1, _q61, _q62 };
16660 : 0 : if (TREE_CODE_CLASS (UNGE_EXPR) != tcc_comparison
16661 : 0 : || types_match (type, TREE_TYPE (captures[2]))
16662 : 0 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
16663 : : || (optimize_vectors_before_lowering_p ()
16664 : 0 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
16665 : 0 : TREE_TYPE (captures[1]), ERROR_MARK))
16666 : : )
16667 : : {
16668 : 0 : gimple_seq *lseq = seq;
16669 : 0 : if (lseq
16670 : 0 : && (!single_use (captures[0])
16671 : 0 : || !single_use (captures[4])))
16672 : 0 : lseq = NULL;
16673 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2157;
16674 : 0 : {
16675 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
16676 : 0 : res_op->ops[0] = captures[1];
16677 : 0 : {
16678 : 0 : tree _o1[2], _r1;
16679 : 0 : _o1[0] = captures[2];
16680 : 0 : _o1[1] = captures[5];
16681 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), UNGE_EXPR, type, _o1[0], _o1[1]);
16682 : 0 : tem_op.resimplify (NULL, valueize);
16683 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16684 : 0 : if (!_r1) goto next_after_fail2157;
16685 : 0 : res_op->ops[1] = _r1;
16686 : : }
16687 : 0 : {
16688 : 0 : tree _o1[2], _r1;
16689 : 0 : _o1[0] = captures[3];
16690 : 0 : _o1[1] = captures[6];
16691 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), UNGE_EXPR, type, _o1[0], _o1[1]);
16692 : 0 : tem_op.resimplify (NULL, valueize);
16693 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16694 : 0 : if (!_r1) goto next_after_fail2157;
16695 : 0 : res_op->ops[2] = _r1;
16696 : : }
16697 : 0 : res_op->resimplify (lseq, valueize);
16698 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 925, __FILE__, __LINE__, true);
16699 : 0 : return true;
16700 : : }
16701 : 0 : next_after_fail2157:;
16702 : : }
16703 : : }
16704 : : }
16705 : : break;
16706 : : }
16707 : : default:;
16708 : : }
16709 : : }
16710 : : break;
16711 : 0 : default:;
16712 : : }
16713 : 0 : {
16714 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _q20, _q21, _q22, _p1 };
16715 : 0 : if (TREE_CODE_CLASS (UNGE_EXPR) != tcc_comparison
16716 : 0 : || types_match (type, TREE_TYPE (captures[2]))
16717 : 0 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[1]), ERROR_MARK)
16718 : : || (optimize_vectors_before_lowering_p ()
16719 : 0 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[2]),
16720 : 0 : TREE_TYPE (captures[1]), ERROR_MARK))
16721 : : )
16722 : : {
16723 : 0 : gimple_seq *lseq = seq;
16724 : 0 : if (lseq
16725 : 0 : && (!single_use (captures[0])))
16726 : 0 : lseq = NULL;
16727 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2158;
16728 : 0 : {
16729 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
16730 : 0 : res_op->ops[0] = captures[1];
16731 : 0 : {
16732 : 0 : tree _o1[2], _r1;
16733 : 0 : _o1[0] = captures[2];
16734 : 0 : _o1[1] = captures[4];
16735 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), UNGE_EXPR, type, _o1[0], _o1[1]);
16736 : 0 : tem_op.resimplify (NULL, valueize);
16737 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16738 : 0 : if (!_r1) goto next_after_fail2158;
16739 : 0 : res_op->ops[1] = _r1;
16740 : : }
16741 : 0 : {
16742 : 0 : tree _o1[2], _r1;
16743 : 0 : _o1[0] = captures[3];
16744 : 0 : _o1[1] = captures[4];
16745 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), UNGE_EXPR, type, _o1[0], _o1[1]);
16746 : 0 : tem_op.resimplify (NULL, valueize);
16747 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16748 : 0 : if (!_r1) goto next_after_fail2158;
16749 : 0 : res_op->ops[2] = _r1;
16750 : : }
16751 : 0 : res_op->resimplify (lseq, valueize);
16752 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 926, __FILE__, __LINE__, true);
16753 : 0 : return true;
16754 : : }
16755 : 0 : next_after_fail2158:;
16756 : : }
16757 : : }
16758 : 0 : break;
16759 : : }
16760 : : default:;
16761 : : }
16762 : : }
16763 : : break;
16764 : 278224 : default:;
16765 : : }
16766 : 278224 : switch (TREE_CODE (_p1))
16767 : : {
16768 : 26825 : case SSA_NAME:
16769 : 26825 : if (gimple *_d1 = get_def (valueize, _p1))
16770 : : {
16771 : 11787 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
16772 : 11016 : switch (gimple_assign_rhs_code (_a1))
16773 : : {
16774 : 0 : case VEC_COND_EXPR:
16775 : 0 : {
16776 : 0 : tree _q30 = gimple_assign_rhs1 (_a1);
16777 : 0 : _q30 = do_valueize (valueize, _q30);
16778 : 0 : tree _q31 = gimple_assign_rhs2 (_a1);
16779 : 0 : _q31 = do_valueize (valueize, _q31);
16780 : 0 : tree _q32 = gimple_assign_rhs3 (_a1);
16781 : 0 : _q32 = do_valueize (valueize, _q32);
16782 : 0 : {
16783 : 0 : tree captures[5] ATTRIBUTE_UNUSED = { _p0, _p1, _q30, _q31, _q32 };
16784 : 0 : if (TREE_CODE_CLASS (UNGE_EXPR) != tcc_comparison
16785 : 0 : || types_match (type, TREE_TYPE (captures[3]))
16786 : 0 : || expand_vec_cond_expr_p (type, TREE_TYPE (captures[2]), ERROR_MARK)
16787 : : || (optimize_vectors_before_lowering_p ()
16788 : 0 : && !expand_vec_cond_expr_p (TREE_TYPE (captures[3]),
16789 : 0 : TREE_TYPE (captures[2]), ERROR_MARK))
16790 : : )
16791 : : {
16792 : 0 : gimple_seq *lseq = seq;
16793 : 0 : if (lseq
16794 : 0 : && (!single_use (captures[1])))
16795 : 0 : lseq = NULL;
16796 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2159;
16797 : 0 : {
16798 : 0 : res_op->set_op (VEC_COND_EXPR, type, 3);
16799 : 0 : res_op->ops[0] = captures[2];
16800 : 0 : {
16801 : 0 : tree _o1[2], _r1;
16802 : 0 : _o1[0] = captures[0];
16803 : 0 : _o1[1] = captures[3];
16804 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), UNGE_EXPR, type, _o1[0], _o1[1]);
16805 : 0 : tem_op.resimplify (NULL, valueize);
16806 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16807 : 0 : if (!_r1) goto next_after_fail2159;
16808 : 0 : res_op->ops[1] = _r1;
16809 : : }
16810 : 0 : {
16811 : 0 : tree _o1[2], _r1;
16812 : 0 : _o1[0] = captures[0];
16813 : 0 : _o1[1] = captures[4];
16814 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), UNGE_EXPR, type, _o1[0], _o1[1]);
16815 : 0 : tem_op.resimplify (NULL, valueize);
16816 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, NULL);
16817 : 0 : if (!_r1) goto next_after_fail2159;
16818 : 0 : res_op->ops[2] = _r1;
16819 : : }
16820 : 0 : res_op->resimplify (lseq, valueize);
16821 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 927, __FILE__, __LINE__, true);
16822 : 0 : return true;
16823 : : }
16824 : 0 : next_after_fail2159:;
16825 : : }
16826 : : }
16827 : 0 : break;
16828 : : }
16829 : : default:;
16830 : : }
16831 : : }
16832 : : break;
16833 : 278224 : default:;
16834 : : }
16835 : 278224 : if ((_p1 == _p0 && ! TREE_SIDE_EFFECTS (_p1)) || (operand_equal_p (_p1, _p0, 0) && types_match (_p1, _p0)))
16836 : : {
16837 : 13 : {
16838 : 13 : tree captures[1] ATTRIBUTE_UNUSED = { _p0 };
16839 : 13 : if (gimple_simplify_596 (res_op, seq, valueize, type, captures, UNGE_EXPR))
16840 : 13 : return true;
16841 : : }
16842 : : }
16843 : 278211 : switch (TREE_CODE (_p0))
16844 : : {
16845 : 265442 : case SSA_NAME:
16846 : 265442 : if (gimple *_d1 = get_def (valueize, _p0))
16847 : : {
16848 : 122864 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
16849 : 119561 : switch (gimple_assign_rhs_code (_a1))
16850 : : {
16851 : 874 : case FLOAT_EXPR:
16852 : 874 : {
16853 : 874 : tree _q20 = gimple_assign_rhs1 (_a1);
16854 : 874 : _q20 = do_valueize (valueize, _q20);
16855 : 874 : switch (TREE_CODE (_p1))
16856 : : {
16857 : 0 : case SSA_NAME:
16858 : 0 : if (gimple *_d2 = get_def (valueize, _p1))
16859 : : {
16860 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16861 : 0 : switch (gimple_assign_rhs_code (_a2))
16862 : : {
16863 : 0 : case FLOAT_EXPR:
16864 : 0 : {
16865 : 0 : tree _q40 = gimple_assign_rhs1 (_a2);
16866 : 0 : _q40 = do_valueize (valueize, _q40);
16867 : 0 : {
16868 : 0 : tree captures[3] ATTRIBUTE_UNUSED = { _p0, _q20, _q40 };
16869 : 0 : if (gimple_simplify_257 (res_op, seq, valueize, type, captures, UNGE_EXPR, GE_EXPR))
16870 : 0 : return true;
16871 : : }
16872 : 0 : break;
16873 : : }
16874 : : default:;
16875 : : }
16876 : : }
16877 : : break;
16878 : : default:;
16879 : : }
16880 : : break;
16881 : : }
16882 : 43 : case NEGATE_EXPR:
16883 : 43 : {
16884 : 43 : tree _q20 = gimple_assign_rhs1 (_a1);
16885 : 43 : _q20 = do_valueize (valueize, _q20);
16886 : 43 : switch (TREE_CODE (_p1))
16887 : : {
16888 : 30 : case SSA_NAME:
16889 : 30 : if (gimple *_d2 = get_def (valueize, _p1))
16890 : : {
16891 : 30 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
16892 : 30 : switch (gimple_assign_rhs_code (_a2))
16893 : : {
16894 : 30 : case NEGATE_EXPR:
16895 : 30 : {
16896 : 30 : tree _q40 = gimple_assign_rhs1 (_a2);
16897 : 30 : _q40 = do_valueize (valueize, _q40);
16898 : 30 : {
16899 : 30 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _q40 };
16900 : 30 : if (gimple_simplify_260 (res_op, seq, valueize, type, captures, UNGE_EXPR, UNLE_EXPR))
16901 : 30 : return true;
16902 : : }
16903 : 0 : break;
16904 : : }
16905 : : default:;
16906 : : }
16907 : : }
16908 : : break;
16909 : 13 : default:;
16910 : : }
16911 : 13 : if (CONSTANT_CLASS_P (_p1))
16912 : : {
16913 : 13 : {
16914 : 13 : tree captures[2] ATTRIBUTE_UNUSED = { _q20, _p1 };
16915 : 13 : if (gimple_simplify_261 (res_op, seq, valueize, type, captures, UNGE_EXPR, UNLE_EXPR))
16916 : 13 : return true;
16917 : : }
16918 : : }
16919 : : break;
16920 : : }
16921 : : default:;
16922 : : }
16923 : : }
16924 : : break;
16925 : 278168 : default:;
16926 : : }
16927 : 278168 : switch (TREE_CODE (_p1))
16928 : : {
16929 : 248634 : case REAL_CST:
16930 : 248634 : {
16931 : 248634 : {
16932 : 248634 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
16933 : 248634 : if (gimple_simplify_594 (res_op, seq, valueize, type, captures, UNGE_EXPR))
16934 : 0 : return true;
16935 : : }
16936 : 248634 : break;
16937 : : }
16938 : : default:;
16939 : : }
16940 : : return false;
16941 : : }
16942 : :
16943 : : bool
16944 : 4593 : gimple_simplify_CFN_BUILT_IN_SCALBNF (gimple_match_op *res_op, gimple_seq *seq,
16945 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
16946 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
16947 : : {
16948 : 4593 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
16949 : 4593 : if (real_zerop (_p0))
16950 : : {
16951 : 28 : {
16952 : 28 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
16953 : 28 : if (gimple_simplify_608 (res_op, seq, valueize, type, captures))
16954 : 28 : return true;
16955 : : }
16956 : : }
16957 : 4565 : if (integer_zerop (_p1))
16958 : : {
16959 : 7 : {
16960 : 7 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
16961 : 7 : if (gimple_simplify_609 (res_op, seq, valueize, type, captures))
16962 : 7 : return true;
16963 : : }
16964 : : }
16965 : 4558 : switch (TREE_CODE (_p0))
16966 : : {
16967 : 2348 : case REAL_CST:
16968 : 2348 : {
16969 : 2348 : {
16970 : 2348 : tree captures[2] ATTRIBUTE_UNUSED = { _p0, _p1 };
16971 : 2348 : if (!real_isfinite (TREE_REAL_CST_PTR (captures[0]))
16972 : : )
16973 : : {
16974 : 71 : gimple_seq *lseq = seq;
16975 : 71 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2171;
16976 : 71 : {
16977 : 71 : tree tem;
16978 : 71 : tem = captures[0];
16979 : 71 : res_op->set_value (tem);
16980 : 71 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 1085, __FILE__, __LINE__, true);
16981 : 71 : return true;
16982 : : }
16983 : 0 : next_after_fail2171:;
16984 : : }
16985 : : }
16986 : 2277 : break;
16987 : : }
16988 : : default:;
16989 : : }
16990 : : return false;
16991 : : }
16992 : :
16993 : : bool
16994 : 0 : gimple_simplify_TRUTH_ORIF_EXPR (gimple_match_op *res_op, gimple_seq *seq,
16995 : : tree (*valueize)(tree) ATTRIBUTE_UNUSED,
16996 : : code_helper ARG_UNUSED (code), tree ARG_UNUSED (type), tree _p0, tree _p1)
16997 : : {
16998 : 0 : const bool debug_dump = dump_file && (dump_flags & TDF_FOLDING);
16999 : 0 : switch (TREE_CODE (_p0))
17000 : : {
17001 : 0 : case SSA_NAME:
17002 : 0 : if (gimple *_d1 = get_def (valueize, _p0))
17003 : : {
17004 : 0 : if (gassign *_a1 = dyn_cast <gassign *> (_d1))
17005 : 0 : switch (gimple_assign_rhs_code (_a1))
17006 : : {
17007 : 0 : case LE_EXPR:
17008 : 0 : {
17009 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
17010 : 0 : _q20 = do_valueize (valueize, _q20);
17011 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
17012 : 0 : _q21 = do_valueize (valueize, _q21);
17013 : 0 : switch (TREE_CODE (_q20))
17014 : : {
17015 : 0 : case SSA_NAME:
17016 : 0 : if (gimple *_d2 = get_def (valueize, _q20))
17017 : : {
17018 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
17019 : 0 : switch (gimple_assign_rhs_code (_a2))
17020 : : {
17021 : 0 : case POINTER_PLUS_EXPR:
17022 : 0 : {
17023 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
17024 : 0 : _q30 = do_valueize (valueize, _q30);
17025 : 0 : tree _q31 = gimple_assign_rhs2 (_a2);
17026 : 0 : _q31 = do_valueize (valueize, _q31);
17027 : 0 : switch (TREE_CODE (_q31))
17028 : : {
17029 : 0 : case INTEGER_CST:
17030 : 0 : {
17031 : 0 : switch (TREE_CODE (_p1))
17032 : : {
17033 : 0 : case SSA_NAME:
17034 : 0 : if (gimple *_d3 = get_def (valueize, _p1))
17035 : : {
17036 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
17037 : 0 : switch (gimple_assign_rhs_code (_a3))
17038 : : {
17039 : 0 : case LE_EXPR:
17040 : 0 : {
17041 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
17042 : 0 : _q70 = do_valueize (valueize, _q70);
17043 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
17044 : 0 : _q71 = do_valueize (valueize, _q71);
17045 : 0 : switch (TREE_CODE (_q70))
17046 : : {
17047 : 0 : case SSA_NAME:
17048 : 0 : if (gimple *_d4 = get_def (valueize, _q70))
17049 : : {
17050 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
17051 : 0 : switch (gimple_assign_rhs_code (_a4))
17052 : : {
17053 : 0 : case POINTER_PLUS_EXPR:
17054 : 0 : {
17055 : 0 : tree _q80 = gimple_assign_rhs1 (_a4);
17056 : 0 : _q80 = do_valueize (valueize, _q80);
17057 : 0 : tree _q81 = gimple_assign_rhs2 (_a4);
17058 : 0 : _q81 = do_valueize (valueize, _q81);
17059 : 0 : if ((_q80 == _q21 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q21, 0) && types_match (_q80, _q21)))
17060 : : {
17061 : 0 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
17062 : : {
17063 : 0 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q30, 0) && types_match (_q71, _q30)))
17064 : : {
17065 : 0 : {
17066 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q70 };
17067 : 0 : const enum tree_code cmp = LE_EXPR;
17068 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
17069 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
17070 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
17071 : : )
17072 : : {
17073 : 0 : {
17074 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
17075 : 0 : offset_int rhs = off * 2;
17076 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
17077 : : )
17078 : : {
17079 : 0 : {
17080 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
17081 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
17082 : 0 : if (cmp == LT_EXPR
17083 : : )
17084 : : {
17085 : : gimple_seq *lseq = seq;
17086 : : if (lseq
17087 : : && (!single_use (captures[0])
17088 : : || !single_use (captures[5])))
17089 : : lseq = NULL;
17090 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2177;
17091 : : {
17092 : : res_op->set_op (GT_EXPR, type, 2);
17093 : : {
17094 : : tree _o1[1], _r1;
17095 : : {
17096 : : tree _o2[2], _r2;
17097 : : _o2[0] = swap_p ? captures[6] : captures[1];
17098 : : _o2[1] = swap_p ? captures[2] : captures[4];
17099 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17100 : : tem_op.resimplify (lseq, valueize);
17101 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17102 : : if (!_r2) goto next_after_fail2177;
17103 : : _o1[0] = _r2;
17104 : : }
17105 : : if (sizetype != TREE_TYPE (_o1[0])
17106 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17107 : : {
17108 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17109 : : tem_op.resimplify (lseq, valueize);
17110 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17111 : : if (!_r1) goto next_after_fail2177;
17112 : : }
17113 : : else
17114 : : _r1 = _o1[0];
17115 : : res_op->ops[0] = _r1;
17116 : : }
17117 : : res_op->ops[1] = rhs_tree;
17118 : : res_op->resimplify (lseq, valueize);
17119 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
17120 : 0 : return true;
17121 : : }
17122 : : next_after_fail2177:;
17123 : : }
17124 : : else
17125 : : {
17126 : 0 : gimple_seq *lseq = seq;
17127 : 0 : if (lseq
17128 : 0 : && (!single_use (captures[0])
17129 : 0 : || !single_use (captures[5])))
17130 : 0 : lseq = NULL;
17131 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2178;
17132 : 0 : {
17133 : 0 : res_op->set_op (GT_EXPR, type, 2);
17134 : 0 : {
17135 : 0 : tree _o1[1], _r1;
17136 : 0 : {
17137 : 0 : tree _o2[2], _r2;
17138 : 0 : {
17139 : 0 : tree _o3[2], _r3;
17140 : 0 : _o3[0] = swap_p ? captures[4] : captures[2];
17141 : 0 : _o3[1] = wide_int_to_tree (sizetype, off);
17142 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
17143 : 0 : tem_op.resimplify (lseq, valueize);
17144 : 0 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
17145 : 0 : if (!_r3) goto next_after_fail2178;
17146 : 0 : _o2[0] = _r3;
17147 : : }
17148 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
17149 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17150 : 0 : tem_op.resimplify (lseq, valueize);
17151 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17152 : 0 : if (!_r2) goto next_after_fail2178;
17153 : 0 : _o1[0] = _r2;
17154 : : }
17155 : 0 : if (sizetype != TREE_TYPE (_o1[0])
17156 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17157 : : {
17158 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17159 : 0 : tem_op.resimplify (lseq, valueize);
17160 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17161 : 0 : if (!_r1) goto next_after_fail2178;
17162 : : }
17163 : : else
17164 : : _r1 = _o1[0];
17165 : 0 : res_op->ops[0] = _r1;
17166 : : }
17167 : 0 : res_op->ops[1] = rhs_tree;
17168 : 0 : res_op->resimplify (lseq, valueize);
17169 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
17170 : 0 : return true;
17171 : : }
17172 : 0 : next_after_fail2178:;
17173 : : }
17174 : : }
17175 : : }
17176 : : }
17177 : : }
17178 : : }
17179 : : }
17180 : : }
17181 : : }
17182 : : break;
17183 : : }
17184 : : default:;
17185 : : }
17186 : : }
17187 : : break;
17188 : : default:;
17189 : : }
17190 : : break;
17191 : : }
17192 : 0 : case GE_EXPR:
17193 : 0 : {
17194 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
17195 : 0 : _q70 = do_valueize (valueize, _q70);
17196 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
17197 : 0 : _q71 = do_valueize (valueize, _q71);
17198 : 0 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
17199 : : {
17200 : 0 : switch (TREE_CODE (_q71))
17201 : : {
17202 : 0 : case SSA_NAME:
17203 : 0 : if (gimple *_d4 = get_def (valueize, _q71))
17204 : : {
17205 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
17206 : 0 : switch (gimple_assign_rhs_code (_a4))
17207 : : {
17208 : 0 : case POINTER_PLUS_EXPR:
17209 : 0 : {
17210 : 0 : tree _q90 = gimple_assign_rhs1 (_a4);
17211 : 0 : _q90 = do_valueize (valueize, _q90);
17212 : 0 : tree _q91 = gimple_assign_rhs2 (_a4);
17213 : 0 : _q91 = do_valueize (valueize, _q91);
17214 : 0 : if ((_q90 == _q21 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q21, 0) && types_match (_q90, _q21)))
17215 : : {
17216 : 0 : if ((_q91 == _q31 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q31, 0) && types_match (_q91, _q31)))
17217 : : {
17218 : 0 : {
17219 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q71 };
17220 : 0 : const enum tree_code cmp = LE_EXPR;
17221 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
17222 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
17223 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
17224 : : )
17225 : : {
17226 : 0 : {
17227 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
17228 : 0 : offset_int rhs = off * 2;
17229 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
17230 : : )
17231 : : {
17232 : 0 : {
17233 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
17234 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
17235 : 0 : if (cmp == LT_EXPR
17236 : : )
17237 : : {
17238 : : gimple_seq *lseq = seq;
17239 : : if (lseq
17240 : : && (!single_use (captures[0])
17241 : : || !single_use (captures[5])))
17242 : : lseq = NULL;
17243 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2179;
17244 : : {
17245 : : res_op->set_op (GT_EXPR, type, 2);
17246 : : {
17247 : : tree _o1[1], _r1;
17248 : : {
17249 : : tree _o2[2], _r2;
17250 : : _o2[0] = swap_p ? captures[6] : captures[1];
17251 : : _o2[1] = swap_p ? captures[2] : captures[4];
17252 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17253 : : tem_op.resimplify (lseq, valueize);
17254 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17255 : : if (!_r2) goto next_after_fail2179;
17256 : : _o1[0] = _r2;
17257 : : }
17258 : : if (sizetype != TREE_TYPE (_o1[0])
17259 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17260 : : {
17261 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17262 : : tem_op.resimplify (lseq, valueize);
17263 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17264 : : if (!_r1) goto next_after_fail2179;
17265 : : }
17266 : : else
17267 : : _r1 = _o1[0];
17268 : : res_op->ops[0] = _r1;
17269 : : }
17270 : : res_op->ops[1] = rhs_tree;
17271 : : res_op->resimplify (lseq, valueize);
17272 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
17273 : 0 : return true;
17274 : : }
17275 : : next_after_fail2179:;
17276 : : }
17277 : : else
17278 : : {
17279 : 0 : gimple_seq *lseq = seq;
17280 : 0 : if (lseq
17281 : 0 : && (!single_use (captures[0])
17282 : 0 : || !single_use (captures[5])))
17283 : 0 : lseq = NULL;
17284 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2180;
17285 : 0 : {
17286 : 0 : res_op->set_op (GT_EXPR, type, 2);
17287 : 0 : {
17288 : 0 : tree _o1[1], _r1;
17289 : 0 : {
17290 : 0 : tree _o2[2], _r2;
17291 : 0 : {
17292 : 0 : tree _o3[2], _r3;
17293 : 0 : _o3[0] = swap_p ? captures[4] : captures[2];
17294 : 0 : _o3[1] = wide_int_to_tree (sizetype, off);
17295 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
17296 : 0 : tem_op.resimplify (lseq, valueize);
17297 : 0 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
17298 : 0 : if (!_r3) goto next_after_fail2180;
17299 : 0 : _o2[0] = _r3;
17300 : : }
17301 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
17302 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17303 : 0 : tem_op.resimplify (lseq, valueize);
17304 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17305 : 0 : if (!_r2) goto next_after_fail2180;
17306 : 0 : _o1[0] = _r2;
17307 : : }
17308 : 0 : if (sizetype != TREE_TYPE (_o1[0])
17309 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17310 : : {
17311 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17312 : 0 : tem_op.resimplify (lseq, valueize);
17313 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17314 : 0 : if (!_r1) goto next_after_fail2180;
17315 : : }
17316 : : else
17317 : : _r1 = _o1[0];
17318 : 0 : res_op->ops[0] = _r1;
17319 : : }
17320 : 0 : res_op->ops[1] = rhs_tree;
17321 : 0 : res_op->resimplify (lseq, valueize);
17322 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
17323 : 0 : return true;
17324 : : }
17325 : 0 : next_after_fail2180:;
17326 : : }
17327 : : }
17328 : : }
17329 : : }
17330 : : }
17331 : : }
17332 : : }
17333 : : }
17334 : : break;
17335 : : }
17336 : : default:;
17337 : : }
17338 : : }
17339 : : break;
17340 : : default:;
17341 : : }
17342 : : }
17343 : : break;
17344 : : }
17345 : : default:;
17346 : : }
17347 : : }
17348 : : break;
17349 : : default:;
17350 : : }
17351 : : break;
17352 : : }
17353 : : default:;
17354 : : }
17355 : : break;
17356 : : }
17357 : : default:;
17358 : : }
17359 : : }
17360 : : break;
17361 : : default:;
17362 : : }
17363 : : break;
17364 : : }
17365 : 0 : case LT_EXPR:
17366 : 0 : {
17367 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
17368 : 0 : _q20 = do_valueize (valueize, _q20);
17369 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
17370 : 0 : _q21 = do_valueize (valueize, _q21);
17371 : 0 : switch (TREE_CODE (_q20))
17372 : : {
17373 : 0 : case SSA_NAME:
17374 : 0 : if (gimple *_d2 = get_def (valueize, _q20))
17375 : : {
17376 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
17377 : 0 : switch (gimple_assign_rhs_code (_a2))
17378 : : {
17379 : 0 : case POINTER_PLUS_EXPR:
17380 : 0 : {
17381 : 0 : tree _q30 = gimple_assign_rhs1 (_a2);
17382 : 0 : _q30 = do_valueize (valueize, _q30);
17383 : 0 : tree _q31 = gimple_assign_rhs2 (_a2);
17384 : 0 : _q31 = do_valueize (valueize, _q31);
17385 : 0 : switch (TREE_CODE (_q31))
17386 : : {
17387 : 0 : case INTEGER_CST:
17388 : 0 : {
17389 : 0 : switch (TREE_CODE (_p1))
17390 : : {
17391 : 0 : case SSA_NAME:
17392 : 0 : if (gimple *_d3 = get_def (valueize, _p1))
17393 : : {
17394 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
17395 : 0 : switch (gimple_assign_rhs_code (_a3))
17396 : : {
17397 : 0 : case LT_EXPR:
17398 : 0 : {
17399 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
17400 : 0 : _q70 = do_valueize (valueize, _q70);
17401 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
17402 : 0 : _q71 = do_valueize (valueize, _q71);
17403 : 0 : switch (TREE_CODE (_q70))
17404 : : {
17405 : 0 : case SSA_NAME:
17406 : 0 : if (gimple *_d4 = get_def (valueize, _q70))
17407 : : {
17408 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
17409 : 0 : switch (gimple_assign_rhs_code (_a4))
17410 : : {
17411 : 0 : case POINTER_PLUS_EXPR:
17412 : 0 : {
17413 : 0 : tree _q80 = gimple_assign_rhs1 (_a4);
17414 : 0 : _q80 = do_valueize (valueize, _q80);
17415 : 0 : tree _q81 = gimple_assign_rhs2 (_a4);
17416 : 0 : _q81 = do_valueize (valueize, _q81);
17417 : 0 : if ((_q80 == _q21 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q21, 0) && types_match (_q80, _q21)))
17418 : : {
17419 : 0 : if ((_q81 == _q31 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q31, 0) && types_match (_q81, _q31)))
17420 : : {
17421 : 0 : if ((_q71 == _q30 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q30, 0) && types_match (_q71, _q30)))
17422 : : {
17423 : 0 : {
17424 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q70 };
17425 : 0 : const enum tree_code cmp = LT_EXPR;
17426 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
17427 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
17428 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
17429 : : )
17430 : : {
17431 : 0 : {
17432 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
17433 : 0 : offset_int rhs = off * 2;
17434 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
17435 : : )
17436 : : {
17437 : 0 : {
17438 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
17439 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
17440 : 0 : if (cmp == LT_EXPR
17441 : : )
17442 : : {
17443 : 0 : gimple_seq *lseq = seq;
17444 : 0 : if (lseq
17445 : 0 : && (!single_use (captures[0])
17446 : 0 : || !single_use (captures[5])))
17447 : 0 : lseq = NULL;
17448 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2181;
17449 : 0 : {
17450 : 0 : res_op->set_op (GT_EXPR, type, 2);
17451 : 0 : {
17452 : 0 : tree _o1[1], _r1;
17453 : 0 : {
17454 : 0 : tree _o2[2], _r2;
17455 : 0 : _o2[0] = swap_p ? captures[6] : captures[1];
17456 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
17457 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17458 : 0 : tem_op.resimplify (lseq, valueize);
17459 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17460 : 0 : if (!_r2) goto next_after_fail2181;
17461 : 0 : _o1[0] = _r2;
17462 : : }
17463 : 0 : if (sizetype != TREE_TYPE (_o1[0])
17464 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17465 : : {
17466 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17467 : 0 : tem_op.resimplify (lseq, valueize);
17468 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17469 : 0 : if (!_r1) goto next_after_fail2181;
17470 : : }
17471 : : else
17472 : : _r1 = _o1[0];
17473 : 0 : res_op->ops[0] = _r1;
17474 : : }
17475 : 0 : res_op->ops[1] = rhs_tree;
17476 : 0 : res_op->resimplify (lseq, valueize);
17477 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
17478 : 0 : return true;
17479 : : }
17480 : 0 : next_after_fail2181:;
17481 : : }
17482 : : else
17483 : : {
17484 : : gimple_seq *lseq = seq;
17485 : : if (lseq
17486 : : && (!single_use (captures[0])
17487 : : || !single_use (captures[5])))
17488 : : lseq = NULL;
17489 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2182;
17490 : : {
17491 : : res_op->set_op (GT_EXPR, type, 2);
17492 : : {
17493 : : tree _o1[1], _r1;
17494 : : {
17495 : : tree _o2[2], _r2;
17496 : : {
17497 : : tree _o3[2], _r3;
17498 : : _o3[0] = swap_p ? captures[4] : captures[2];
17499 : : _o3[1] = wide_int_to_tree (sizetype, off);
17500 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
17501 : : tem_op.resimplify (lseq, valueize);
17502 : : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
17503 : : if (!_r3) goto next_after_fail2182;
17504 : : _o2[0] = _r3;
17505 : : }
17506 : : _o2[1] = swap_p ? captures[2] : captures[4];
17507 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17508 : : tem_op.resimplify (lseq, valueize);
17509 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17510 : : if (!_r2) goto next_after_fail2182;
17511 : : _o1[0] = _r2;
17512 : : }
17513 : : if (sizetype != TREE_TYPE (_o1[0])
17514 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17515 : : {
17516 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17517 : : tem_op.resimplify (lseq, valueize);
17518 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17519 : : if (!_r1) goto next_after_fail2182;
17520 : : }
17521 : : else
17522 : : _r1 = _o1[0];
17523 : : res_op->ops[0] = _r1;
17524 : : }
17525 : : res_op->ops[1] = rhs_tree;
17526 : : res_op->resimplify (lseq, valueize);
17527 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
17528 : : return true;
17529 : : }
17530 : : next_after_fail2182:;
17531 : : }
17532 : : }
17533 : : }
17534 : : }
17535 : : }
17536 : : }
17537 : : }
17538 : : }
17539 : : }
17540 : : break;
17541 : : }
17542 : : default:;
17543 : : }
17544 : : }
17545 : : break;
17546 : : default:;
17547 : : }
17548 : : break;
17549 : : }
17550 : 0 : case GT_EXPR:
17551 : 0 : {
17552 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
17553 : 0 : _q70 = do_valueize (valueize, _q70);
17554 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
17555 : 0 : _q71 = do_valueize (valueize, _q71);
17556 : 0 : if ((_q70 == _q30 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q30, 0) && types_match (_q70, _q30)))
17557 : : {
17558 : 0 : switch (TREE_CODE (_q71))
17559 : : {
17560 : 0 : case SSA_NAME:
17561 : 0 : if (gimple *_d4 = get_def (valueize, _q71))
17562 : : {
17563 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
17564 : 0 : switch (gimple_assign_rhs_code (_a4))
17565 : : {
17566 : 0 : case POINTER_PLUS_EXPR:
17567 : 0 : {
17568 : 0 : tree _q90 = gimple_assign_rhs1 (_a4);
17569 : 0 : _q90 = do_valueize (valueize, _q90);
17570 : 0 : tree _q91 = gimple_assign_rhs2 (_a4);
17571 : 0 : _q91 = do_valueize (valueize, _q91);
17572 : 0 : if ((_q90 == _q21 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q21, 0) && types_match (_q90, _q21)))
17573 : : {
17574 : 0 : if ((_q91 == _q31 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q31, 0) && types_match (_q91, _q31)))
17575 : : {
17576 : 0 : {
17577 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q20, _q30, _q31, _q21, _p1, _q71 };
17578 : 0 : const enum tree_code cmp = LT_EXPR;
17579 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
17580 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
17581 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
17582 : : )
17583 : : {
17584 : 0 : {
17585 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
17586 : 0 : offset_int rhs = off * 2;
17587 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
17588 : : )
17589 : : {
17590 : 0 : {
17591 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
17592 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
17593 : 0 : if (cmp == LT_EXPR
17594 : : )
17595 : : {
17596 : 0 : gimple_seq *lseq = seq;
17597 : 0 : if (lseq
17598 : 0 : && (!single_use (captures[0])
17599 : 0 : || !single_use (captures[5])))
17600 : 0 : lseq = NULL;
17601 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2183;
17602 : 0 : {
17603 : 0 : res_op->set_op (GT_EXPR, type, 2);
17604 : 0 : {
17605 : 0 : tree _o1[1], _r1;
17606 : 0 : {
17607 : 0 : tree _o2[2], _r2;
17608 : 0 : _o2[0] = swap_p ? captures[6] : captures[1];
17609 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
17610 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17611 : 0 : tem_op.resimplify (lseq, valueize);
17612 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17613 : 0 : if (!_r2) goto next_after_fail2183;
17614 : 0 : _o1[0] = _r2;
17615 : : }
17616 : 0 : if (sizetype != TREE_TYPE (_o1[0])
17617 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17618 : : {
17619 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17620 : 0 : tem_op.resimplify (lseq, valueize);
17621 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17622 : 0 : if (!_r1) goto next_after_fail2183;
17623 : : }
17624 : : else
17625 : : _r1 = _o1[0];
17626 : 0 : res_op->ops[0] = _r1;
17627 : : }
17628 : 0 : res_op->ops[1] = rhs_tree;
17629 : 0 : res_op->resimplify (lseq, valueize);
17630 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
17631 : 0 : return true;
17632 : : }
17633 : 0 : next_after_fail2183:;
17634 : : }
17635 : : else
17636 : : {
17637 : : gimple_seq *lseq = seq;
17638 : : if (lseq
17639 : : && (!single_use (captures[0])
17640 : : || !single_use (captures[5])))
17641 : : lseq = NULL;
17642 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2184;
17643 : : {
17644 : : res_op->set_op (GT_EXPR, type, 2);
17645 : : {
17646 : : tree _o1[1], _r1;
17647 : : {
17648 : : tree _o2[2], _r2;
17649 : : {
17650 : : tree _o3[2], _r3;
17651 : : _o3[0] = swap_p ? captures[4] : captures[2];
17652 : : _o3[1] = wide_int_to_tree (sizetype, off);
17653 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
17654 : : tem_op.resimplify (lseq, valueize);
17655 : : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
17656 : : if (!_r3) goto next_after_fail2184;
17657 : : _o2[0] = _r3;
17658 : : }
17659 : : _o2[1] = swap_p ? captures[2] : captures[4];
17660 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17661 : : tem_op.resimplify (lseq, valueize);
17662 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17663 : : if (!_r2) goto next_after_fail2184;
17664 : : _o1[0] = _r2;
17665 : : }
17666 : : if (sizetype != TREE_TYPE (_o1[0])
17667 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17668 : : {
17669 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17670 : : tem_op.resimplify (lseq, valueize);
17671 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17672 : : if (!_r1) goto next_after_fail2184;
17673 : : }
17674 : : else
17675 : : _r1 = _o1[0];
17676 : : res_op->ops[0] = _r1;
17677 : : }
17678 : : res_op->ops[1] = rhs_tree;
17679 : : res_op->resimplify (lseq, valueize);
17680 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
17681 : : return true;
17682 : : }
17683 : : next_after_fail2184:;
17684 : : }
17685 : : }
17686 : : }
17687 : : }
17688 : : }
17689 : : }
17690 : : }
17691 : : }
17692 : : break;
17693 : : }
17694 : : default:;
17695 : : }
17696 : : }
17697 : : break;
17698 : : default:;
17699 : : }
17700 : : }
17701 : : break;
17702 : : }
17703 : : default:;
17704 : : }
17705 : : }
17706 : : break;
17707 : : default:;
17708 : : }
17709 : : break;
17710 : : }
17711 : : default:;
17712 : : }
17713 : : break;
17714 : : }
17715 : : default:;
17716 : : }
17717 : : }
17718 : : break;
17719 : : default:;
17720 : : }
17721 : : break;
17722 : : }
17723 : 0 : case GE_EXPR:
17724 : 0 : {
17725 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
17726 : 0 : _q20 = do_valueize (valueize, _q20);
17727 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
17728 : 0 : _q21 = do_valueize (valueize, _q21);
17729 : 0 : switch (TREE_CODE (_q21))
17730 : : {
17731 : 0 : case SSA_NAME:
17732 : 0 : if (gimple *_d2 = get_def (valueize, _q21))
17733 : : {
17734 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
17735 : 0 : switch (gimple_assign_rhs_code (_a2))
17736 : : {
17737 : 0 : case POINTER_PLUS_EXPR:
17738 : 0 : {
17739 : 0 : tree _q40 = gimple_assign_rhs1 (_a2);
17740 : 0 : _q40 = do_valueize (valueize, _q40);
17741 : 0 : tree _q41 = gimple_assign_rhs2 (_a2);
17742 : 0 : _q41 = do_valueize (valueize, _q41);
17743 : 0 : switch (TREE_CODE (_q41))
17744 : : {
17745 : 0 : case INTEGER_CST:
17746 : 0 : {
17747 : 0 : switch (TREE_CODE (_p1))
17748 : : {
17749 : 0 : case SSA_NAME:
17750 : 0 : if (gimple *_d3 = get_def (valueize, _p1))
17751 : : {
17752 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
17753 : 0 : switch (gimple_assign_rhs_code (_a3))
17754 : : {
17755 : 0 : case LE_EXPR:
17756 : 0 : {
17757 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
17758 : 0 : _q70 = do_valueize (valueize, _q70);
17759 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
17760 : 0 : _q71 = do_valueize (valueize, _q71);
17761 : 0 : switch (TREE_CODE (_q70))
17762 : : {
17763 : 0 : case SSA_NAME:
17764 : 0 : if (gimple *_d4 = get_def (valueize, _q70))
17765 : : {
17766 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
17767 : 0 : switch (gimple_assign_rhs_code (_a4))
17768 : : {
17769 : 0 : case POINTER_PLUS_EXPR:
17770 : 0 : {
17771 : 0 : tree _q80 = gimple_assign_rhs1 (_a4);
17772 : 0 : _q80 = do_valueize (valueize, _q80);
17773 : 0 : tree _q81 = gimple_assign_rhs2 (_a4);
17774 : 0 : _q81 = do_valueize (valueize, _q81);
17775 : 0 : if ((_q80 == _q20 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q20, 0) && types_match (_q80, _q20)))
17776 : : {
17777 : 0 : if ((_q81 == _q41 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q41, 0) && types_match (_q81, _q41)))
17778 : : {
17779 : 0 : if ((_q71 == _q40 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q40, 0) && types_match (_q71, _q40)))
17780 : : {
17781 : 0 : {
17782 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q70 };
17783 : 0 : const enum tree_code cmp = LE_EXPR;
17784 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
17785 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
17786 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
17787 : : )
17788 : : {
17789 : 0 : {
17790 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
17791 : 0 : offset_int rhs = off * 2;
17792 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
17793 : : )
17794 : : {
17795 : 0 : {
17796 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
17797 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
17798 : 0 : if (cmp == LT_EXPR
17799 : : )
17800 : : {
17801 : : gimple_seq *lseq = seq;
17802 : : if (lseq
17803 : : && (!single_use (captures[0])
17804 : : || !single_use (captures[5])))
17805 : : lseq = NULL;
17806 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2185;
17807 : : {
17808 : : res_op->set_op (GT_EXPR, type, 2);
17809 : : {
17810 : : tree _o1[1], _r1;
17811 : : {
17812 : : tree _o2[2], _r2;
17813 : : _o2[0] = swap_p ? captures[6] : captures[1];
17814 : : _o2[1] = swap_p ? captures[2] : captures[4];
17815 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17816 : : tem_op.resimplify (lseq, valueize);
17817 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17818 : : if (!_r2) goto next_after_fail2185;
17819 : : _o1[0] = _r2;
17820 : : }
17821 : : if (sizetype != TREE_TYPE (_o1[0])
17822 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17823 : : {
17824 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17825 : : tem_op.resimplify (lseq, valueize);
17826 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17827 : : if (!_r1) goto next_after_fail2185;
17828 : : }
17829 : : else
17830 : : _r1 = _o1[0];
17831 : : res_op->ops[0] = _r1;
17832 : : }
17833 : : res_op->ops[1] = rhs_tree;
17834 : : res_op->resimplify (lseq, valueize);
17835 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
17836 : 0 : return true;
17837 : : }
17838 : : next_after_fail2185:;
17839 : : }
17840 : : else
17841 : : {
17842 : 0 : gimple_seq *lseq = seq;
17843 : 0 : if (lseq
17844 : 0 : && (!single_use (captures[0])
17845 : 0 : || !single_use (captures[5])))
17846 : 0 : lseq = NULL;
17847 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2186;
17848 : 0 : {
17849 : 0 : res_op->set_op (GT_EXPR, type, 2);
17850 : 0 : {
17851 : 0 : tree _o1[1], _r1;
17852 : 0 : {
17853 : 0 : tree _o2[2], _r2;
17854 : 0 : {
17855 : 0 : tree _o3[2], _r3;
17856 : 0 : _o3[0] = swap_p ? captures[4] : captures[2];
17857 : 0 : _o3[1] = wide_int_to_tree (sizetype, off);
17858 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
17859 : 0 : tem_op.resimplify (lseq, valueize);
17860 : 0 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
17861 : 0 : if (!_r3) goto next_after_fail2186;
17862 : 0 : _o2[0] = _r3;
17863 : : }
17864 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
17865 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17866 : 0 : tem_op.resimplify (lseq, valueize);
17867 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17868 : 0 : if (!_r2) goto next_after_fail2186;
17869 : 0 : _o1[0] = _r2;
17870 : : }
17871 : 0 : if (sizetype != TREE_TYPE (_o1[0])
17872 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17873 : : {
17874 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17875 : 0 : tem_op.resimplify (lseq, valueize);
17876 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17877 : 0 : if (!_r1) goto next_after_fail2186;
17878 : : }
17879 : : else
17880 : : _r1 = _o1[0];
17881 : 0 : res_op->ops[0] = _r1;
17882 : : }
17883 : 0 : res_op->ops[1] = rhs_tree;
17884 : 0 : res_op->resimplify (lseq, valueize);
17885 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
17886 : 0 : return true;
17887 : : }
17888 : 0 : next_after_fail2186:;
17889 : : }
17890 : : }
17891 : : }
17892 : : }
17893 : : }
17894 : : }
17895 : : }
17896 : : }
17897 : : }
17898 : : break;
17899 : : }
17900 : : default:;
17901 : : }
17902 : : }
17903 : : break;
17904 : : default:;
17905 : : }
17906 : : break;
17907 : : }
17908 : 0 : case GE_EXPR:
17909 : 0 : {
17910 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
17911 : 0 : _q70 = do_valueize (valueize, _q70);
17912 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
17913 : 0 : _q71 = do_valueize (valueize, _q71);
17914 : 0 : if ((_q70 == _q40 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q40, 0) && types_match (_q70, _q40)))
17915 : : {
17916 : 0 : switch (TREE_CODE (_q71))
17917 : : {
17918 : 0 : case SSA_NAME:
17919 : 0 : if (gimple *_d4 = get_def (valueize, _q71))
17920 : : {
17921 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
17922 : 0 : switch (gimple_assign_rhs_code (_a4))
17923 : : {
17924 : 0 : case POINTER_PLUS_EXPR:
17925 : 0 : {
17926 : 0 : tree _q90 = gimple_assign_rhs1 (_a4);
17927 : 0 : _q90 = do_valueize (valueize, _q90);
17928 : 0 : tree _q91 = gimple_assign_rhs2 (_a4);
17929 : 0 : _q91 = do_valueize (valueize, _q91);
17930 : 0 : if ((_q90 == _q20 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q20, 0) && types_match (_q90, _q20)))
17931 : : {
17932 : 0 : if ((_q91 == _q41 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q41, 0) && types_match (_q91, _q41)))
17933 : : {
17934 : 0 : {
17935 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q71 };
17936 : 0 : const enum tree_code cmp = LE_EXPR;
17937 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
17938 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
17939 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
17940 : : )
17941 : : {
17942 : 0 : {
17943 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
17944 : 0 : offset_int rhs = off * 2;
17945 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
17946 : : )
17947 : : {
17948 : 0 : {
17949 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
17950 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
17951 : 0 : if (cmp == LT_EXPR
17952 : : )
17953 : : {
17954 : : gimple_seq *lseq = seq;
17955 : : if (lseq
17956 : : && (!single_use (captures[0])
17957 : : || !single_use (captures[5])))
17958 : : lseq = NULL;
17959 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2187;
17960 : : {
17961 : : res_op->set_op (GT_EXPR, type, 2);
17962 : : {
17963 : : tree _o1[1], _r1;
17964 : : {
17965 : : tree _o2[2], _r2;
17966 : : _o2[0] = swap_p ? captures[6] : captures[1];
17967 : : _o2[1] = swap_p ? captures[2] : captures[4];
17968 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
17969 : : tem_op.resimplify (lseq, valueize);
17970 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
17971 : : if (!_r2) goto next_after_fail2187;
17972 : : _o1[0] = _r2;
17973 : : }
17974 : : if (sizetype != TREE_TYPE (_o1[0])
17975 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
17976 : : {
17977 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
17978 : : tem_op.resimplify (lseq, valueize);
17979 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
17980 : : if (!_r1) goto next_after_fail2187;
17981 : : }
17982 : : else
17983 : : _r1 = _o1[0];
17984 : : res_op->ops[0] = _r1;
17985 : : }
17986 : : res_op->ops[1] = rhs_tree;
17987 : : res_op->resimplify (lseq, valueize);
17988 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
17989 : 0 : return true;
17990 : : }
17991 : : next_after_fail2187:;
17992 : : }
17993 : : else
17994 : : {
17995 : 0 : gimple_seq *lseq = seq;
17996 : 0 : if (lseq
17997 : 0 : && (!single_use (captures[0])
17998 : 0 : || !single_use (captures[5])))
17999 : 0 : lseq = NULL;
18000 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2188;
18001 : 0 : {
18002 : 0 : res_op->set_op (GT_EXPR, type, 2);
18003 : 0 : {
18004 : 0 : tree _o1[1], _r1;
18005 : 0 : {
18006 : 0 : tree _o2[2], _r2;
18007 : 0 : {
18008 : 0 : tree _o3[2], _r3;
18009 : 0 : _o3[0] = swap_p ? captures[4] : captures[2];
18010 : 0 : _o3[1] = wide_int_to_tree (sizetype, off);
18011 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
18012 : 0 : tem_op.resimplify (lseq, valueize);
18013 : 0 : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
18014 : 0 : if (!_r3) goto next_after_fail2188;
18015 : 0 : _o2[0] = _r3;
18016 : : }
18017 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
18018 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
18019 : 0 : tem_op.resimplify (lseq, valueize);
18020 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
18021 : 0 : if (!_r2) goto next_after_fail2188;
18022 : 0 : _o1[0] = _r2;
18023 : : }
18024 : 0 : if (sizetype != TREE_TYPE (_o1[0])
18025 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
18026 : : {
18027 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
18028 : 0 : tem_op.resimplify (lseq, valueize);
18029 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
18030 : 0 : if (!_r1) goto next_after_fail2188;
18031 : : }
18032 : : else
18033 : : _r1 = _o1[0];
18034 : 0 : res_op->ops[0] = _r1;
18035 : : }
18036 : 0 : res_op->ops[1] = rhs_tree;
18037 : 0 : res_op->resimplify (lseq, valueize);
18038 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
18039 : 0 : return true;
18040 : : }
18041 : 0 : next_after_fail2188:;
18042 : : }
18043 : : }
18044 : : }
18045 : : }
18046 : : }
18047 : : }
18048 : : }
18049 : : }
18050 : : break;
18051 : : }
18052 : : default:;
18053 : : }
18054 : : }
18055 : : break;
18056 : : default:;
18057 : : }
18058 : : }
18059 : : break;
18060 : : }
18061 : : default:;
18062 : : }
18063 : : }
18064 : : break;
18065 : : default:;
18066 : : }
18067 : : break;
18068 : : }
18069 : : default:;
18070 : : }
18071 : : break;
18072 : : }
18073 : : default:;
18074 : : }
18075 : : }
18076 : : break;
18077 : : default:;
18078 : : }
18079 : : break;
18080 : : }
18081 : 0 : case GT_EXPR:
18082 : 0 : {
18083 : 0 : tree _q20 = gimple_assign_rhs1 (_a1);
18084 : 0 : _q20 = do_valueize (valueize, _q20);
18085 : 0 : tree _q21 = gimple_assign_rhs2 (_a1);
18086 : 0 : _q21 = do_valueize (valueize, _q21);
18087 : 0 : switch (TREE_CODE (_q21))
18088 : : {
18089 : 0 : case SSA_NAME:
18090 : 0 : if (gimple *_d2 = get_def (valueize, _q21))
18091 : : {
18092 : 0 : if (gassign *_a2 = dyn_cast <gassign *> (_d2))
18093 : 0 : switch (gimple_assign_rhs_code (_a2))
18094 : : {
18095 : 0 : case POINTER_PLUS_EXPR:
18096 : 0 : {
18097 : 0 : tree _q40 = gimple_assign_rhs1 (_a2);
18098 : 0 : _q40 = do_valueize (valueize, _q40);
18099 : 0 : tree _q41 = gimple_assign_rhs2 (_a2);
18100 : 0 : _q41 = do_valueize (valueize, _q41);
18101 : 0 : switch (TREE_CODE (_q41))
18102 : : {
18103 : 0 : case INTEGER_CST:
18104 : 0 : {
18105 : 0 : switch (TREE_CODE (_p1))
18106 : : {
18107 : 0 : case SSA_NAME:
18108 : 0 : if (gimple *_d3 = get_def (valueize, _p1))
18109 : : {
18110 : 0 : if (gassign *_a3 = dyn_cast <gassign *> (_d3))
18111 : 0 : switch (gimple_assign_rhs_code (_a3))
18112 : : {
18113 : 0 : case LT_EXPR:
18114 : 0 : {
18115 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
18116 : 0 : _q70 = do_valueize (valueize, _q70);
18117 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
18118 : 0 : _q71 = do_valueize (valueize, _q71);
18119 : 0 : switch (TREE_CODE (_q70))
18120 : : {
18121 : 0 : case SSA_NAME:
18122 : 0 : if (gimple *_d4 = get_def (valueize, _q70))
18123 : : {
18124 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
18125 : 0 : switch (gimple_assign_rhs_code (_a4))
18126 : : {
18127 : 0 : case POINTER_PLUS_EXPR:
18128 : 0 : {
18129 : 0 : tree _q80 = gimple_assign_rhs1 (_a4);
18130 : 0 : _q80 = do_valueize (valueize, _q80);
18131 : 0 : tree _q81 = gimple_assign_rhs2 (_a4);
18132 : 0 : _q81 = do_valueize (valueize, _q81);
18133 : 0 : if ((_q80 == _q20 && ! TREE_SIDE_EFFECTS (_q80)) || (operand_equal_p (_q80, _q20, 0) && types_match (_q80, _q20)))
18134 : : {
18135 : 0 : if ((_q81 == _q41 && ! TREE_SIDE_EFFECTS (_q81)) || (operand_equal_p (_q81, _q41, 0) && types_match (_q81, _q41)))
18136 : : {
18137 : 0 : if ((_q71 == _q40 && ! TREE_SIDE_EFFECTS (_q71)) || (operand_equal_p (_q71, _q40, 0) && types_match (_q71, _q40)))
18138 : : {
18139 : 0 : {
18140 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q70 };
18141 : 0 : const enum tree_code cmp = LT_EXPR;
18142 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
18143 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
18144 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
18145 : : )
18146 : : {
18147 : 0 : {
18148 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
18149 : 0 : offset_int rhs = off * 2;
18150 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
18151 : : )
18152 : : {
18153 : 0 : {
18154 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
18155 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
18156 : 0 : if (cmp == LT_EXPR
18157 : : )
18158 : : {
18159 : 0 : gimple_seq *lseq = seq;
18160 : 0 : if (lseq
18161 : 0 : && (!single_use (captures[0])
18162 : 0 : || !single_use (captures[5])))
18163 : 0 : lseq = NULL;
18164 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2189;
18165 : 0 : {
18166 : 0 : res_op->set_op (GT_EXPR, type, 2);
18167 : 0 : {
18168 : 0 : tree _o1[1], _r1;
18169 : 0 : {
18170 : 0 : tree _o2[2], _r2;
18171 : 0 : _o2[0] = swap_p ? captures[6] : captures[1];
18172 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
18173 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
18174 : 0 : tem_op.resimplify (lseq, valueize);
18175 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
18176 : 0 : if (!_r2) goto next_after_fail2189;
18177 : 0 : _o1[0] = _r2;
18178 : : }
18179 : 0 : if (sizetype != TREE_TYPE (_o1[0])
18180 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
18181 : : {
18182 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
18183 : 0 : tem_op.resimplify (lseq, valueize);
18184 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
18185 : 0 : if (!_r1) goto next_after_fail2189;
18186 : : }
18187 : : else
18188 : : _r1 = _o1[0];
18189 : 0 : res_op->ops[0] = _r1;
18190 : : }
18191 : 0 : res_op->ops[1] = rhs_tree;
18192 : 0 : res_op->resimplify (lseq, valueize);
18193 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
18194 : 0 : return true;
18195 : : }
18196 : 0 : next_after_fail2189:;
18197 : : }
18198 : : else
18199 : : {
18200 : : gimple_seq *lseq = seq;
18201 : : if (lseq
18202 : : && (!single_use (captures[0])
18203 : : || !single_use (captures[5])))
18204 : : lseq = NULL;
18205 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2190;
18206 : : {
18207 : : res_op->set_op (GT_EXPR, type, 2);
18208 : : {
18209 : : tree _o1[1], _r1;
18210 : : {
18211 : : tree _o2[2], _r2;
18212 : : {
18213 : : tree _o3[2], _r3;
18214 : : _o3[0] = swap_p ? captures[4] : captures[2];
18215 : : _o3[1] = wide_int_to_tree (sizetype, off);
18216 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
18217 : : tem_op.resimplify (lseq, valueize);
18218 : : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
18219 : : if (!_r3) goto next_after_fail2190;
18220 : : _o2[0] = _r3;
18221 : : }
18222 : : _o2[1] = swap_p ? captures[2] : captures[4];
18223 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
18224 : : tem_op.resimplify (lseq, valueize);
18225 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
18226 : : if (!_r2) goto next_after_fail2190;
18227 : : _o1[0] = _r2;
18228 : : }
18229 : : if (sizetype != TREE_TYPE (_o1[0])
18230 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
18231 : : {
18232 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
18233 : : tem_op.resimplify (lseq, valueize);
18234 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
18235 : : if (!_r1) goto next_after_fail2190;
18236 : : }
18237 : : else
18238 : : _r1 = _o1[0];
18239 : : res_op->ops[0] = _r1;
18240 : : }
18241 : : res_op->ops[1] = rhs_tree;
18242 : : res_op->resimplify (lseq, valueize);
18243 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
18244 : : return true;
18245 : : }
18246 : : next_after_fail2190:;
18247 : : }
18248 : : }
18249 : : }
18250 : : }
18251 : : }
18252 : : }
18253 : : }
18254 : : }
18255 : : }
18256 : : break;
18257 : : }
18258 : : default:;
18259 : : }
18260 : : }
18261 : : break;
18262 : : default:;
18263 : : }
18264 : : break;
18265 : : }
18266 : 0 : case GT_EXPR:
18267 : 0 : {
18268 : 0 : tree _q70 = gimple_assign_rhs1 (_a3);
18269 : 0 : _q70 = do_valueize (valueize, _q70);
18270 : 0 : tree _q71 = gimple_assign_rhs2 (_a3);
18271 : 0 : _q71 = do_valueize (valueize, _q71);
18272 : 0 : if ((_q70 == _q40 && ! TREE_SIDE_EFFECTS (_q70)) || (operand_equal_p (_q70, _q40, 0) && types_match (_q70, _q40)))
18273 : : {
18274 : 0 : switch (TREE_CODE (_q71))
18275 : : {
18276 : 0 : case SSA_NAME:
18277 : 0 : if (gimple *_d4 = get_def (valueize, _q71))
18278 : : {
18279 : 0 : if (gassign *_a4 = dyn_cast <gassign *> (_d4))
18280 : 0 : switch (gimple_assign_rhs_code (_a4))
18281 : : {
18282 : 0 : case POINTER_PLUS_EXPR:
18283 : 0 : {
18284 : 0 : tree _q90 = gimple_assign_rhs1 (_a4);
18285 : 0 : _q90 = do_valueize (valueize, _q90);
18286 : 0 : tree _q91 = gimple_assign_rhs2 (_a4);
18287 : 0 : _q91 = do_valueize (valueize, _q91);
18288 : 0 : if ((_q90 == _q20 && ! TREE_SIDE_EFFECTS (_q90)) || (operand_equal_p (_q90, _q20, 0) && types_match (_q90, _q20)))
18289 : : {
18290 : 0 : if ((_q91 == _q41 && ! TREE_SIDE_EFFECTS (_q91)) || (operand_equal_p (_q91, _q41, 0) && types_match (_q91, _q41)))
18291 : : {
18292 : 0 : {
18293 : 0 : tree captures[7] ATTRIBUTE_UNUSED = { _p0, _q21, _q40, _q41, _q20, _p1, _q71 };
18294 : 0 : const enum tree_code cmp = LT_EXPR;
18295 : 0 : if (TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (captures[2]))
18296 : 0 : && TYPE_OVERFLOW_WRAPS (sizetype)
18297 : 0 : && TYPE_PRECISION (TREE_TYPE (captures[2])) == TYPE_PRECISION (sizetype)
18298 : : )
18299 : : {
18300 : 0 : {
18301 : 0 : offset_int off = wi::to_offset (captures[3]) - (cmp == LE_EXPR ? 1 : 0);
18302 : 0 : offset_int rhs = off * 2;
18303 : 0 : if (wi::min_precision (rhs, UNSIGNED) <= TYPE_PRECISION (sizetype)
18304 : : )
18305 : : {
18306 : 0 : {
18307 : 0 : bool swap_p = tree_swap_operands_p (captures[2], captures[4]);
18308 : 0 : tree rhs_tree = wide_int_to_tree (sizetype, rhs);
18309 : 0 : if (cmp == LT_EXPR
18310 : : )
18311 : : {
18312 : 0 : gimple_seq *lseq = seq;
18313 : 0 : if (lseq
18314 : 0 : && (!single_use (captures[0])
18315 : 0 : || !single_use (captures[5])))
18316 : 0 : lseq = NULL;
18317 : 0 : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2191;
18318 : 0 : {
18319 : 0 : res_op->set_op (GT_EXPR, type, 2);
18320 : 0 : {
18321 : 0 : tree _o1[1], _r1;
18322 : 0 : {
18323 : 0 : tree _o2[2], _r2;
18324 : 0 : _o2[0] = swap_p ? captures[6] : captures[1];
18325 : 0 : _o2[1] = swap_p ? captures[2] : captures[4];
18326 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
18327 : 0 : tem_op.resimplify (lseq, valueize);
18328 : 0 : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
18329 : 0 : if (!_r2) goto next_after_fail2191;
18330 : 0 : _o1[0] = _r2;
18331 : : }
18332 : 0 : if (sizetype != TREE_TYPE (_o1[0])
18333 : 0 : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
18334 : : {
18335 : 0 : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
18336 : 0 : tem_op.resimplify (lseq, valueize);
18337 : 0 : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
18338 : 0 : if (!_r1) goto next_after_fail2191;
18339 : : }
18340 : : else
18341 : : _r1 = _o1[0];
18342 : 0 : res_op->ops[0] = _r1;
18343 : : }
18344 : 0 : res_op->ops[1] = rhs_tree;
18345 : 0 : res_op->resimplify (lseq, valueize);
18346 : 0 : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 973, __FILE__, __LINE__, true);
18347 : 0 : return true;
18348 : : }
18349 : 0 : next_after_fail2191:;
18350 : : }
18351 : : else
18352 : : {
18353 : : gimple_seq *lseq = seq;
18354 : : if (lseq
18355 : : && (!single_use (captures[0])
18356 : : || !single_use (captures[5])))
18357 : : lseq = NULL;
18358 : : if (UNLIKELY (!dbg_cnt (match))) goto next_after_fail2192;
18359 : : {
18360 : : res_op->set_op (GT_EXPR, type, 2);
18361 : : {
18362 : : tree _o1[1], _r1;
18363 : : {
18364 : : tree _o2[2], _r2;
18365 : : {
18366 : : tree _o3[2], _r3;
18367 : : _o3[0] = swap_p ? captures[4] : captures[2];
18368 : : _o3[1] = wide_int_to_tree (sizetype, off);
18369 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_PLUS_EXPR, TREE_TYPE (_o3[0]), _o3[0], _o3[1]);
18370 : : tem_op.resimplify (lseq, valueize);
18371 : : _r3 = maybe_push_res_to_seq (&tem_op, lseq);
18372 : : if (!_r3) goto next_after_fail2192;
18373 : : _o2[0] = _r3;
18374 : : }
18375 : : _o2[1] = swap_p ? captures[2] : captures[4];
18376 : : gimple_match_op tem_op (res_op->cond.any_else (), POINTER_DIFF_EXPR, ssizetype, _o2[0], _o2[1]);
18377 : : tem_op.resimplify (lseq, valueize);
18378 : : _r2 = maybe_push_res_to_seq (&tem_op, lseq);
18379 : : if (!_r2) goto next_after_fail2192;
18380 : : _o1[0] = _r2;
18381 : : }
18382 : : if (sizetype != TREE_TYPE (_o1[0])
18383 : : && !useless_type_conversion_p (sizetype, TREE_TYPE (_o1[0])))
18384 : : {
18385 : : gimple_match_op tem_op (res_op->cond.any_else (), NOP_EXPR, sizetype, _o1[0]);
18386 : : tem_op.resimplify (lseq, valueize);
18387 : : _r1 = maybe_push_res_to_seq (&tem_op, lseq);
18388 : : if (!_r1) goto next_after_fail2192;
18389 : : }
18390 : : else
18391 : : _r1 = _o1[0];
18392 : : res_op->ops[0] = _r1;
18393 : : }
18394 : : res_op->ops[1] = rhs_tree;
18395 : : res_op->resimplify (lseq, valueize);
18396 : : if (UNLIKELY (debug_dump)) gimple_dump_logs ("match.pd", 974, __FILE__, __LINE__, true);
18397 : : return true;
18398 : : }
18399 : : next_after_fail2192:;
18400 : : }
18401 : : }
18402 : : }
18403 : : }
18404 : : }
18405 : : }
18406 : : }
18407 : : }
18408 : : break;
18409 : : }
18410 : : default:;
18411 : : }
18412 : : }
18413 : : break;
18414 : : default:;
18415 : : }
18416 : : }
18417 : : break;
18418 : : }
18419 : : default:;
18420 : : }
18421 : : }
18422 : : break;
18423 : : default:;
18424 : : }
18425 : : break;
18426 : : }
18427 : : default:;
18428 : : }
18429 : : break;
18430 : : }
18431 : : default:;
18432 : : }
18433 : : }
18434 : : break;
18435 : : default:;
18436 : : }
18437 : : break;
18438 : : }
18439 : : default:;
18440 : : }
18441 : : }
18442 : : break;
18443 : : default:;
18444 : : }
18445 : : return false;
18446 : : }
18447 : : #pragma GCC diagnostic pop
|