Commit a0c012fd by Richard Biener Committed by Richard Biener

gimple-match-head.c (gimple_simplify): For [VEC_]COND_EXPRs on the rhs of…

gimple-match-head.c (gimple_simplify): For [VEC_]COND_EXPRs on the rhs of assignments first simplify the embedded...

2015-08-03  Richard Biener  <rguenther@suse.de>

	* gimple-match-head.c (gimple_simplify): For [VEC_]COND_EXPRs
	on the rhs of assignments first simplify the embedded
	GENERIC condition.

From-SVN: r226488
parent 52639a61
2015-08-03 Richard Biener <rguenther@suse.de>
* gimple-match-head.c (gimple_simplify): For [VEC_]COND_EXPRs
on the rhs of assignments first simplify the embedded
GENERIC condition.
2015-08-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/66917
* tree-vectorizer.h (struct dataref_aux): Add base_element_aligned
field.
......
......@@ -660,10 +660,43 @@ gimple_simplify (gimple stmt,
}
case GIMPLE_TERNARY_RHS:
{
bool valueized = false;
tree rhs1 = gimple_assign_rhs1 (stmt);
/* If this is a [VEC_]COND_EXPR first try to simplify an
embedded GENERIC condition. */
if (code == COND_EXPR
|| code == VEC_COND_EXPR)
{
if (COMPARISON_CLASS_P (rhs1))
{
tree lhs = TREE_OPERAND (rhs1, 0);
tree rhs = TREE_OPERAND (rhs1, 1);
lhs = do_valueize (lhs, top_valueize, valueized);
rhs = do_valueize (rhs, top_valueize, valueized);
code_helper rcode2 = TREE_CODE (rhs1);
tree ops2[3] = {};
ops2[0] = lhs;
ops2[1] = rhs;
if ((gimple_resimplify2 (seq, &rcode2, TREE_TYPE (rhs1),
ops2, valueize)
|| valueized)
&& rcode2.is_tree_code ())
{
valueized = true;
if (TREE_CODE_CLASS ((enum tree_code)rcode2)
== tcc_comparison)
rhs1 = build2 (rcode2, TREE_TYPE (rhs1),
ops2[0], ops2[1]);
else if (rcode2 == SSA_NAME
|| rcode2 == INTEGER_CST)
rhs1 = ops2[0];
else
valueized = false;
}
}
}
tree rhs2 = gimple_assign_rhs2 (stmt);
tree rhs3 = gimple_assign_rhs3 (stmt);
bool valueized = false;
rhs1 = do_valueize (rhs1, top_valueize, valueized);
rhs2 = do_valueize (rhs2, top_valueize, valueized);
rhs3 = do_valueize (rhs3, top_valueize, valueized);
......
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