]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/106922 - PRE and virtual operand translation
authorRichard Biener <rguenther@suse.de>
Thu, 15 Sep 2022 11:33:23 +0000 (13:33 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 15 Sep 2022 12:21:20 +0000 (14:21 +0200)
commit5edf02ed2b6de024f83a023d046a6a18f645bc83
tree3cab78ed4aef66f6e7b74cadba4af047df5ddf51
parent8ff2a92a0450243e52d3299a13b30f208bafa7e0
tree-optimization/106922 - PRE and virtual operand translation

PRE implicitely keeps virtual operands at the blocks incoming version
but the explicit updating point during PHI translation fails to trigger
when there are no PHIs at all in a block.  Later lazy updating then
fails because of a too lose block check.  A similar issues plagues
reference invalidation when checking the ANTIC_OUT to ANTIC_IN
translation.  The following fixes both and makes the lazy updating
work.

The diagnostic testcase unfortunately requires boost so the
testcase is the one I reduced for a missed optimization in PRE.
The testcase fails with -m32 on x86_64 because we optimize too
much before PRE which causes PRE to not trigger so we fail to
eliminate a full redundancy.  I'm going to open a separate bug
for this.  Hopefully the !lp64 selector is good enough.

PR tree-optimization/106922
* tree-ssa-pre.cc (translate_vuse_through_block): Only
keep the VUSE if its def dominates PHIBLOCK.
(prune_clobbered_mems): Rewrite logic so we check whether
a value dies in a block when the VUSE def doesn't dominate it.

* g++.dg/tree-ssa/pr106922.C: New testcase.
gcc/testsuite/g++.dg/tree-ssa/pr106922.C [new file with mode: 0644]
gcc/tree-ssa-pre.cc