This is the mail archive of the
mailing list for the GCC project.
[patch] tree-cfg.c: Speed up thread_jumps_from_bb
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Oct 2004 01:16:50 -0400 (EDT)
- Subject: [patch] tree-cfg.c: Speed up thread_jumps_from_bb
Attached is a patch to speed up thread_jumps_from_bb.
We extract information about an edge to be threaded before we check
all of the criteria for jump threading.
With the patch, we extract edge information when we commit ourselves
to threading a particular jump.
Tested on i686-pc-linux-gnu. OK to apply?
2004-10-22 Kazu Hirata <email@example.com>
* tree-cfg.c (thread_jumps_from_bb): Speed up by extracting
edge information when we commit ourselves to threading a
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.86
diff -u -p -r2.86 tree-cfg.c
--- tree-cfg.c 21 Oct 2004 16:06:31 -0000 2.86
+++ tree-cfg.c 21 Oct 2004 18:02:04 -0000
@@ -3788,9 +3788,6 @@ thread_jumps_from_bb (basic_block bb)
- count = e->count;
- freq = EDGE_FREQUENCY (e);
/* Now walk through as many forwarder blocks as possible to find
the ultimate destination we want to thread our jump to. */
last = EDGE_SUCC (e->dest, 0);
@@ -3839,6 +3836,8 @@ thread_jumps_from_bb (basic_block bb)
/* Perform the redirection. */
retval = true;
+ count = e->count;
+ freq = EDGE_FREQUENCY (e);
old_dest = e->dest;
e = redirect_edge_and_branch (e, dest);