drop attempt to reuse cgraph callees for -fcallgraph-info
authorAlexandre Oliva <oliva@adacore.com>
Wed, 20 Nov 2019 20:54:31 +0000 (20:54 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Wed, 20 Nov 2019 20:54:31 +0000 (20:54 +0000)
The information in cgraph callees is released long before we get to
the point in which -fcallgraph-info edges are dumped, or even
expanded.  It doesn't make sense to retain it longer: the edges
created for -fcallgraph-info are much smaller, and they don't even
coexist, so not even peak use grows.

for  gcc/ChangeLog

* function.h (CALLEE_FROM_CGRAPH_P): Remove.
* function.c (record_final_call): Record even calls that might
have been in the cgraph.
* toplev.c (dump_final_node_vcg): Skip iteration over cgraph
callees.

From-SVN: r278529

gcc/ChangeLog
gcc/function.c
gcc/function.h
gcc/toplev.c

index 4700de2067f3695973301359b81895a9e252bbfb..31a270ab9a018e91b9f03394db118f5926ad9038 100644 (file)
@@ -1,3 +1,11 @@
+2019-11-20  Alexandre Oliva <oliva@adacore.com>
+
+       * function.h (CALLEE_FROM_CGRAPH_P): Remove.
+       * function.c (record_final_call): Record even calls that might
+       have been in the cgraph.
+       * toplev.c (dump_final_node_vcg): Skip iteration over cgraph
+       callees.
+
 2019-11-20  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * configure.ac: Use https for gcc.gnu.org
index 1fe956bd1a5382eeb93c885bac57c6867979ddde..2534c92487ef51117172f405ad8186c826df8143 100644 (file)
@@ -6406,9 +6406,6 @@ rest_of_handle_thread_prologue_and_epilogue (void)
 void
 record_final_call (tree callee, location_t location)
 {
-  if (!callee || CALLEE_FROM_CGRAPH_P (callee))
-    return;
-
   struct callinfo_callee datum = { location, callee };
   vec_safe_push (cfun->su->callees, datum);
 }
index 14794c420a215bc9c53e41ecfef555c9fd221a22..beb5c7d0cba16cb6bcdf3ec563558f240c95be91 100644 (file)
@@ -192,15 +192,12 @@ public:
   poly_int64 length;
 };
 
-/* Describe emitted builtin calls for -fcallgraph-info.  Those that
-   are not builtin are taken from cgraph edges.  */
+/* Describe emitted calls for -fcallgraph-info.  */
 struct GTY(()) callinfo_callee
 {
   location_t location;
   tree decl;
 };
-#define CALLEE_FROM_CGRAPH_P(T)                                \
-  (!fndecl_built_in_p (T) && !DECL_IS_BUILTIN (T))
 
 /* Describe dynamic allocation for -fcallgraph-info=da.  */
 struct GTY(()) callinfo_dalloc
index cfc757d84ba47ecc5ece6470148be4434693bb19..059046f40f38cf5b340a7d7be02a438e0a16ac00 100644 (file)
@@ -1093,14 +1093,6 @@ dump_final_node_vcg (FILE *f)
     dump_final_callee_vcg (f, c->location, c->decl);
   vec_free (cfun->su->callees);
   cfun->su->callees = NULL;
-
-  cgraph_node *cnode = cgraph_node::get (current_function_decl);
-  for (cgraph_edge *e = cnode->callees; e; e = e->next_callee)
-    if (CALLEE_FROM_CGRAPH_P (e->callee->decl))
-      dump_final_callee_vcg (f, gimple_location (e->call_stmt),
-                            e->callee->decl);
-  for (cgraph_edge *e = cnode->indirect_calls; e; e = e->next_callee)
-    dump_final_callee_vcg (f, gimple_location (e->call_stmt), NULL);
 }
 
 /* Output stack usage and callgraph info, as requested.  */