* For SSA_NAME: Print the ssa name's def stmt on its own line.

Before:
 <ssa_name 0x7ffff6a26ca8
    type <vector_type 0x7ffff6a09bd0
        type <integer_type 0x7ffff688a888 unsigned int sizes-gimplified public 
unsigned SI
            size <integer_cst 0x7ffff6886ca8 constant 32>
            unit size <integer_cst 0x7ffff6886cc0 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff688a888 
precision 32 min <integer_cst 0x7ffff6886f30 0> max <integer_cst 0x7ffff6886f18 
4294967295> context <translation_unit_decl 0x7ffff6893348 D.2203>
            pointer_to_this <pointer_type 0x7ffff68aae70>>
        unsigned V8SI
        size <integer_cst 0x7ffff68a2168 constant 256>
        unit size <integer_cst 0x7ffff68a21f8 constant 32>
        align 256 symtab 0 alias set 1 canonical type 0x7ffff6a09bd0 nunits 8
        pointer_to_this <pointer_type 0x7ffff6a09d20>>
    visited var <var_decl 0x7ffff6a046c0 vect__2.15>def_stmt vect__2.15_101 = 
vect__1.14_99 & { 1, 1, 1, 1, 1, 1, 1, 1 };

    version 101>

After:
(gdb) print debug_tree (op0)
 <ssa_name 0x7ffff6a26ca8
    type <vector_type 0x7ffff6a09bd0
        type <integer_type 0x7ffff688a888 unsigned int sizes-gimplified public 
unsigned SI
            size <integer_cst 0x7ffff6886ca8 constant 32>
            unit size <integer_cst 0x7ffff6886cc0 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff688a888 
precision 32 min <integer_cst 0x7ffff6886f30 0> max <integer_cst 0x7ffff6886f18 
4294967295> context <translation_unit_decl 0x7ffff6893348 D.2203>
            pointer_to_this <pointer_type 0x7ffff68aae70>>
        unsigned V8SI
        size <integer_cst 0x7ffff68a2168 constant 256>
        unit size <integer_cst 0x7ffff68a21f8 constant 32>
        align 256 symtab 0 alias set 1 canonical type 0x7ffff6a09bd0 nunits 8
        pointer_to_this <pointer_type 0x7ffff6a09d20>>
    visited var <var_decl 0x7ffff6a046c0 vect__2.15>
    def_stmt vect__2.15_101 = vect__1.14_99 & { 1, 1, 1, 1, 1, 1, 1, 1 };

    version 101>

* For VECTOR_CST: Coalesce the output of identical consecutive elt values.

Before:
 <vector_cst 0x7ffff6a23870
    type <vector_type 0x7ffff6a09bd0
        type <integer_type 0x7ffff688a888 unsigned int sizes-gimplified public 
unsigned SI
            size <integer_cst 0x7ffff6886ca8 constant 32>
            unit size <integer_cst 0x7ffff6886cc0 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff688a888 
precision 32 min <integer_cst 0x7ffff6886f30 0> max <integer_cst 0x7ffff6886f18 
4294967295> context <translation_unit_decl 0x7ffff6893348 D.2203>
            pointer_to_this <pointer_type 0x7ffff68aae70>>
        unsigned V8SI
        size <integer_cst 0x7ffff68a2168 constant 256>
        unit size <integer_cst 0x7ffff68a21f8 constant 32>
        align 256 symtab 0 alias set 1 canonical type 0x7ffff6a09bd0 nunits 8
        pointer_to_this <pointer_type 0x7ffff6a09d20>>
    constant
    elt0:  <integer_cst 0x7ffff69ec840 type <integer_type 0x7ffff69db3f0 ui> 
constant 0> elt1:  <integer_cst 0x7ffff69ec840 0> elt2:  <integer_cst 
0x7ffff69ec840 0> elt3:  <integer_cst 0x7ffff69ec840 0> elt4:  <integer_cst 
0x7ffff69ec840 0> elt5:  <integer_cst 0x7ffff69ec840 0> elt6:  <integer_cst 
0x7ffff69ec840 0> elt7:  <integer_cst 0x7ffff69ec840 0>>

After:
(gdb) print debug_tree (op1)
 <vector_cst 0x7ffff6a23870
    type <vector_type 0x7ffff6a09bd0
        type <integer_type 0x7ffff688a888 unsigned int sizes-gimplified public 
unsigned SI
            size <integer_cst 0x7ffff6886ca8 constant 32>
            unit size <integer_cst 0x7ffff6886cc0 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff688a888 
precision 32 min <integer_cst 0x7ffff6886f30 0> max <integer_cst 0x7ffff6886f18 
4294967295> context <translation_unit_decl 0x7ffff6893348 D.2203>
            pointer_to_this <pointer_type 0x7ffff68aae70>>
        unsigned V8SI
        size <integer_cst 0x7ffff68a2168 constant 256>
        unit size <integer_cst 0x7ffff68a21f8 constant 32>
        align 256 symtab 0 alias set 1 canonical type 0x7ffff6a09bd0 nunits 8
        pointer_to_this <pointer_type 0x7ffff6a09d20>>
    constant
    elt0...elt7:  <integer_cst 0x7ffff69ec840 type <integer_type 0x7ffff69db3f0 
ui> constant 0>>

(I also tested the change on non-uniform VECTOR_CSTs.)

Does this look OK to commit after bootstrap + regtesting?

gcc/ChangeLog:

        * print-tree.c (print_node) [VECTOR_CST]: Coalesce the output of
        identical consecutive elt values.
        [SSA_NAME]: Print the name's def stmt on its own line.
---
 gcc/print-tree.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 468f1ff..c87f901 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -770,8 +770,17 @@ print_node (FILE *file, const char *prefix, tree node, int 
indent)
 
            for (i = 0; i < VECTOR_CST_NELTS (node); ++i)
              {
-               sprintf (buf, "elt%u: ", i);
+               unsigned j;
+               for (j = i + 1; j < VECTOR_CST_NELTS (node); j++)
+                 if (VECTOR_CST_ELT (node, j) != VECTOR_CST_ELT (node, i))
+                   break;
+               j--;
+               if (i == j)
+                 sprintf (buf, "elt%u: ", i);
+               else
+                 sprintf (buf, "elt%u...elt%u: ", i, j);
                print_node (file, buf, VECTOR_CST_ELT (node, i), indent + 4);
+               i = j;
              }
          }
          break;
@@ -869,6 +878,7 @@ print_node (FILE *file, const char *prefix, tree node, int 
indent)
 
        case SSA_NAME:
          print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4);
+         indent_to (file, indent + 4);
          fprintf (file, "def_stmt ");
          print_gimple_stmt (file, SSA_NAME_DEF_STMT (node), indent + 4, 0);
 
-- 
2.9.3.650.g20ba99f

Reply via email to