Commit b00734df by Richard Biener Committed by Richard Biener

re PR tree-optimization/63677 (Failure to constant fold with vectorization.)

2014-11-20   Richard Biener  <rguenther@suse.de>

	PR tree-optimization/63677
	* tree-ssa-dom.c: Include gimplify.h for unshare_expr.
	(avail_exprs_stack): Make a vector of pairs.
	(struct hash_expr_elt): Replace stmt member with vop member.
	(expr_elt_hasher::equal): Simplify.
	(initialize_hash_element): Adjust.
	(initialize_hash_element_from_expr): Likewise.
	(dom_opt_dom_walker::thread_across_edge): Likewise.
	(record_cond): Likewise.
	(dom_opt_dom_walker::before_dom_children): Likewise.
	(print_expr_hash_elt): Likewise.
	(remove_local_expressions_from_table): Restore previous state
	if requested.
	(record_equivalences_from_stmt): Record &x + CST as constant
	&MEM[&x, CST] for further propagation.
	(vuse_eq): New function.
	(lookup_avail_expr): For loads use the alias oracle to see
	whether a candidate from the expr hash is usable.
	(avail_expr_hash): Do not hash VUSEs.

	* gcc.dg/tree-ssa/ssa-dom-cse-2.c: New testcase.
	* gcc.dg/tree-ssa/ssa-dom-cse-3.c: Likewise.

From-SVN: r217827
parent 07dc4e87
2014-11-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/63677
* tree-ssa-dom.c: Include gimplify.h for unshare_expr.
(avail_exprs_stack): Make a vector of pairs.
(struct hash_expr_elt): Replace stmt member with vop member.
(expr_elt_hasher::equal): Simplify.
(initialize_hash_element): Adjust.
(initialize_hash_element_from_expr): Likewise.
(dom_opt_dom_walker::thread_across_edge): Likewise.
(record_cond): Likewise.
(dom_opt_dom_walker::before_dom_children): Likewise.
(print_expr_hash_elt): Likewise.
(remove_local_expressions_from_table): Restore previous state
if requested.
(record_equivalences_from_stmt): Record &x + CST as constant
&MEM[&x, CST] for further propagation.
(vuse_eq): New function.
(lookup_avail_expr): For loads use the alias oracle to see
whether a candidate from the expr hash is usable.
(avail_expr_hash): Do not hash VUSEs.
2014-11-20 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/59593
2014-11-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/63677
* gcc.dg/tree-ssa/ssa-dom-cse-2.c: New testcase.
* gcc.dg/tree-ssa/ssa-dom-cse-3.c: Likewise.
2014-11-20 Igor Zamyatin <igor.zamyatin@intel.com>
PR sanitizer/63845
......
/* { dg-do compile } */
/* { dg-options "-O3 -fno-tree-fre -fno-tree-pre -fdump-tree-optimized" } */
int
foo ()
{
const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
int i, sum;
sum = 0;
for (i = 0; i < sizeof (a) / sizeof (*a); i++)
sum += a[i];
return sum;
}
/* After late unrolling the above loop completely DOM should be
able to optimize this to return 28. */
/* { dg-final { scan-tree-dump "return 28;" "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-do run } */
/* { dg-options "-O -fno-tree-fre -fdump-tree-dom1" } */
extern void abort (void);
int a;
int __attribute__((noinline))
foo (int b)
{
a = 0;
if (b)
{
a = 1;
return a;
}
/* DOM should be able to CSE both loads here, forwarding 0 and 1
to the PHI feeding the return. */
return a;
}
int
main()
{
if (foo (0) != 0
|| foo (1) != 1)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump "= PHI <\[01\]\\\(.\\\), \[01\]\\\(.\\\)>" "dom1" } } */
/* { dg-final { cleanup-tree-dump "dom1" } } */
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