tree-optimization/97623 - avoid excessive insert iteration for hoisting
authorRichard Biener <rguenther@suse.de>
Fri, 30 Oct 2020 12:32:32 +0000 (13:32 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 30 Oct 2020 12:35:24 +0000 (13:35 +0100)
commit82ff7e3426ea926d090777173977f8bedd086816
tree35c9a956bdc58f6e0d758fd31f88133a78f41f16
parent33c0f246f799b7403171e97f31276a8feddd05c9
tree-optimization/97623 - avoid excessive insert iteration for hoisting

This avoids requiring insert iteration for back-to-back hoisting
opportunities as seen in the added testcase.  For the PR at hand
this halves the number of insert iterations retaining only
the hard to avoid PRE / hoist insert back-to-backs.

2020-10-30  Richard Biener  <rguenther@suse.de>

PR tree-optimization/97623
* tree-ssa-pre.c (insert): First do hoist insertion in
a backward walk.

* gcc.dg/tree-ssa/ssa-hoist-7.c: New testcase.
gcc/testsuite/gcc.dg/tree-ssa/ssa-hoist-7.c [new file with mode: 0644]
gcc/tree-ssa-pre.c