PR115394: Remove streamer_debugging and it's uses

Message ID DM5PR12MB2423DDD5B95F3BF57544747CCEA42@DM5PR12MB2423.namprd12.prod.outlook.com
State New
Headers
Series PR115394: Remove streamer_debugging and it's uses |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 warning Patch is already merged

Commit Message

Prathamesh Kulkarni July 10, 2024, 9:14 a.m. UTC
  Hi Richard,
As per your suggestion in PR, the attached patch removes streamer_debugging and it's uses.
Bootstrapped on aarch64-linux-gnu.
OK to commit ?

Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com>

Thanks,
Prathamesh
[PR115394] Remove streamer_debugging and it's uses.

gcc/ChangeLog:
        PR lto/115394
        * lto-streamer.h: Remove streamer_debugging definition.
        * lto-streamer-out.cc (stream_write_tree_ref): Remove use of streamer_debugging.
        (lto_output_tree): Likewise.
        * tree-streamer-in.cc (streamer_read_tree_bitfields): Likewise.
        (streamer_get_pickled_tree): Likewise.
        * tree-streamer-out.cc (pack_ts_base_value_fields): Likewise.

Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com>
  

Comments

Richard Biener July 10, 2024, 9:22 a.m. UTC | #1
On Wed, 10 Jul 2024, Prathamesh Kulkarni wrote:

> Hi Richard,
> As per your suggestion in PR, the attached patch removes streamer_debugging and it's uses.
> Bootstrapped on aarch64-linux-gnu.
> OK to commit ?

OK.

Thanks,
Richard.

> Signed-off-by: Prathamesh Kulkarni <prathameshk@nvidia.com>
> 
> Thanks,
> Prathamesh
>
  

Patch

diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc
index d4f728094ed..8b4bf9659cb 100644
--- a/gcc/lto-streamer-out.cc
+++ b/gcc/lto-streamer-out.cc
@@ -487,8 +487,6 @@  stream_write_tree_ref (struct output_block *ob, tree t)
 	    gcc_checking_assert (tag == LTO_global_stream_ref);
 	  streamer_write_hwi (ob, -(int)(ix * 2 + id + 1));
 	}
-      if (streamer_debugging)
-	streamer_write_uhwi (ob, TREE_CODE (t));
     }
 }
 
@@ -1839,9 +1837,6 @@  lto_output_tree (struct output_block *ob, tree expr,
 	 will instantiate two different nodes for the same object.  */
       streamer_write_record_start (ob, LTO_tree_pickle_reference);
       streamer_write_uhwi (ob, ix);
-      if (streamer_debugging)
-	streamer_write_enum (ob->main_stream, LTO_tags, LTO_NUM_TAGS,
-			     lto_tree_code_to_tag (TREE_CODE (expr)));
       lto_stats.num_pickle_refs_output++;
     }
   else
@@ -1882,9 +1877,6 @@  lto_output_tree (struct output_block *ob, tree expr,
 	    }
 	  streamer_write_record_start (ob, LTO_tree_pickle_reference);
 	  streamer_write_uhwi (ob, ix);
-	  if (streamer_debugging)
-	    streamer_write_enum (ob->main_stream, LTO_tags, LTO_NUM_TAGS,
-				 lto_tree_code_to_tag (TREE_CODE (expr)));
 	}
       in_dfs_walk = false;
       lto_stats.num_pickle_refs_output++;
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index e8dbba471ed..79c44d2cae7 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -126,10 +126,6 @@  along with GCC; see the file COPYING3.  If not see
 
 typedef unsigned char	lto_decl_flags_t;
 
-/* Stream additional data to LTO object files to make it easier to debug
-   streaming code.  This changes object files.  */
-static const bool streamer_debugging = false;
-
 /* Tags representing the various IL objects written to the bytecode file
    (GIMPLE statements, basic blocks, EH regions, tree nodes, etc).
 
diff --git a/gcc/tree-streamer-in.cc b/gcc/tree-streamer-in.cc
index 35341a2b2b6..c248a74f7a1 100644
--- a/gcc/tree-streamer-in.cc
+++ b/gcc/tree-streamer-in.cc
@@ -485,15 +485,6 @@  streamer_read_tree_bitfields (class lto_input_block *ib,
 
   /* Read the bitpack of non-pointer values from IB.  */
   bp = streamer_read_bitpack (ib);
-
-  /* The first word in BP contains the code of the tree that we
-     are about to read.  */
-  if (streamer_debugging)
-    {
-      code = (enum tree_code) bp_unpack_value (&bp, 16);
-      lto_tag_check (lto_tree_code_to_tag (code),
-		     lto_tree_code_to_tag (TREE_CODE (expr)));
-    }
   code = TREE_CODE (expr);
 
   /* Note that all these functions are highly sensitive to changes in
@@ -1110,17 +1101,8 @@  streamer_get_pickled_tree (class lto_input_block *ib, class data_in *data_in)
 {
   unsigned HOST_WIDE_INT ix;
   tree result;
-  enum LTO_tags expected_tag;
 
   ix = streamer_read_uhwi (ib);
   result = streamer_tree_cache_get_tree (data_in->reader_cache, ix);
-
-  if (streamer_debugging)
-    {
-      expected_tag = streamer_read_enum (ib, LTO_tags, LTO_NUM_TAGS);
-      gcc_assert (result
-		  && TREE_CODE (result) == lto_tag_to_tree_code (expected_tag));
-    }
-
   return result;
 }
diff --git a/gcc/tree-streamer-out.cc b/gcc/tree-streamer-out.cc
index c30ab62a585..b7205287ffb 100644
--- a/gcc/tree-streamer-out.cc
+++ b/gcc/tree-streamer-out.cc
@@ -71,8 +71,6 @@  write_identifier (struct output_block *ob,
 static inline void
 pack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
 {
-  if (streamer_debugging)
-    bp_pack_value (bp, TREE_CODE (expr), 16);
   if (!TYPE_P (expr))
     {
       bp_pack_value (bp, TREE_SIDE_EFFECTS (expr), 1);