Commit 5f0653a8 by Richard Biener

tree-optimization/91123 - restore redundant store removal

Redundant store removal in FRE was restricted for correctness reasons.
The following extends correctness fixes required to memcpy/aggregate
copy translation.  The main change is that we no longer insert
references rewritten to cover such aggregate copies into the hashtable
but the original one.

2020-02-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/91123
	* tree-ssa-sccvn.c (vn_walk_cb_data::finish): New method.
	(vn_walk_cb_data::last_vuse): New member.
	(vn_walk_cb_data::saved_operands): Likewsie.
	(vn_walk_cb_data::~vn_walk_cb_data): Release saved_operands.
	(vn_walk_cb_data::push_partial_def): Use finish.
	(vn_reference_lookup_2): Update last_vuse and use finish if
	we've saved operands.
	(vn_reference_lookup_3): Use finish and update calls to
	push_partial_defs everywhere.  When translating through
	memcpy or aggregate copies save off operands and alias-set.
	(eliminate_dom_walker::eliminate_stmt): Restore VN_WALKREWRITE
	operation for redundant store removal.

	* gcc.dg/tree-ssa/ssa-fre-85.c: New testcase.
parent fc98d038
2020-02-04 Richard Biener <rguenther@suse.de> 2020-02-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/91123
* tree-ssa-sccvn.c (vn_walk_cb_data::finish): New method.
(vn_walk_cb_data::last_vuse): New member.
(vn_walk_cb_data::saved_operands): Likewsie.
(vn_walk_cb_data::~vn_walk_cb_data): Release saved_operands.
(vn_walk_cb_data::push_partial_def): Use finish.
(vn_reference_lookup_2): Update last_vuse and use finish if
we've saved operands.
(vn_reference_lookup_3): Use finish and update calls to
push_partial_defs everywhere. When translating through
memcpy or aggregate copies save off operands and alias-set.
(eliminate_dom_walker::eliminate_stmt): Restore VN_WALKREWRITE
operation for redundant store removal.
2020-02-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/92819 PR tree-optimization/92819
* tree-ssa-forwprop.c (simplify_vector_constructor): Avoid * tree-ssa-forwprop.c (simplify_vector_constructor): Avoid
generating more stmts than before. generating more stmts than before.
......
2020-02-04 Richard Biener <rguenther@suse.de> 2020-02-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/91123
* gcc.dg/tree-ssa/ssa-fre-85.c: New testcase.
2020-02-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/92819 PR tree-optimization/92819
* gcc.target/i386/pr92819.c: New testcase. * gcc.target/i386/pr92819.c: New testcase.
* gcc.target/i386/pr92803.c: Adjust. * gcc.target/i386/pr92803.c: Adjust.
......
/* { dg-do compile } */
/* { dg-options "-O -fstrict-aliasing -fdump-tree-fre1-details" } */
struct X { int i; int j; };
struct X x, y;
void foo ()
{
x.i = 1;
y = x;
y.i = 1; // redundant
}
/* { dg-final { scan-tree-dump "Deleted redundant store y.i" "fre1" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment