Unify EVRP and VRP folding predicate message.

EVRP issues a message fior folding predicates in a different format than
VRP does, this patch unifies the messaging.

	gcc/
	* vr-values.c (simplify_using_ranges::fold_cond): Change fold message.

	gcc/testsuite/
	* gcc.dg/tree-ssa/evrp9.c: Adjust message scanned for.
	* gcc.dg/tree-ssa/pr21458-2.c: Ditto.
This commit is contained in:
Andrew MacLeod 2021-10-26 13:19:05 -04:00
parent d46aeb5906
commit a6bbf1cc9f
3 changed files with 15 additions and 7 deletions

View file

@ -24,5 +24,7 @@ foo (unsigned int x, unsigned int y)
bar ();
}
/* { dg-final { scan-tree-dump-not "== 5" "evrp" } } */
/* { dg-final { scan-tree-dump-not "== 6" "evrp" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate minv_.* == 5 to 0" 1 "evrp" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate minv_.* == 6 to 0" 1 "evrp" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate maxv_.* == 5 to 0" 1 "evrp" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate maxv_.* == 6 to 0" 1 "evrp" } } */

View file

@ -16,4 +16,4 @@ foo (int a)
}
}
/* { dg-final { scan-tree-dump-times "Predicate evaluates to: 1" 1 "evrp" } } */
/* { dg-final { scan-tree-dump-times "Folding predicate.* to 1" 1 "evrp" } } */

View file

@ -3495,12 +3495,18 @@ simplify_using_ranges::fold_cond (gcond *cond)
if (TREE_CODE (gimple_cond_lhs (cond)) != SSA_NAME
&& TREE_CODE (gimple_cond_rhs (cond)) != SSA_NAME)
return false;
if (dump_file)
{
fprintf (dump_file, "Folding predicate ");
print_gimple_expr (dump_file, cond, 0);
fprintf (dump_file, " to ");
}
edge e0 = EDGE_SUCC (gimple_bb (cond), 0);
edge e1 = EDGE_SUCC (gimple_bb (cond), 1);
if (r.zero_p ())
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nPredicate evaluates to: 0\n");
if (dump_file)
fprintf (dump_file, "0\n");
gimple_cond_make_false (cond);
if (e0->flags & EDGE_TRUE_VALUE)
set_and_propagate_unexecutable (e0);
@ -3509,8 +3515,8 @@ simplify_using_ranges::fold_cond (gcond *cond)
}
else
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nPredicate evaluates to: 1\n");
if (dump_file)
fprintf (dump_file, "1\n");
gimple_cond_make_true (cond);
if (e0->flags & EDGE_FALSE_VALUE)
set_and_propagate_unexecutable (e0);