[RFC] Mixed results with O(1) PHI arg lookup

Kazu Hirata kazu@cs.umass.edu
Fri Nov 5 22:43:00 GMT 2004


Hi Paolo,

> You could add a BB_HAS_ATTACHED_INFO flag on bb's with PHI nodes, and
> only call the hooks if it is set.  The insn-attrtab performance looks great.

I might worsen the performance because you can check if a BB has any
PHI node with "if (phi_nodes (bb)) ...".

Anyway, I did a coverage testing on cc1-i files to see how many times
we are calling the new CFG hooks in what situation.  Here are the
details.

Edge addition
-------------

2233672 - # of edges we add during the entire compilation
1426834 - # of edges we add while we are in tree
 976070 - # of edges we add while we are in tree SSA
 300640 - # of edges we add to those destination basic blocks with PHI
          nodes

Edge removal
------------

1565032 - # of edges we remove during the entire compilation
1095958 - # of edges we remove while we are in tree
1012294 - # of edges we remove while we are in tree SSA
 284838 - # of edges we remove from those destination basic blocks with
          PHI nodes

Note that an edge redirection is counted as one addition and one
removal.

In either case, the new CFG hooks are at work less than 20% of time.
In other words, more than 80% of the time, we are calling the new CFG
hooks for nothing.

I thought that most of the edges that are created come from CFG
construction, but that's not true.  We create more edges outwide CFG
consturction than we do we do inside CFG construction.  I guess if we
split all critical edges, etc, we may get a lot of new edges from
there.

Kazu Hirata



More information about the Gcc mailing list