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] speedup timevar pushing/poping


I noticed that the calling of timevar_push/pop when time reporting was
turned off because of the overhead for calling a function and then
setting up the stack frame.  This patch speeds up this by having a
macro to check the value of timevar_enable and then calling the
real functions if it is true.

Bootstrapped and tested (for about a six months now) on powerpc-apple-darwin.

OK?

Thanks,
Andrew Pinski

ChangeLog:

	* timevar.c (timevar_enable): Change from
	static.
	(timevar_push): Rename to ...
	(timevar_push_1): this and remove the
	enabled check.
	(timevar_pop): Rename to ...
	(timevar_pop_1): this and remove the
	enabled check.
	* timevar.h (POP_TIMEVAR_AND_RETURN): Use do/while loops.
	(timevar_pop): New macro.
	(timevar_push): New macro.
	(timevar_enable): Declare.
	

Patch:

Attachment: speeduptimevar.diff.txt
Description: Text document


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