diff options
author | Venkataramanan Kumar <venkataramanan.kumar@linaro.org> | 2013-09-30 10:20:11 +0000 |
---|---|---|
committer | Venkataramanan Kumar <vekumar@gcc.gnu.org> | 2013-09-30 10:20:11 +0000 |
commit | 92d649c492db02b2fa470a1762503120661d0431 (patch) | |
tree | 97448480f995d944ebfad3f72642eab40ef7c039 | |
parent | bd9534e28685da0b871cb3176727e110ee6b5dc2 (diff) | |
download | gcc-92d649c492db02b2fa470a1762503120661d0431.zip gcc-92d649c492db02b2fa470a1762503120661d0431.tar.gz gcc-92d649c492db02b2fa470a1762503120661d0431.tar.bz2 |
Function profiling macro support for Aarch64
From-SVN: r203028
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 7 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.h | 18 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 7 |
4 files changed, 24 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 552893a..7c79748 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2013-09-30 Venkataramanan Kumar <venkataramanan.kumar@linaro.org> + + * config/aarch64/aarch64.h (MCOUNT_NAME): Define. + (NO_PROFILE_COUNTERS): Likewise. + (PROFILE_HOOK): Likewise. + (FUNCTION_PROFILER): Likewise. + * config/aarch64/aarch64.c (aarch64_function_profiler): Remove. + 2013-09-30 Iain Sandoe <iain@codesourcery.com> * config/rs6000/darwin.md (load_macho_picbase_si): Wrap machopic diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 1558183..ee2cb4c 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3858,13 +3858,6 @@ aarch64_print_operand_address (FILE *f, rtx x) output_addr_const (f, x); } -void -aarch64_function_profiler (FILE *f ATTRIBUTE_UNUSED, - int labelno ATTRIBUTE_UNUSED) -{ - sorry ("function profiling"); -} - bool aarch64_label_mentioned_p (rtx x) { diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index d8012f8..da2b46d 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -783,8 +783,22 @@ do { \ #define PRINT_OPERAND_ADDRESS(STREAM, X) \ aarch64_print_operand_address (STREAM, X) -#define FUNCTION_PROFILER(STREAM, LABELNO) \ - aarch64_function_profiler (STREAM, LABELNO) +#define MCOUNT_NAME "_mcount" + +#define NO_PROFILE_COUNTERS 1 + +/* Emit rtl for profiling. Output assembler code to FILE + to call "_mcount" for profiling a function entry. */ +#define PROFILE_HOOK(LABEL) \ +{ \ + rtx fun,lr; \ + lr = get_hard_reg_initial_val (Pmode, LR_REGNUM); \ + fun = gen_rtx_SYMBOL_REF (Pmode, MCOUNT_NAME); \ + emit_library_call (fun, LCT_NORMAL, VOIDmode, 1, lr, Pmode); \ +} + +/* All the work done in PROFILE_HOOK, but still required. */ +#define FUNCTION_PROFILER(STREAM, LABELNO) do { } while (0) /* For some reason, the Linux headers think they know how to define these macros. They don't!!! */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 99784f9..f997031 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -494,13 +494,6 @@ proc check_profiling_available { test_what } { return 0 } - # We don't yet support profiling for AArch64. - if { [istarget aarch64*-*-*] - && ([lindex $test_what 1] == "-p" - || [lindex $test_what 1] == "-pg") } { - return 0 - } - # cygwin does not support -p. if { [istarget *-*-cygwin*] && $test_what == "-p" } { return 0 |