diff options
author | phk <phk@FreeBSD.org> | 1995-03-10 08:24:09 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-03-10 08:24:09 +0000 |
commit | f41b04b4adcca9753b24561cdc22cc8bc4bcc5f9 (patch) | |
tree | d1469e2bff7fc921d6104ea6c2997dcc10af9797 | |
parent | d918180488f764caecc5afb2d10b8b262d230d41 (diff) | |
download | FreeBSD-src-f41b04b4adcca9753b24561cdc22cc8bc4bcc5f9.zip FreeBSD-src-f41b04b4adcca9753b24561cdc22cc8bc4bcc5f9.tar.gz |
Since we are in the gcc bashing mood anyway: Add two changes for
basic-block profiling:
1. use a .stabs(25) symbol to link all the data structures together with.
The regular method isn't safe for the kernel.
2. add a BB before the prologue and add a BB after the epilogue, this
alows us to find the length of any counted BB. This is a cheap and somewhat
reasonable measure of actual cost.
-rw-r--r-- | gnu/usr.bin/cc/cc_int/final.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gnu/usr.bin/cc/cc_int/final.c b/gnu/usr.bin/cc/cc_int/final.c index b1f4e87..157510a 100644 --- a/gnu/usr.bin/cc/cc_int/final.c +++ b/gnu/usr.bin/cc/cc_int/final.c @@ -333,6 +333,8 @@ end_final (filename) ASM_OUTPUT_ALIGN (asm_out_file, align); + fprintf(asm_out_file,".stabs \"bbset\", 25, 0, 0, LPBX0\n"); + ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LPBX", 0); /* zero word */ assemble_integer (const0_rtx, UNITS_PER_WORD, 1); @@ -902,6 +904,8 @@ final_start_function (first, file, optimize) /* The Sun386i and perhaps other machines don't work right if the profiling code comes after the prologue. */ + if (profile_block_flag) + add_bb (file); #ifdef PROFILE_BEFORE_PROLOGUE if (profile_flag) profile_function (file); @@ -1055,6 +1059,9 @@ final_end_function (first, file, optimize) code to restore the stack frame and return to the caller. */ FUNCTION_EPILOGUE (file, get_frame_size ()); #endif + if (profile_block_flag) + add_bb (file); + #ifdef SDB_DEBUGGING_INFO if (write_symbols == SDB_DEBUG) |