summaryrefslogtreecommitdiff
path: root/gcc/passes.def
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2019-10-28 10:04:31 +0000
committerIlya Leoshkevich <iii@gcc.gnu.org>2019-10-28 10:04:31 +0000
commit216779db90e32a7a7f8be2b322208c80666f1e52 (patch)
treed74628b35ba0dcb86e89d6029f2d3c4c549e4bb8 /gcc/passes.def
parent5a0236f8ca9d239bb62ef54c9273e6ca3f068f87 (diff)
Move jump threading before reload
r266734 has introduced a new instance of jump threading pass in order to take advantage of opportunities that combine opens up. It was perceived back then that it was beneficial to delay it after reload, since that might produce even more such opportunities. Unfortunately jump threading interferes with hot/cold partitioning. In the code from PR92007, it converts the following +-------------------------- 2/HOT ------------------------+ | | v v 3/HOT --> 5/HOT --> 8/HOT --> 11/COLD --> 6/HOT --EH--> 16/HOT | ^ | | +-------------------------------+ into the following: +---------------------- 2/HOT ------------------+ | | v v 3/HOT --> 8/HOT --> 11/COLD --> 6/COLD --EH--> 16/HOT This makes hot bb 6 dominated by cold bb 11, and because of this fixup_partitions makes bb 6 cold as well, which in turn makes EH edge 6->16 a crossing one. Not only can't we have crossing EH edges, we are also not allowed to introduce new crossing edges after reload in general, since it might require extra registers on some targets. Therefore, move the jump threading pass between combine and hot/cold partitioning. Building SPEC 2006 and SPEC 2017 with the old and the new code indicates that: * When doing jump threading right after reload, 3889 edges are threaded. * When doing jump threading right after combine, 3918 edges are threaded. This means this change will not introduce performance regressions. gcc/ChangeLog: 2019-10-28 Ilya Leoshkevich <iii@linux.ibm.com> PR rtl-optimization/92007 * cfgcleanup.c (thread_jump): Add an assertion that we don't call it after reload if hot/cold partitioning has been done. (class pass_postreload_jump): Rename to pass_jump_after_combine. (make_pass_postreload_jump): Rename to make_pass_jump_after_combine. * passes.def(pass_postreload_jump): Move before reload, rename to pass_jump_after_combine. * tree-pass.h (make_pass_postreload_jump): Rename to make_pass_jump_after_combine. gcc/testsuite/ChangeLog: 2019-10-28 Ilya Leoshkevich <iii@linux.ibm.com> PR rtl-optimization/92007 * g++.dg/opt/pr92007.C: New test (from Arseny Solokha). From-SVN: r277507
Diffstat (limited to 'gcc/passes.def')
-rw-r--r--gcc/passes.def2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/passes.def b/gcc/passes.def
index 8999ceec636..798a391bd35 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -439,6 +439,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ud_rtl_dce);
NEXT_PASS (pass_combine);
NEXT_PASS (pass_if_after_combine);
+ NEXT_PASS (pass_jump_after_combine);
NEXT_PASS (pass_partition_blocks);
NEXT_PASS (pass_outof_cfg_layout_mode);
NEXT_PASS (pass_split_all_insns);
@@ -455,7 +456,6 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_reload);
NEXT_PASS (pass_postreload);
PUSH_INSERT_PASSES_WITHIN (pass_postreload)
- NEXT_PASS (pass_postreload_jump);
NEXT_PASS (pass_postreload_cse);
NEXT_PASS (pass_gcse2);
NEXT_PASS (pass_split_after_reload);