tree-optimization/95045 - fix SM with exit exiting multiple loops
authorRichard Biener <rguenther@suse.de>
Mon, 11 May 2020 13:26:09 +0000 (15:26 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 12 May 2020 06:22:19 +0000 (08:22 +0200)
commitbb63ca63e744c08bc5a9ffa53df62ea35f098b0b
tree569b640d80261e4a5f3ea0abe8d3b4b7d1a6d691
parent7a2e715c9af2611040319f7139aee21054bcb8b7
tree-optimization/95045 - fix SM with exit exiting multiple loops

Since we apply SM to an edge which exits multiple loops we have
to make sure to commit insertions on it immediately since otherwise
store order is not preserved.

2020-05-12  Richard Biener  <rguenther@suse.de>

PR tree-optimization/95045
* dbgcnt.def (lim): Add debug-counter.
* tree-ssa-loop-im.c: Include dbgcnt.h.
(find_refs_for_sm): Use lim debug counter for store motion
candidates.
(do_store_motion): Rename form store_motion.  Commit edge
insertions...
(store_motion_loop): ... here.
(tree_ssa_lim): Adjust.
gcc/ChangeLog
gcc/dbgcnt.def
gcc/tree-ssa-loop-im.c