This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
TREE_CHAIN graphs
- From: Devang Patel <dpatel at apple dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 5 Sep 2002 18:54:17 -0700
- Subject: TREE_CHAIN graphs
Hi All,
In my never ending search to understand GCC's memory usage pattern,
I instrumented TREE_CHAIN macro (just like what I did with TREE_CODE
macro).
However, this time I recorded address of each and every memory
reference being made using TREE_CHAIN macro. Using this info,
I derived sequential list of VM pages being accessed.
I have attached two graphs with this mail to show what is usage pattern.
In the graph
- Y-axis represents VM page number and X-axis represents
chronological memory references
- For each reference one VM Page number is associated
- Horizontal line will indicate same VM page is accessed again and
again.
I used following one line program:
int foo() { return 1;}
cc1plus recorded 6246 TREE_CHAIN memory references. And as you can see
from graph (cc1plus_original.png), it looks like cc1plus is walking
one chain 13 times.
After applying my "cp_binding_level reorg" patch, cc1plus recorded
only 3837 TREE_CHAIN memory references. Plus from the graph
(cc1plus_improved.png) we can see some improvement. Now same tree
chain is walked not that many times. (4 times instead of 13 times)
BTW, for the same program cc1 recorded only 1727 memory references.
[ I hope, I used correct format viewable by all and it is OK to
attach two graphs in one mail]
-Devang
Links related to patch:
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01328.html
http://gcc.gnu.org/ml/gcc-patches/2002-08/msg01373.html
Graphs:

