Commit ee2f19b
committed
Fix inaccuracy in cunroll/cunrolli when considering what's innermost loop.
r15-919-gef27b91b62c3aa removed 1 / 3 size reduction for innermost
loop, but it doesn't accurately remember what's "innermost" for 2
testcases in PR117888.
1) For pass_cunroll, the "innermost" loop could be an originally outer
loop with inner loop completely unrolled by cunrolli. The patch moves
local variable cunrolli to parameter of tree_unroll_loops_completely
and passes it directly from execute of the pass.
2) For pass_cunrolli, cunrolli is set to false when the sibling loop
of a innermost loop is completely unrolled, and it inaccurately
takes the innermost loop as an "outer" loop. The patch add another
paramter innermost to helps recognizing the "original" innermost loop.
gcc/ChangeLog:
PR tree-optimization/117888
* tree-ssa-loop-ivcanon.cc (try_unroll_loop_completely): Use
cunrolli instead of cunrolli && !loop->inner to check if it's
innermost loop.
(canonicalize_loop_induction_variables): Add new parameter
const_sbitmap innermost, and pass
cunrolli
&& (unsigned) loop->num < SBITMAP_SIZE (innermost)
&& bitmap_bit_p (innermost, loop->num) as "cunrolli" to
try_unroll_loop_completely
(canonicalize_induction_variables): Pass innermost to
canonicalize_loop_induction_variables.
(tree_unroll_loops_completely_1): Add new parameter
const_sbitmap innermost.
(tree_unroll_loops_completely): Move local variable cunrolli
to parameter to indicate it's from pass cunrolli, also track
all "original" innermost loop at the beginning.
gcc/testsuite/ChangeLog:
* gcc.dg/pr117888-2.c: New test.
* gcc.dg/vect/pr117888-1.c: Ditto.
* gcc.dg/tree-ssa/pr83403-1.c: Add
--param max-completely-peeled-insns=300 for arm*-*-*.
* gcc.dg/tree-ssa/pr83403-2.c: Ditto.1 parent d5b3d9e commit ee2f19b
File tree
5 files changed
+151
-19
lines changed- gcc
- testsuite/gcc.dg
- tree-ssa
- vect
5 files changed
+151
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
942 | | - | |
943 | | - | |
| 942 | + | |
944 | 943 | | |
945 | 944 | | |
946 | 945 | | |
| |||
1248 | 1247 | | |
1249 | 1248 | | |
1250 | 1249 | | |
1251 | | - | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
1252 | 1253 | | |
1253 | 1254 | | |
1254 | 1255 | | |
| |||
1334 | 1335 | | |
1335 | 1336 | | |
1336 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
1337 | 1344 | | |
1338 | | - | |
| 1345 | + | |
| 1346 | + | |
1339 | 1347 | | |
1340 | 1348 | | |
1341 | 1349 | | |
| |||
1372 | 1380 | | |
1373 | 1381 | | |
1374 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
1375 | 1385 | | |
1376 | 1386 | | |
1377 | 1387 | | |
1378 | 1388 | | |
1379 | 1389 | | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
1383 | 1396 | | |
1384 | 1397 | | |
1385 | 1398 | | |
| |||
1413 | 1426 | | |
1414 | 1427 | | |
1415 | 1428 | | |
1416 | | - | |
| 1429 | + | |
| 1430 | + | |
1417 | 1431 | | |
1418 | 1432 | | |
1419 | 1433 | | |
| |||
1431 | 1445 | | |
1432 | 1446 | | |
1433 | 1447 | | |
1434 | | - | |
| 1448 | + | |
| 1449 | + | |
1435 | 1450 | | |
1436 | 1451 | | |
1437 | 1452 | | |
| |||
1477 | 1492 | | |
1478 | 1493 | | |
1479 | 1494 | | |
1480 | | - | |
| 1495 | + | |
| 1496 | + | |
1481 | 1497 | | |
1482 | 1498 | | |
1483 | 1499 | | |
| |||
1503 | 1519 | | |
1504 | 1520 | | |
1505 | 1521 | | |
1506 | | - | |
| 1522 | + | |
| 1523 | + | |
1507 | 1524 | | |
1508 | 1525 | | |
1509 | | - | |
| 1526 | + | |
1510 | 1527 | | |
1511 | 1528 | | |
1512 | 1529 | | |
1513 | 1530 | | |
1514 | 1531 | | |
1515 | | - | |
| 1532 | + | |
| 1533 | + | |
1516 | 1534 | | |
1517 | 1535 | | |
1518 | 1536 | | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
1519 | 1544 | | |
1520 | 1545 | | |
1521 | 1546 | | |
| |||
1530 | 1555 | | |
1531 | 1556 | | |
1532 | 1557 | | |
| 1558 | + | |
1533 | 1559 | | |
1534 | 1560 | | |
1535 | 1561 | | |
1536 | 1562 | | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
1541 | 1563 | | |
1542 | 1564 | | |
1543 | 1565 | | |
| |||
1697 | 1719 | | |
1698 | 1720 | | |
1699 | 1721 | | |
1700 | | - | |
| 1722 | + | |
1701 | 1723 | | |
1702 | 1724 | | |
1703 | 1725 | | |
| |||
1753 | 1775 | | |
1754 | 1776 | | |
1755 | 1777 | | |
1756 | | - | |
| 1778 | + | |
1757 | 1779 | | |
1758 | 1780 | | |
1759 | 1781 | | |
| |||
0 commit comments