diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-08-06 15:47:25 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-08-06 15:47:25 +0200 |
commit | b3aa137212b1af0c824a9890eba2ca27a7271d56 (patch) | |
tree | 882174cfdd4295b46dfe6127e4f57126122a806a /libstdc++-v3/include/std | |
parent | af30b83b50953fbbe671d93d44ea6ac2f7a50ce9 (diff) | |
download | gcc-b3aa137212b1af0c824a9890eba2ca27a7271d56.zip gcc-b3aa137212b1af0c824a9890eba2ca27a7271d56.tar.gz gcc-b3aa137212b1af0c824a9890eba2ca27a7271d56.tar.bz2 |
reassoc: Improve maybe_optimize_range_tests [PR96480]
On the following testcase, if the IL before reassoc would be:
...
<bb 4> [local count: 354334800]:
if (x_3(D) == 2)
goto <bb 7>; [34.00%]
else
goto <bb 5>; [66.00%]
<bb 5> [local count: 233860967]:
if (x_3(D) == 3)
goto <bb 7>; [34.00%]
else
goto <bb 6>; [66.00%]
<bb 6> [local count: 79512730]:
<bb 7> [local count: 1073741824]:
# prephitmp_7 = PHI <1(3), 1(4), 1(5), 1(2), 0(6)>
then we'd optimize it properly, but as bb 5-7 is instead:
<bb 5> [local count: 233860967]:
if (x_3(D) == 3)
goto <bb 6>; [34.00%]
else
goto <bb 7>; [66.00%]
<bb 6> [local count: 79512730]:
<bb 7> [local count: 1073741824]:
# prephitmp_7 = PHI <1(3), 1(4), 0(5), 1(2), 1(6)>
(i.e. the true/false edges on the last bb with condition swapped
and ditto for the phi args), we don't recognize it. If bb 6
is empty, there should be no functional difference between the two IL
representations.
This patch handles those special cases.
2020-08-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/96480
* tree-ssa-reassoc.c (suitable_cond_bb): Add TEST_SWAPPED_P argument.
If TEST_BB ends in cond and has one edge to *OTHER_BB and another
through an empty bb to that block too, if PHI args don't match, retry
them through the other path from TEST_BB.
(maybe_optimize_range_tests): Adjust callers. Handle such LAST_BB
through inversion of the condition.
* gcc.dg/tree-ssa/pr96480.c: New test.
Diffstat (limited to 'libstdc++-v3/include/std')
0 files changed, 0 insertions, 0 deletions