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]

Re: [patch] tree-cfg.c: Speed up thread_jumps.


On Sun, 2004-11-07 at 23:59 -0500, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to speed up thread_jumps by keeping a pointer to
> the last used element in the worklist.
> 
> This trick is used in cfganal.c:find_unreachable_blocks as well.
> 
> Note that we get to keep one fewer variables in innermost loops.
> 
> Tested on i686-pc-linux-gnu.  OK to apply?
> 
> Kazu Hirata
> 
> 2004-11-07  Kazu Hirata  <kazu@cs.umass.edu>
> 
> 	* tree-cfg.c (thread_jumps): Speed up by keeping a pointer to
> 	the last used element in the worklist.
I actually think this is OK -- which I know runs somewhat against
Diego's assesment.

Nowhere in this code is the index within the worklist important -- all
we need to know is what object within the worklist is the current
object and whether or not the worklist is empty.  Both are naturally
just pointers.  Keeping an index into the worklist seems silly.

Of course, I doubt the performance impact is measurable at all.

jeff



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