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] tree-cfg.c: Speed up thread_jumps_from_bb


Hi,

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?

Kazu Hirata

2004-10-22  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-cfg.c (thread_jumps_from_bb): Speed up by extracting
	edge information when we commit ourselves to threading a
	particular jump.

Index: tree-cfg.c
===================================================================
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)
 	  continue;
 	}
 
-      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);
 


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