diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-06 11:49:46 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-06 11:49:46 +0000 |
commit | 644a1400dd90ba913e76cf72b192e2eeba4186b1 (patch) | |
tree | 487983e5d02cf99f65e621df94291838c8f26701 /gcc/final.c | |
parent | 7b479d17d11c0f8d769a1d53a49fdaa4ec0a6db9 (diff) | |
download | gcc-644a1400dd90ba913e76cf72b192e2eeba4186b1.tar.gz |
* final.c (count_basic_block, add_bb, add_bb_string):
Kill.
(end_final, final_start_function, final, final_scan_insn,
leaf_function_p): Kill BB profiler related code.
* flags.h (profile_block_flag): Kill.
* libgcc2.c (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE,
BB_BUCKETS, BBINBUFSIZE, bb_edge, bb_func_mode, bb_func,
__bb, bb_src, bb_dst, bb_tracefile, bb_hashbuckets,
bb_func_head, bb_callcount, bb_mode, bb_stack, bb_stacksize
reported, GOPENDECOMPRESS, GOPENCOMPRESS, gopen, gclose,
__bb_exit_trace_func, __bb_init_prg, __bb_trace_func,
__bb_trace_func_ret, __bb_init_file, __bb_trace_ret,
__bb_init_trace_func): Kill.
* toplev.c (profile_block_flag): Kill.
(indepdendent_decode_option, process_options): Kill -a related code.
* alpha.c (direct_call_operand): Likewise.
* arm.c (arm_expand_prologue, thumb_expand_prologue,
thumb_expand_epilogue): Likewise.
* c4x.c (c4x_expand_prologue, c4x_null_epilogue_p): Likewise.
* c4x.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* d30v.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* fr30.c (fr30_expand_prologue): Kill BB profiler related code.
* i386.c (ix86_can_use_return_insn_p, ix86_expand_prologue,
ix86_expand_epilogue, ix86_expand_epilogue): Kill BB profiler related
code.
(ix86_output_function_block_profiler, ix86_output_block_profiler): Kill.
* i386.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* fr30.c (fr30_expand_prologue): Kill BB profiler related code.
* i960.c (i960_output_function_prologue): Kill BB profiler related
code.
* ia64.c (ia64_compute_frame_size): Likewise.
* ia64.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* m32r.c (m32r_expand_prolofue): Kill BB profiler related code.
* m68hc11.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* m68k.c (m68k_output_function_epilogue): Kill BB profiler related code.
* m68k.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* m88k.c (output_options, m88k_layout_frame, m88k_expand_prologue):
Kill BB profiler related code.
* m88k.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* mips.c (mips_expand_prologue): Kill BB profiler related code.
* mmix.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* rs6000.c (rs6000_override_options): Kill BB profiler related code.
* s960.c (s390_function_prologue): Kill BB profiler related code.
* s960.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* linux-aout.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill.
* linux.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill.
* linux64.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill.
* sol2.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill.
* sparc.c (sparc_override_options, eligible_for_sibcall_delay,
sparc_nonflat_function_epilogue): Kill BB profiler related code.
(sparc_function_block_profiler, sparc_block_profiler,
sparc_function_block_profiler_exit): Kill.
* sparc.h (OVERRIDE_OPTIONS): Kill BB profiler related code.
(FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* sun4o3.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill.
* sunos4.h (MACHINE_STATE_SAVE, MACHINE_STATE_RESTORE): Kill.
* stormy16.h (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
* doc/invoke.texi: Kill documentation of -a and -ax.
* tm.texi (FUNCTION_BLOCK_PROFILER, BLOCK_PROFILER,
FUNCTION_BLOCK_PROFILER_EXIT, MACHINE_STATE_SAVE,
MACHINE_STATE_RESTORE): Kill.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47712 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 294 |
1 files changed, 10 insertions, 284 deletions
diff --git a/gcc/final.c b/gcc/final.c index fc93d83ba79..9725c0ba078 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -114,10 +114,6 @@ static int high_function_linenum; /* Filename of last NOTE. */ static const char *last_filename; -/* Number of basic blocks seen so far; - used if profile_block_flag is set. */ -static int count_basic_blocks; - /* Number of instrumented arcs when profile_arc_flag is set. */ extern int count_instrumented_edges; @@ -240,8 +236,6 @@ static int asm_insn_count PARAMS ((rtx)); #endif static void profile_function PARAMS ((FILE *)); static void profile_after_prologue PARAMS ((FILE *)); -static void add_bb PARAMS ((FILE *)); -static int add_bb_string PARAMS ((const char *, int)); static void notice_source_line PARAMS ((rtx)); static rtx walk_alter_subreg PARAMS ((rtx *)); static void output_asm_name PARAMS ((void)); @@ -284,7 +278,7 @@ end_final (filename) { int i; - if (profile_block_flag || profile_arc_flag) + if (profile_arc_flag) { char name[20]; int align = exact_log2 (BIGGEST_ALIGNMENT / BITS_PER_UNIT); @@ -296,10 +290,7 @@ end_final (filename) int pointer_bytes = POINTER_SIZE / BITS_PER_UNIT; unsigned int align2 = LONG_TYPE_SIZE; - if (profile_block_flag) - size = long_bytes * count_basic_blocks; - else - size = gcov_type_bytes * count_instrumented_edges; + size = gcov_type_bytes * count_instrumented_edges; rounded = size; rounded += (BIGGEST_ALIGNMENT / BITS_PER_UNIT) - 1; @@ -347,53 +338,24 @@ end_final (filename) assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), pointer_bytes, align2, 1); - /* Count of the # of basic blocks or # of instrumented arcs. */ - assemble_integer (GEN_INT (profile_block_flag - ? count_basic_blocks - : count_instrumented_edges), + /* Count of the # of instrumented arcs. */ + assemble_integer (GEN_INT (count_instrumented_edges), long_bytes, align2, 1); /* Zero word (link field). */ assemble_integer (const0_rtx, pointer_bytes, align2, 1); - /* address of basic block start address table */ - if (profile_block_flag) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } - else - assemble_integer (const0_rtx, pointer_bytes, align2, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); /* Byte count for extended structure. */ assemble_integer (GEN_INT (11 * UNITS_PER_WORD), long_bytes, align2, 1); /* Address of function name table. */ - if (profile_block_flag) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 4); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } - else - assemble_integer (const0_rtx, pointer_bytes, align2, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); /* Address of line number and filename tables if debugging. */ - if (write_symbols != NO_DEBUG && profile_block_flag) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 5); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 6); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } - else - { - assemble_integer (const0_rtx, pointer_bytes, align2, 1); - assemble_integer (const0_rtx, pointer_bytes, align2, 1); - } + assemble_integer (const0_rtx, pointer_bytes, align2, 1); + assemble_integer (const0_rtx, pointer_bytes, align2, 1); /* Space for extension ptr (link field). */ assemble_integer (const0_rtx, UNITS_PER_WORD, align2, 1); @@ -410,10 +372,7 @@ end_final (filename) strcat (data_file, "/"); strcat (data_file, filename); strip_off_ending (data_file, len); - if (profile_block_flag) - strcat (data_file, ".d"); - else - strcat (data_file, ".da"); + strcat (data_file, ".da"); assemble_string (data_file, strlen (data_file) + 1); } @@ -446,95 +405,6 @@ end_final (filename) #endif #endif } - - /* Output any basic block strings */ - if (profile_block_flag) - { - readonly_data_section (); - if (sbb_head) - { - ASM_OUTPUT_ALIGN (asm_out_file, align); - for (sptr = sbb_head; sptr != 0; sptr = sptr->next) - { - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBC", - sptr->label_num); - assemble_string (sptr->string, sptr->length); - } - } - } - - /* Output the table of addresses. */ - if (profile_block_flag) - { - /* Realign in new section */ - ASM_OUTPUT_ALIGN (asm_out_file, align); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 3); - for (i = 0; i < count_basic_blocks; i++) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPB", i); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } - } - - /* Output the table of function names. */ - if (profile_block_flag) - { - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 4); - for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++) - { - if (ptr->func_label_num >= 0) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", - ptr->func_label_num); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } - else - assemble_integer (const0_rtx, pointer_bytes, align2, 1); - } - - for (; i < count_basic_blocks; i++) - assemble_integer (const0_rtx, pointer_bytes, align2, 1); - } - - if (write_symbols != NO_DEBUG && profile_block_flag) - { - /* Output the table of line numbers. */ - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 5); - for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++) - assemble_integer (GEN_INT (ptr->line_num), long_bytes, align2, 1); - - for (; i < count_basic_blocks; i++) - assemble_integer (const0_rtx, long_bytes, align2, 1); - - /* Output the table of file names. */ - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 6); - for ((ptr = bb_head), (i = 0); ptr != 0; (ptr = ptr->next), i++) - { - if (ptr->file_label_num >= 0) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPBC", - ptr->file_label_num); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } - else - assemble_integer (const0_rtx, pointer_bytes, align2, 1); - } - - for (; i < count_basic_blocks; i++) - assemble_integer (const0_rtx, pointer_bytes, align2, 1); - } - - /* End with the address of the table of addresses, - so we can find it easily, as the last word in the file's text. */ - if (profile_block_flag) - { - ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); - assemble_integer (gen_rtx_SYMBOL_REF (Pmode, name), - pointer_bytes, align2, 1); - } } } @@ -1729,28 +1599,12 @@ final_start_function (first, file, optimize) profile_after_prologue (file); profile_label_no++; - - /* If we are doing basic block profiling, remember a printable version - of the function name. */ - if (profile_block_flag) - { - bb_func_label_num = - add_bb_string ((*decl_printable_name) (current_function_decl, 2), - FALSE); - } } static void profile_after_prologue (file) FILE *file ATTRIBUTE_UNUSED; { -#ifdef FUNCTION_BLOCK_PROFILER - if (profile_block_flag) - { - FUNCTION_BLOCK_PROFILER (file, count_basic_blocks); - } -#endif /* FUNCTION_BLOCK_PROFILER */ - #ifndef PROFILE_BEFORE_PROLOGUE if (profile_flag) profile_function (file); @@ -1860,89 +1714,6 @@ final_end_function () bb_func_label_num = -1; /* not in function, nuke label # */ } -/* Add a block to the linked list that remembers the current line/file/function - for basic block profiling. Emit the label in front of the basic block and - the instructions that increment the count field. */ - -static void -add_bb (file) - FILE *file; -{ - struct bb_list *ptr = - (struct bb_list *) permalloc (sizeof (struct bb_list)); - - /* Add basic block to linked list. */ - ptr->next = 0; - ptr->line_num = last_linenum; - ptr->file_label_num = bb_file_label_num; - ptr->func_label_num = bb_func_label_num; - *bb_tail = ptr; - bb_tail = &ptr->next; - - /* Enable the table of basic-block use counts - to point at the code it applies to. */ - ASM_OUTPUT_INTERNAL_LABEL (file, "LPB", count_basic_blocks); - - /* Before first insn of this basic block, increment the - count of times it was entered. */ -#ifdef BLOCK_PROFILER - BLOCK_PROFILER (file, count_basic_blocks); -#endif -#ifdef HAVE_cc0 - CC_STATUS_INIT; -#endif - - new_block = 0; - count_basic_blocks++; -} - -/* Add a string to be used for basic block profiling. */ - -static int -add_bb_string (string, perm_p) - const char *string; - int perm_p; -{ - int len; - struct bb_str *ptr = 0; - - if (!string) - { - string = "<unknown>"; - perm_p = TRUE; - } - - /* Allocate a new string if the current string isn't permanent. If - the string is permanent search for the same string in other - allocations. */ - - len = strlen (string) + 1; - if (!perm_p) - { - char *p = (char *) permalloc (len); - memcpy (p, string, len); - string = p; - } - else - for (ptr = sbb_head; ptr != (struct bb_str *) 0; ptr = ptr->next) - if (ptr->string == string) - break; - - /* Allocate a new string block if we need to. */ - if (!ptr) - { - ptr = (struct bb_str *) permalloc (sizeof (*ptr)); - ptr->next = 0; - ptr->length = len; - ptr->label_num = sbb_label_num++; - ptr->string = string; - *sbb_tail = ptr; - sbb_tail = &ptr->next; - } - - return ptr->label_num; -} - /* Output assembler code for some insns: all or part of a function. For description of args, see `final_start_function', above. @@ -2051,11 +1822,6 @@ final (first, file, optimize, prescan) insn = final_scan_insn (insn, file, optimize, prescan, 0); } - /* Do basic-block profiling here - if the last insn was a conditional branch. */ - if (profile_block_flag && new_block) - add_bb (file); - free (line_note_exists); line_note_exists = NULL; } @@ -2490,11 +2256,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) break; } - /* Do basic-block profiling when we reach a new block. - Done here to avoid jump tables. */ - if (profile_block_flag && new_block) - add_bb (file); - if (GET_CODE (body) == ASM_INPUT) { const char *string = XSTR (body, 0); @@ -2601,22 +2362,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) { CC_STATUS_INIT; } - - /* Following a conditional branch sequence, we have a new basic - block. */ - if (profile_block_flag) - { - rtx insn = XVECEXP (body, 0, 0); - rtx body = PATTERN (insn); - - if ((GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET - && GET_CODE (SET_SRC (body)) != LABEL_REF) - || (GET_CODE (insn) == JUMP_INSN - && GET_CODE (body) == PARALLEL - && GET_CODE (XVECEXP (body, 0, 0)) == SET - && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF)) - new_block = 1; - } break; } @@ -2675,17 +2420,6 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) } #endif - /* Following a conditional branch, we have a new basic block. - But if we are inside a sequence, the new block starts after the - last insn of the sequence. */ - if (profile_block_flag && final_sequence == 0 - && ((GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == SET - && GET_CODE (SET_SRC (body)) != LABEL_REF) - || (GET_CODE (insn) == JUMP_INSN && GET_CODE (body) == PARALLEL - && GET_CODE (XVECEXP (body, 0, 0)) == SET - && GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) != LABEL_REF))) - new_block = 1; - #ifndef STACK_REGS /* Don't bother outputting obvious no-ops, even without -O. This optimization is fast and doesn't interfere with debugging. @@ -2990,14 +2724,6 @@ notice_source_line (insn) { const char *filename = NOTE_SOURCE_FILE (insn); - /* Remember filename for basic block profiling. - Filenames are allocated on the permanent obstack - or are passed in ARGV, so we don't have to save - the string. */ - - if (profile_block_flag && last_filename != filename) - bb_file_label_num = add_bb_string (filename, TRUE); - last_filename = filename; last_linenum = NOTE_LINE_NUMBER (insn); high_block_linenum = MAX (last_linenum, high_block_linenum); @@ -4123,7 +3849,7 @@ leaf_function_p () rtx insn; rtx link; - if (profile_flag || profile_block_flag || profile_arc_flag) + if (profile_flag || profile_arc_flag) return 0; for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) |