diff options
author | Jan Hubicka <jh@suse.cz> | 2023-08-23 11:17:20 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2023-08-23 11:17:20 +0200 |
commit | 936a12331a2bd95e9003221e292719b7ffcf07d0 (patch) | |
tree | 361e3311595ebc3b99506a8af574dc8672357955 /gcc/gimple-range-fold.cc | |
parent | 7a2e232fa6e0ce2120dedcb340d683f6ac9b3f19 (diff) | |
download | gcc-936a12331a2bd95e9003221e292719b7ffcf07d0.zip gcc-936a12331a2bd95e9003221e292719b7ffcf07d0.tar.gz gcc-936a12331a2bd95e9003221e292719b7ffcf07d0.tar.bz2 |
Fix handling of static exists in loop_ch
This patch fixes wrong return value in should_duplicate_loop_header_p.
Doing so uncovered suboptimal decisions on some jump threading testcases
where we choose to stop duplicating just before basic block that has zero
cost and duplicating so would be always a win.
This is because the heuristics trying to choose right point to duplicate
all winning blocks and to get loop to be do_while did not account
zero_cost blocks in all cases. The patch simplifies the logic by
simply remembering zero cost blocks and handling them last after
the right stopping point is chosen.
gcc/ChangeLog:
* tree-ssa-loop-ch.cc (enum ch_decision): Fix comment.
(should_duplicate_loop_header_p): Fix return value for static exits.
(ch_base::copy_headers): Improve handling of ch_possible_zero_cost.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/copy-headers-9.c: Update template.
Diffstat (limited to 'gcc/gimple-range-fold.cc')
0 files changed, 0 insertions, 0 deletions