]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/108086 - avoid quadraticness in copy_edges_for_bb
authorRichard Biener <rguenther@suse.de>
Thu, 15 Dec 2022 12:42:16 +0000 (13:42 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 15 Dec 2022 17:42:52 +0000 (18:42 +0100)
commitd49b2a3a1dbbe3ac9ae134bc5742be7fdb417d32
tree82a998e3764579fc4352b58094d71049624dfbd5
parent3f101e32e2fb616633722fb552779f537e9a9891
middle-end/108086 - avoid quadraticness in copy_edges_for_bb

For the testcase in PR108086 it's visible that we split blocks
multiple times when inlining and that causes us to adjust the
block tail stmt BBs multiple times, once for each split.  The
fix is to walk backwards and split from the tail instead.

For a reduced testcase this improves compile-time at -O by 4%.

PR middle-end/108086
* tree-inline.cc (copy_edges_for_bb): Walk stmts backwards for
splitting the block to avoid quadratic behavior with setting
stmts BB on multliple splits.
gcc/tree-inline.cc