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]

[PATCH] Dont create redundant cgraph edges?


Hi!

Why does cgraph.c:create_edge create redundant callgraph edges at all?
By introducing a refcount as in the patch below we could save some memory
and possibly callee/caller list walking time. I put an abort() in case
of the overflow, but we could just create another edge in this case.
To not make struct cgraph_edge bigger with the refcount we could also
use unsigned short rather than unsigned int.

For a moderately complex POOMA testcase, the maximum refcount encountered
is 396.

Maybe you can pick up this idea to save some memory/compile time for C++
(I dont expect C to benefit from this, though genmodes.c shows a max
refcount of 112, f.i.). Survived a bootstrap on ix86 for C and C++.

Richard.

PS: patch hand-edited, may not apply...

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/

Attachment: edge-cleanup
Description: refcnt for cgraph_edge


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