This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Inefficient uses of JUMP_P
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 29 Nov 2004 22:23:58 -0500 (EST)
- Subject: Inefficient uses of JUMP_P
Hi,
I've been seeing JUMP_P often called on the same pointer as in the
previous invocation. Code I have in mind is like this:
if (s->dest == dest
&& any_condjump_p (BB_END (src))
&& onlyjump_p (BB_END (src)))
delete_insn (BB_END (src));
Note that any_condjump_p calls pc_set, which has a check for JUMP_P,
and that onlyjump_p also checks for JUMP_P.
To visualize this, I instrumented JUMP_P and measured how many times
JUMP_P is called on the same pointer as in the previous invocation.
Here is the result from all of cc1-i files.
# of duplicate invocations: 132468300
# of all invocations: 349866776
That is, about %38 percent of uses are redundant. This rate is more
or less consistent on each cc1-i file.
In fact, it's not uncommon to see these jump predicates around the
100th in the profile. They may collectively be using a lot of time.
I am thinking about making these checks the callers' responsibility so
that we will only have to do a single JUMP_P check for each "if"
statement containing several jump predicates.
Any comment?
Kazu Hirata