gcc/gcc Makefile.in bb-reorder.c c-common.c cf ...

ctice@gcc.gnu.org ctice@gcc.gnu.org
Wed Aug 18 16:22:00 GMT 2004


CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ctice@gcc.gnu.org	2004-08-18 16:22:09

Modified files:
	gcc            : Makefile.in bb-reorder.c c-common.c 
	                 cfgcleanup.c cfglayout.c cfgrtl.c defaults.h 
	                 final.c ifcvt.c opts.c output.h passes.c 
	                 predict.c reg-stack.c toplev.c toplev.h 
	                 varasm.c 
	gcc/config     : darwin.c 
	gcc/config/arm : pe.h 
	gcc/config/i386: cygming.h darwin.h 
	gcc/config/mcore: mcore.h 
	gcc/config/rs6000: darwin.h 

Log message:
	Hot/cold partitioning update patch.  The problems that this patch
	attemptd to address/fix are:
	
	- Fix places where adding in_unlikely_executed_text to the enum data
	type "in_section"  threw off switch case statements.
	- Make it work correctly (by turning it off) for functions where user
	specifies "__attribute__ section"
	- Make it work correctly (by turning it off) for linkonce sections
	- Make it work correctly with -ffunction-sections flag
	- Make it output correct cold section labels
	- Undo some changes to original assembly code generation
	- Turn off hot/cold partitioning in the presence of DWARF debugging (for
	the moment)
	- Turn off hot/cold partitioning for architectures that do not support
	named sections
	- Use variables rather than constants for cold section labels and names (to
	work correctly with -ffunction-sections, among other things)
	
	2004-08-18  Caroline Tice  <ctice@apple.com>
	
	* Makefile.in (STAGEFEEDBACK_FLAGS_TO_PASS) Add
	"-freorder-blocks-and-partition" to the flags used in second
	stage of profiledbootstrap.
	* bb-reorder.c (push_to_next_round_p): Add new variable,
	next_round_is_last; set and use variable to make sure, when
	partitioning, that the last trace construction round consists
	of all (and only) cold basic blocks.
	(rotate_loop): Don't copy blocks that end in a section
	crossing jump.
	(copy_bb): Correctly initialize "partition" of duplicated bb.
	(add_unlikely_executed_notes): Add a comment.
	(find_rarely_executed_basic_blocks_and_crossing_edges): Modify
	to make sure, if function contains hot blocks, that the
	successors of ENTRY_BLOCK_PTR are hot; also, only look for
	crossing edges if the architecture supports named sections.
	(mark_bb_for_unlikely_executed_section): Modify to always
	insert the NOTE_INSN_UNLIKELY_EXECUTED_CODE immediately after
	the basic block note insn.
	(fix_crossing_unconditional_branches): Remove extra space.
	(fix_edges_for_rarely_executed_code): Modify to only do
	partitioning work if the architecture supports named sections.
	(reorder_basic_blocks): Modify to only add
	NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture
	supports named sections.
	* c-common.c (handle_section_attribute): Initialize new global
	variable, user_defined_section_attribute, to true if user has
	specified one.
	* cfgcleanup.c (try_forward_edges): Modify to not attempt to
	forward edges that cross section boundaries.
	* cfglayout.c (fixup_reorder_chain): Modify to only fix up
	partitioning information if the architecture supports named
	sections.
	* cfgrtl.c (target.h): Add statement to include this.
	(rtl_split_block): Make sure newly created bb gets correct
	partition.
	(try_redirect_by_replacing_jump): Make sure redirection isn't
	attempting to cross section boundaries.
	(force_nonfallthru_and_redirect): Only do partition fix up if
	architecture supports named sections.
	(rtl_split_edge): Make sure newly created bb ends up in
	correct partition.
	(commit_one_edge_insertion): Remove code that incorrectly
	updated basic block partition; Make sure partition fix up only
	happens if architecture supports named sections and it's not
	already done.
	(rtl_verify_flow_info_1): Fix if-condition on test/error
	condition that fallthru edges are not allowed to cross section
	boundaries.
	* defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this.
	* final.c (final_scan_insn): Remove redundant test from if-statement;
	change calls to text_section into calls to function_section; add code
	to only to partitioning fix up if architecture supports named
	sections.
	* ifcvt.c (find_if_case_1): Make sure newly created bb has correct
	partition.
	(if_convert): Add targetm.have_named_sections to test.
	* output.h (unlikely_section_label): Extern declaration for new global
	variable.
	(unlikely_text_section_name): Likewise.
	* opts.c (decode_options): If both partitioning and DWARF debugging
	are turned on, issue a warning that this doesn't work, and change
	partitiong to basic block reordering (without hot/cold partitions).
	* passes.c (rest_of_handle_final): Re-set new global variable,
	user_defined_section_attribute, to false.
	(rest_of_compilation): Change options for calling partitioning
	function: Don't call if the user defined the section attribute, and
	don't call if DECL_ONE_ONLY is true for the current function.
	* predict.c (choose_function_section): Return immediately if we
	are doing hot/cold partitioning (i.e. let the basic block partitioning
	determine where the function belongs).
	* reg-stack.c (emit_swap_insn): Add condition to step over
	NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
	* toplev.c (user_defined_section_attribute): New global variable.
	* toplev.h (user_defined_section_attribute): Extern declaration for new
	global variable.
	* varasm.c (unlikely_section_label): New global variable.
	(unlikely_text_section_name): New global variable.
	(unlikely_text_section): Add code to initialize unlikely_text_section_name
	if necessary; modify to use unlikely_text_section_name and
	unlikely_section_label; also to use named_section properly.
	(in_unlikely_text_section):  Modify to work correctly with named_section
	and to use unlikely_text_section_name.
	(named_section):  Add code to work properly with cold section.
	(function_section): Clean up if-statement.
	* config/darwin.c (darwin_asm_named_section): Return to original code,
	removing use of SECTION_FORMAT_STRING.
	* config/arm/pe.h (switch_to_section):  Add case for
	in_unlikely_executed_text to switch statement.
	* config/i386/cygming.h (switch_to_section): Likewise.
	* config/i386/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove.
	(SECTION_FORMAT_STRING): Likewise.
	* config/mcore/mcore.h (switch_to_section): Likewise.
	* config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.1349&r2=1.1350
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/bb-reorder.c.diff?cvsroot=gcc&r1=1.77&r2=1.78
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-common.c.diff?cvsroot=gcc&r1=1.554&r2=1.555
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfgcleanup.c.diff?cvsroot=gcc&r1=1.123&r2=1.124
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfglayout.c.diff?cvsroot=gcc&r1=1.68&r2=1.69
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cfgrtl.c.diff?cvsroot=gcc&r1=1.126&r2=1.127
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/defaults.h.diff?cvsroot=gcc&r1=1.147&r2=1.148
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/final.c.diff?cvsroot=gcc&r1=1.327&r2=1.328
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ifcvt.c.diff?cvsroot=gcc&r1=1.159&r2=1.160
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/opts.c.diff?cvsroot=gcc&r1=1.75&r2=1.76
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/output.h.diff?cvsroot=gcc&r1=1.143&r2=1.144
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/passes.c.diff?cvsroot=gcc&r1=2.36&r2=2.37
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/predict.c.diff?cvsroot=gcc&r1=1.110&r2=1.111
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reg-stack.c.diff?cvsroot=gcc&r1=1.160&r2=1.161
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.c.diff?cvsroot=gcc&r1=1.911&r2=1.912
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/toplev.h.diff?cvsroot=gcc&r1=1.127&r2=1.128
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/varasm.c.diff?cvsroot=gcc&r1=1.442&r2=1.443
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/darwin.c.diff?cvsroot=gcc&r1=1.77&r2=1.78
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/arm/pe.h.diff?cvsroot=gcc&r1=1.27&r2=1.28
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/cygming.h.diff?cvsroot=gcc&r1=1.18&r2=1.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/darwin.h.diff?cvsroot=gcc&r1=1.19&r2=1.20
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mcore/mcore.h.diff?cvsroot=gcc&r1=1.68&r2=1.69
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/darwin.h.diff?cvsroot=gcc&r1=1.57&r2=1.58



More information about the Gcc-cvs mailing list