Commit 8b7db259 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/52975 (Ofast produces not optimized code for vectorized "converted if")

2012-04-16  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/52975
	* tree-if-conv.c (predicate_bbs): Do not simplify inverted
	condition but always mark it with TRUTH_NOT_EXPR.

From-SVN: r186491
parent 3be74079
2012-04-16 Richard Guenther <rguenther@suse.de> 2012-04-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52975 PR tree-optimization/52975
* tree-if-conv.c (predicate_bbs): Do not simplify inverted
condition but always mark it with TRUTH_NOT_EXPR.
2012-04-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/52975
* tree-ssa-forwprop.c (combine_cond_exprs): New function. * tree-ssa-forwprop.c (combine_cond_exprs): New function.
(ssa_forward_propagate_and_combine): Call it for COND_EXPRs (ssa_forward_propagate_and_combine): Call it for COND_EXPRs
and VEC_COND_EXPRs. Also combine into VEC_COND_EXPRs condition. and VEC_COND_EXPRs. Also combine into VEC_COND_EXPRs condition.
......
...@@ -968,7 +968,7 @@ predicate_bbs (loop_p loop) ...@@ -968,7 +968,7 @@ predicate_bbs (loop_p loop)
case GIMPLE_COND: case GIMPLE_COND:
{ {
tree c2, tem; tree c2;
edge true_edge, false_edge; edge true_edge, false_edge;
location_t loc = gimple_location (stmt); location_t loc = gimple_location (stmt);
tree c = fold_build2_loc (loc, gimple_cond_code (stmt), tree c = fold_build2_loc (loc, gimple_cond_code (stmt),
...@@ -986,10 +986,8 @@ predicate_bbs (loop_p loop) ...@@ -986,10 +986,8 @@ predicate_bbs (loop_p loop)
unshare_expr (c)); unshare_expr (c));
/* If C is false, then FALSE_EDGE is taken. */ /* If C is false, then FALSE_EDGE is taken. */
c2 = invert_truthvalue_loc (loc, unshare_expr (c)); c2 = build1_loc (loc, TRUTH_NOT_EXPR,
tem = canonicalize_cond_expr_cond (c2); boolean_type_node, unshare_expr (c));
if (tem)
c2 = tem;
add_to_dst_predicate_list (loop, false_edge, add_to_dst_predicate_list (loop, false_edge,
unshare_expr (cond), c2); unshare_expr (cond), c2);
......
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