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 i386]: Add for win32 targets pre-prologue profiling feature


Hello Andy,

I updated my patch in that way, that it should be trivial to add the
counter function for before prologue profiling to linux target by a
one-liner.
Just make sure that for the i386-target the macro
MCOUNT_NAME_BEFORE_PROLOGUE is defined.

I reworked the patch so that the option is now named -mfentry and it
is available for all i386 targets, if they have defined the counter
function's name via MCOUNT_NAME_BEFORE_PROLOGUE in target.
Additionally I added some option-checks for targets, which don't
support before prologue profiling.

ChangeLog

2010-07-15  Kai Tietz

	* config/i386/cygming.h (MCOUNT_NAME): New.
	(MCOUNT_NAME_BEFORE_PROLOGUE): New.
	* config/i386/i386.c (ix86_profile_before_prologue): New.
	(override_options): Add special handling for -mfentry.
	(ix86_function_regparm): Likewise.
	(ix86_function_sseregparm): Likewise.
	(ix86_frame_pointer_required): Likewise.
	(ix86_select_alt_pic_regnum): Likewise.
	(ix86_save_reg):
	(ix86_expand_prologue):
	(x86_function_profiler):
	(TARGET_PROFILE_BEFORE_PROLOGUE): Define hook.
	* config/i386/i386.opt (mfentry): New.
	* doc/invoke.texi (mfentry): Add documentation.
	* doc/tm.texi: Regenerated..
	* doc/tm.texi.in (TARGET_PROFILE_BEFORE_PROLOGUE): New.
	* final.c (final_start_function): Replace macro
	PROFILE_BEFORE_PROLOGUE by target hook.
	* function.c (thread_prologue_and_epilogue_insns): Likewise.
	* target.def (profile_before_prologue): New hook.
	* targhooks.c (default_profile_before_prologue): New.
	* targhooks.h (default_profile_before_prologue): New.

Tested for i686-pc-mingw32, x86_64-pc-mingw32, and i686-pc-linux-gnu
to see if option check works. Ok for apply?

Regards,
Kai


-- 
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

Attachment: profileb.diff
Description: Binary data


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