]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/99728 - improve LIM for loops with aggregate copies
authorRichard Biener <rguenther@suse.de>
Wed, 7 Jul 2021 09:41:03 +0000 (11:41 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 7 Jul 2021 11:48:26 +0000 (13:48 +0200)
commit9f34b780b0461ec7b2b2defe96e44ab616ea2aa3
tree2d8d45ef233f09fc56f46fb6926198c55d5727db
parent98bfd845e93937d92ca844d7fa7e853ad51c6193
tree-optimization/99728 - improve LIM for loops with aggregate copies

This improves LIM by recording aggregate copies for disambiguation
purposes instead of as UNANALYZABLE_MEM which will prevent any
invariant or store motion across it.  This allows four of the six
references in the loop of the testcase to be promoted.

2021-07-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99728
* tree-ssa-loop-im.c (gather_mem_refs_stmt): Record
aggregate copies.
(mem_refs_may_alias_p): Add assert we handled aggregate
copies elsewhere.
(sm_seq_valid_bb): Give up when running into aggregate copies.
(ref_indep_loop_p): Handle aggregate copies as never
being invariant themselves but allow other refs to be
disambiguated against them.
(can_sm_ref_p): Do not try to apply store-motion to aggregate
copies.

* g++.dg/opt/pr99728.C: New testcase.
gcc/testsuite/g++.dg/opt/pr99728.C [new file with mode: 0644]
gcc/tree-ssa-loop-im.c
This page took 0.055381 seconds and 5 git commands to generate.