scev: dump final value replacement expressions

Message ID alpine.LNX.2.20.13.1808171613470.2296@monopod.intra.ispras.ru
State New
Headers show
Series
  • scev: dump final value replacement expressions
Related show

Commit Message

Alexander Monakov Aug. 17, 2018, 1:19 p.m.
Hello,

I'd like to apply the following patch to make GENERIC expressions
used in final value replacement visible in pass dumps.

We currently dump only the last statement, but that is not very
convenient as final values are sometimes complex and expand to
multiple gimple statements.

	* tree-scalar-evolution.c (final_value_replacement_loop): Dump
	full GENERIC expression used for replacement.

Comments

Jeff Law Aug. 17, 2018, 2:16 p.m. | #1
On 08/17/2018 07:19 AM, Alexander Monakov wrote:
> Hello,

> 

> I'd like to apply the following patch to make GENERIC expressions

> used in final value replacement visible in pass dumps.

> 

> We currently dump only the last statement, but that is not very

> convenient as final values are sometimes complex and expand to

> multiple gimple statements.

> 

> 	* tree-scalar-evolution.c (final_value_replacement_loop): Dump

> 	full GENERIC expression used for replacement.

OK.
jeff

Patch

diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 69122f2652f..6475743a26a 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -3617,7 +3617,8 @@  final_value_replacement_loop (struct loop *loop)
 	{
 	  fprintf (dump_file, "\nfinal value replacement:\n  ");
 	  print_gimple_stmt (dump_file, phi, 0);
-	  fprintf (dump_file, "  with\n  ");
+	  fprintf (dump_file, " with expr: ");
+	  print_generic_expr (dump_file, def);
 	}
       def = unshare_expr (def);
       remove_phi_node (&psi, false);
@@ -3656,6 +3657,7 @@  final_value_replacement_loop (struct loop *loop)
       gsi_insert_before (&gsi, ass, GSI_SAME_STMT);
       if (dump_file)
 	{
+	  fprintf (dump_file, "\n final stmt:\n  ");
 	  print_gimple_stmt (dump_file, ass, 0);
 	  fprintf (dump_file, "\n");
 	}