Free ipa args summary after inlining
diff mbox series

Message ID 20191110160506.ql7yeghfveajowft@kam.mff.cuni.cz
State New
Headers show
Series
  • Free ipa args summary after inlining
Related show

Commit Message

Jan Hubicka Nov. 10, 2019, 4:05 p.m. UTC
Hi,
this patch adds removal of ipa_edge_args_sum for the inlined edges.
It turns out that those are still needed for described uses (though I am
not sure why described uses are counted across all inline duplicates
rather than handled for each of them independently), so I keep those.

Bootstrapped/regtested x86_64-linux, comitted.

Honza

	* ipa-prop.c (ipa_propagate_indirect_call_infos): Remove ipa edge
	args summaries of inlined edge unless it holds info about
	described reference.

Patch
diff mbox series

Index: ipa-prop.c
===================================================================
--- ipa-prop.c	(revision 278016)
+++ ipa-prop.c	(working copy)
@@ -3727,6 +3727,26 @@  ipa_propagate_indirect_call_infos (struc
   changed = propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
   ipa_node_params_sum->remove (cs->callee);
 
+  class ipa_edge_args *args = IPA_EDGE_REF (cs);
+  if (args)
+    {
+      bool ok = true;
+      if (args->jump_functions)
+	{
+	  struct ipa_jump_func *jf;
+	  int i;
+	  FOR_EACH_VEC_ELT (*args->jump_functions, i, jf)
+	    if (jf->type == IPA_JF_CONST
+		&& ipa_get_jf_constant_rdesc (jf))
+	      {
+		ok = false;
+		break;
+	      }
+	}
+      if (ok)
+        ipa_edge_args_sum->remove (cs);
+    }
+
   return changed;
 }