Commit a0038966 by Richard Biener Committed by Richard Biener

tree-ssa-dom.c (build_and_record_new_cond): Add optional parameter to record a…

tree-ssa-dom.c (build_and_record_new_cond): Add optional parameter to record a condition that is false.

2015-07-02  Richard Biener  <rguenther@suse.de>

	* tree-ssa-dom.c (build_and_record_new_cond): Add optional
	parameter to record a condition that is false.
	(record_conditions): When recording an extra NE_EXPR that is
	true also record a EQ_EXPR that is false.

	* gcc.dg/tree-ssa/ssa-dom-cse-4.c: New testcase.

From-SVN: r225299
parent 53ac92c3
2015-07-02 Richard Biener <rguenther@suse.de>
* tree-ssa-dom.c (build_and_record_new_cond): Add optional
parameter to record a condition that is false.
(record_conditions): When recording an extra NE_EXPR that is
true also record a EQ_EXPR that is false.
2015-07-02 Bin Cheng <bin.cheng@arm.com>
* tree-ssa-loop-ivopts.c (struct ivopts_data): New field iv_obstack.
......
2015-07-02 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/ssa-dom-cse-4.c: New testcase.
2015-07-01 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/mpx/pr66568.c (exit): New prototype.
......
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-optimized" } */
extern void abort (void);
unsigned int
foo (unsigned int x, unsigned int y)
{
unsigned int z;
if (x >= y)
return 1;
if (y == x)
abort ();
return 0;
}
/* { dg-final { scan-tree-dump-not "abort" "optimized" } } */
......@@ -813,7 +813,8 @@ free_all_edge_infos (void)
static void
build_and_record_new_cond (enum tree_code code,
tree op0, tree op1,
vec<cond_equivalence> *p)
vec<cond_equivalence> *p,
bool val = true)
{
cond_equivalence c;
struct hashable_expr *cond = &c.cond;
......@@ -826,7 +827,7 @@ build_and_record_new_cond (enum tree_code code,
cond->ops.binary.opnd0 = op0;
cond->ops.binary.opnd1 = op1;
c.value = boolean_true_node;
c.value = val ? boolean_true_node : boolean_false_node;
p->safe_push (c);
}
......@@ -865,6 +866,8 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
op0, op1, &edge_info->cond_equivalences);
build_and_record_new_cond (NE_EXPR, op0, op1,
&edge_info->cond_equivalences);
build_and_record_new_cond (EQ_EXPR, op0, op1,
&edge_info->cond_equivalences, false);
break;
case GE_EXPR:
......
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