This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [lto] remove rebuild_ssa_for_lto


Nathan Froyd wrote:

@@ -735,6 +735,7 @@ input_expr_operand (struct input_block *
case SSA_NAME:
result = VEC_index (tree, SSANAMES (fn), input_uleb128 (ib));
+ add_referenced_var (SSA_NAME_VAR (result));

Since you're adding referenced vars as you read-in the body, it would be beneficial to gate pass_referenced_vars so that it doesn't re-scan the IL. You'll save yourself a few cycles on the way in.



+      /* Ensure that all our variables have annotations attached to them
+	 so building SSA doesn't choke.  */
+      {
+	int i;
+
+	for (i = 0; i < header->num_var_decls; i++)
+	  add_referenced_var (data_in.var_decls[i]);
+	for (i =0; i < header->num_local_decls; i++)
+	  add_referenced_var (data_in.local_decls[i]);

Haven't these been added while reading the IL? In referenced_vars we should only have things that are explicitly mentioned in the body of the function. If this loop is adding all the global/static vars, then it's adding too much.



Diego.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]