aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-loop-interchange.cc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2020-11-13 15:35:18 +0100
committerMartin Jambor <mjambor@suse.cz>2020-11-13 15:35:18 +0100
commitac91af71c93462cbc701bbd104fa21894bb15e86 (patch)
treef627c99eee6a069a28488e7f4e33e08fdf7fe14f /gcc/gimple-loop-interchange.cc
parent4d6b8d4213376e8a2405782c7e360b03d4a2b04a (diff)
downloadgcc-ac91af71c93462cbc701bbd104fa21894bb15e86.zip
gcc-ac91af71c93462cbc701bbd104fa21894bb15e86.tar.gz
gcc-ac91af71c93462cbc701bbd104fa21894bb15e86.tar.bz2
loops: Invoke lim after successful loop interchange
This patch makes the entry point to loop invariant motion public, so that it can be called after loop interchange when that pass has swapped loops. This avoids the non-LTO -Ofast run-time regressions of 410.bwaves and 503.bwaves_r (which are 19% and 15% faster than current master on an AMD zen2 machine) while not introducing a full LIM pass into the pass pipeline. The patch also adds a parameter which allows not to perform any store motion so that it is not done after an interchange. gcc/ChangeLog: 2020-11-12 Martin Jambor <mjambor@suse.cz> PR tree-optimization/94406 * tree-ssa-loop-im.c (tree_ssa_lim): Renamed to loop_invariant_motion_in_fun, added a parameter to control store motion. (pass_lim::execute): Adjust call to tree_ssa_lim, now loop_invariant_motion_in_fun. * tree-ssa-loop-manip.h (loop_invariant_motion_in_fun): Declare. * gimple-loop-interchange.cc (pass_linterchange::execute): Call loop_invariant_motion_in_fun if any interchange has been done.
Diffstat (limited to 'gcc/gimple-loop-interchange.cc')
-rw-r--r--gcc/gimple-loop-interchange.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc
index 1656004..a36dbb4 100644
--- a/gcc/gimple-loop-interchange.cc
+++ b/gcc/gimple-loop-interchange.cc
@@ -2085,8 +2085,13 @@ pass_linterchange::execute (function *fun)
}
if (changed_p)
- scev_reset ();
- return changed_p ? (TODO_update_ssa_only_virtuals) : 0;
+ {
+ unsigned todo = TODO_update_ssa_only_virtuals;
+ todo |= loop_invariant_motion_in_fun (cfun, false);
+ scev_reset ();
+ return todo;
+ }
+ return 0;
}
} // anon namespace