Commit da11a720 by Richard Biener Committed by Richard Biener

tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...

2017-05-08  Richard Biener  <rguenther@suse.de>

	* tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...
	(gimple_assign_nonzero): ... this and remove strict_overflow_p
	argument.
	(gimple_stmt_nonzero_warnv_p): Rename to ...
	(gimple_stmt_nonzero_p): ... this and remove strict_overflow_p
	argument.
	(vrp_stmt_computes_nonzero): Remove strict_overflow_p argument.
	(extract_range_basic): Adjust, do not disable propagation on
	strict overflow sensitive simplification.
	(vrp_visit_cond_stmt): Likewise.

From-SVN: r247738
parent 18b8c294
2017-05-08 Richard Biener <rguenther@suse.de>
* tree-vrp.c (gimple_assign_nonzero_warnv_p): Rename to ...
(gimple_assign_nonzero): ... this and remove strict_overflow_p
argument.
(gimple_stmt_nonzero_warnv_p): Rename to ...
(gimple_stmt_nonzero_p): ... this and remove strict_overflow_p
argument.
(vrp_stmt_computes_nonzero): Remove strict_overflow_p argument.
(extract_range_basic): Adjust, do not disable propagation on
strict overflow sensitive simplification.
(vrp_visit_cond_stmt): Likewise.
2017-05-05 Jan Hubicka <hubicka@ucw.cz> 2017-05-05 Jan Hubicka <hubicka@ucw.cz>
* ipa-inline-analysis.c (estimate_function_body_sizes): Recompute * ipa-inline-analysis.c (estimate_function_body_sizes): Recompute
......
...@@ -857,27 +857,28 @@ symbolic_range_based_on_p (value_range *vr, const_tree sym) ...@@ -857,27 +857,28 @@ symbolic_range_based_on_p (value_range *vr, const_tree sym)
*STRICT_OVERFLOW_P.*/ *STRICT_OVERFLOW_P.*/
static bool static bool
gimple_assign_nonzero_warnv_p (gimple *stmt, bool *strict_overflow_p) gimple_assign_nonzero_p (gimple *stmt)
{ {
enum tree_code code = gimple_assign_rhs_code (stmt); enum tree_code code = gimple_assign_rhs_code (stmt);
bool strict_overflow_p;
switch (get_gimple_rhs_class (code)) switch (get_gimple_rhs_class (code))
{ {
case GIMPLE_UNARY_RHS: case GIMPLE_UNARY_RHS:
return tree_unary_nonzero_warnv_p (gimple_assign_rhs_code (stmt), return tree_unary_nonzero_warnv_p (gimple_assign_rhs_code (stmt),
gimple_expr_type (stmt), gimple_expr_type (stmt),
gimple_assign_rhs1 (stmt), gimple_assign_rhs1 (stmt),
strict_overflow_p); &strict_overflow_p);
case GIMPLE_BINARY_RHS: case GIMPLE_BINARY_RHS:
return tree_binary_nonzero_warnv_p (gimple_assign_rhs_code (stmt), return tree_binary_nonzero_warnv_p (gimple_assign_rhs_code (stmt),
gimple_expr_type (stmt), gimple_expr_type (stmt),
gimple_assign_rhs1 (stmt), gimple_assign_rhs1 (stmt),
gimple_assign_rhs2 (stmt), gimple_assign_rhs2 (stmt),
strict_overflow_p); &strict_overflow_p);
case GIMPLE_TERNARY_RHS: case GIMPLE_TERNARY_RHS:
return false; return false;
case GIMPLE_SINGLE_RHS: case GIMPLE_SINGLE_RHS:
return tree_single_nonzero_warnv_p (gimple_assign_rhs1 (stmt), return tree_single_nonzero_warnv_p (gimple_assign_rhs1 (stmt),
strict_overflow_p); &strict_overflow_p);
case GIMPLE_INVALID_RHS: case GIMPLE_INVALID_RHS:
gcc_unreachable (); gcc_unreachable ();
default: default:
...@@ -891,12 +892,12 @@ gimple_assign_nonzero_warnv_p (gimple *stmt, bool *strict_overflow_p) ...@@ -891,12 +892,12 @@ gimple_assign_nonzero_warnv_p (gimple *stmt, bool *strict_overflow_p)
*STRICT_OVERFLOW_P.*/ *STRICT_OVERFLOW_P.*/
static bool static bool
gimple_stmt_nonzero_warnv_p (gimple *stmt, bool *strict_overflow_p) gimple_stmt_nonzero_p (gimple *stmt)
{ {
switch (gimple_code (stmt)) switch (gimple_code (stmt))
{ {
case GIMPLE_ASSIGN: case GIMPLE_ASSIGN:
return gimple_assign_nonzero_warnv_p (stmt, strict_overflow_p); return gimple_assign_nonzero_p (stmt);
case GIMPLE_CALL: case GIMPLE_CALL:
{ {
tree fndecl = gimple_call_fndecl (stmt); tree fndecl = gimple_call_fndecl (stmt);
...@@ -934,13 +935,13 @@ gimple_stmt_nonzero_warnv_p (gimple *stmt, bool *strict_overflow_p) ...@@ -934,13 +935,13 @@ gimple_stmt_nonzero_warnv_p (gimple *stmt, bool *strict_overflow_p)
} }
} }
/* Like tree_expr_nonzero_warnv_p, but this function uses value ranges /* Like tree_expr_nonzero_p, but this function uses value ranges
obtained so far. */ obtained so far. */
static bool static bool
vrp_stmt_computes_nonzero (gimple *stmt, bool *strict_overflow_p) vrp_stmt_computes_nonzero (gimple *stmt)
{ {
if (gimple_stmt_nonzero_warnv_p (stmt, strict_overflow_p)) if (gimple_stmt_nonzero_p (stmt))
return true; return true;
/* If we have an expression of the form &X->a, then the expression /* If we have an expression of the form &X->a, then the expression
...@@ -3927,8 +3928,7 @@ extract_range_basic (value_range *vr, gimple *stmt) ...@@ -3927,8 +3928,7 @@ extract_range_basic (value_range *vr, gimple *stmt)
if (INTEGRAL_TYPE_P (type) if (INTEGRAL_TYPE_P (type)
&& gimple_stmt_nonnegative_warnv_p (stmt, &sop)) && gimple_stmt_nonnegative_warnv_p (stmt, &sop))
set_value_range_to_nonnegative (vr, type); set_value_range_to_nonnegative (vr, type);
else if (vrp_stmt_computes_nonzero (stmt, &sop) else if (vrp_stmt_computes_nonzero (stmt))
&& !sop)
set_value_range_to_nonnull (vr, type); set_value_range_to_nonnull (vr, type);
else else
set_value_range_to_varying (vr); set_value_range_to_varying (vr);
...@@ -7568,7 +7568,6 @@ static void ...@@ -7568,7 +7568,6 @@ static void
vrp_visit_cond_stmt (gcond *stmt, edge *taken_edge_p) vrp_visit_cond_stmt (gcond *stmt, edge *taken_edge_p)
{ {
tree val; tree val;
bool sop;
*taken_edge_p = NULL; *taken_edge_p = NULL;
...@@ -7634,25 +7633,14 @@ vrp_visit_cond_stmt (gcond *stmt, edge *taken_edge_p) ...@@ -7634,25 +7633,14 @@ vrp_visit_cond_stmt (gcond *stmt, edge *taken_edge_p)
additional checking. Testing on several code bases (GCC, DLV, additional checking. Testing on several code bases (GCC, DLV,
MICO, TRAMP3D and SPEC2000) showed that doing this results in MICO, TRAMP3D and SPEC2000) showed that doing this results in
4 more predicates folded in SPEC. */ 4 more predicates folded in SPEC. */
sop = false;
bool sop;
val = vrp_evaluate_conditional_warnv_with_ops (gimple_cond_code (stmt), val = vrp_evaluate_conditional_warnv_with_ops (gimple_cond_code (stmt),
gimple_cond_lhs (stmt), gimple_cond_lhs (stmt),
gimple_cond_rhs (stmt), gimple_cond_rhs (stmt),
false, &sop, NULL); false, &sop, NULL);
if (val) if (val)
{ *taken_edge_p = find_taken_edge (gimple_bb (stmt), val);
if (!sop)
*taken_edge_p = find_taken_edge (gimple_bb (stmt), val);
else
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
"\nIgnoring predicate evaluation because "
"it assumes that signed overflow is undefined");
val = NULL_TREE;
}
}
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
......
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