Patchwork Update streaming code to use const_value_known

login
register
mail settings
Submitter Jan Hubicka
Date Sept. 16, 2010, 9:28 p.m.
Message ID <20100916212813.GD6006@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/65016/
State New
Headers show

Comments

Jan Hubicka - Sept. 16, 2010, 9:28 p.m.
Hi,
while looking into streamer code I noticed that I forgot to update it whole introducing
const_value_known flag.  Testing TREE_READONLY is also fine, but it leads us to stream
unnecesary many constructors.
Fixed thus. Boostrapped/regtested x86_64-linux, will commit it shortly.

Honza

	* lto.c (lto_promote_cross_file_statics): Use const_value_known.
	* lto-cgraph.c (compute_ltrans_boundary): Likewise.

Patch

Index: lto/lto.c
===================================================================
--- lto/lto.c	(revision 164344)
+++ lto/lto.c	(working copy)
@@ -1013,7 +1259,7 @@  lto_promote_cross_file_statics (void)
 	 from this partition that are not in this partition.
 	 This needs to be done recursively.  */
       for (vnode = varpool_nodes; vnode; vnode = vnode->next)
-	if ((TREE_READONLY (vnode->decl) || DECL_IN_CONSTANT_POOL (vnode->decl))
+	if ((vnode->const_value_known || DECL_IN_CONSTANT_POOL (vnode->decl))
 	    && DECL_INITIAL (vnode->decl)
 	    && !varpool_node_in_set_p (vnode, vset)
 	    && referenced_from_this_partition_p (&vnode->ref_list, set, vset)
@@ -1053,7 +1299,7 @@  lto_promote_cross_file_statics (void)
 			   && !v->externally_visible && v->analyzed)
 		    {
 		      if (promote_var (v)
-			  && DECL_INITIAL (v->decl) && TREE_READONLY (v->decl)
+			  && DECL_INITIAL (v->decl) && v->const_value_known
 			  && !pointer_set_insert (inserted, vnode))
 			VEC_safe_push (varpool_node_ptr, heap,
 				       promoted_initializers, v);
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c	(revision 164344)
+++ lto-cgraph.c	(working copy)
@@ -814,7 +815,7 @@  compute_ltrans_boundary (struct lto_out_
 	  && !lto_varpool_encoder_encode_initializer_p (varpool_encoder,
 						        vnode)
 	  && (DECL_IN_CONSTANT_POOL (vnode->decl)
-	      ||  TREE_READONLY (vnode->decl)))
+	      || vnode->const_value_known))
 	{
 	  lto_set_varpool_encoder_encode_initializer (varpool_encoder, vnode);
 	  add_references (encoder, varpool_encoder, &vnode->ref_list);