diff mbox

Trivial improvement to PRE debug dumps

Message ID 52183BBC.6010007@redhat.com
State New
Headers show

Commit Message

Jeff Law Aug. 24, 2013, 4:51 a.m. UTC
I was looking at a performance issue with some jump threading 
improvements when I had to dig through the PRE dumps.

PRE notes when it finds fully redundant expressions, but fails to 
actually include fully redundant expression in a textual form in the 
debugging dump.

ie, before my patch PRE would dump something like this:

Starting insert iteration 1
Found fully redundant value
Found fully redundant value
Found fully redundant value
Found fully redundant value
Found fully redundant value
Found fully redundant value
Found fully redundant value
Found fully redundant value

With my patch it will dump:

Starting insert iteration 1
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_defs.23_269}@.MEM_14
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_defs.23_269}@.MEM_14
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_defs.23_269}@.MEM_14
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_defs.23_269}@.MEM_14
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_uses.22_365}@.MEM_10
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_uses.22_365}@.MEM_10
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_uses.22_365}@.MEM_10
Found fully redundant value: 
{component_ref<num>,component_ref<prefix>,mem_ref<0B>,build_uses.22_365}@.MEM_10

Bootstrapped and regression tested on x86_64-unknown-linux-gnu. 
Installed on the trunk.

Jeff
commit cd3e98d9581722fbf4509bba6812b9a0929d7783
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Sat Aug 24 04:48:19 2013 +0000

            * tree-ssa-pre.c (do_regular_insertion): Include the expression
            in the debugging dump when the expression is fully redundant.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201963 138bc75d-0d04-0410-961f-82ee72b054a4
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b35e5f3..cd8b3f6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2013-08-23  Jeff Law  <law@redhat.com>
+
+	* tree-ssa-pre.c (do_regular_insertion): Include the expression in
+	the debugging dump when the expression is fully redundant.
+
 2013-08-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
 	* diagnostic.c (diagnostic_set_caret_max_width): Use pp_buffer.
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index f6928a8..56b0573 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3341,7 +3341,11 @@  do_regular_insertion (basic_block block, basic_block dom)
 	  if (bitmap_set_contains_value (AVAIL_OUT (dom), val))
 	    {
 	      if (dump_file && (dump_flags & TDF_DETAILS))
-		fprintf (dump_file, "Found fully redundant value\n");
+		{
+		  fprintf (dump_file, "Found fully redundant value: ");
+		  print_pre_expr (dump_file, expr);
+		  fprintf (dump_file, "\n");
+		}
 	      continue;
 	    }