Commit 1c7a8112 by Alan Modra Committed by Alan Modra

Rewrite hppa profiling support.

	* config/pa/pa.c (override_options): Remove PIC profiling warning.
	(hp_profile_labelno): Delete.
	(hp_profile_label_rtx): Delete.
	(hp_profile_label_name): Delete.
	(pa_add_gc_roots): Remove reference to hp_profile_label_rtx.
	(output_function_prologue): Remove profiling code and all tests on
	profile_flag.  Move store of PIC_OFFSET_TABLE_REGNUM now that
	merge_sp_adjust_with_store can work for PIC and profiling.
	(hppa_expand_epilogue): Remove profile_flag test.
	(hppa_can_use_return_insn_p): Likewise.
	(hppa_init_pic_save): Emit before tail_recursion_reentry, and
	cater for PROFILE_HOOK.
	(hppa_profile_hook): New function.
	* config/pa/pa.h (FUNCTION_PROFILER): Now does nothing.
	(PROFILE_HOOK): Define.
	(hppa_profile_hook): Declare.
	(PROFILE_BEFORE_PROLOGUE): Delete.
	(ASM_OUTPUT_REG_PUSH): Delete.
	(ASM_OUTPUT_REG_POP): Delete.
	* config/pa/pa.md (call_profiler): Turn it into a call insn, and
	don't `use' r24.  Accept function name operand, and use this and a
	locally generated label to calculate pc-rel offset to func start.

From-SVN: r41038
parent fe01b88e
2001-04-03 Alan Modra <alan@linuxcare.com.au>
* config/pa/pa.c (override_options): Remove PIC profiling warning.
(hp_profile_labelno): Delete.
(hp_profile_label_rtx): Delete.
(hp_profile_label_name): Delete.
(pa_add_gc_roots): Remove reference to hp_profile_label_rtx.
(output_function_prologue): Remove profiling code and all tests on
profile_flag. Move store of PIC_OFFSET_TABLE_REGNUM now that
merge_sp_adjust_with_store can work for PIC and profiling.
(hppa_expand_epilogue): Remove profile_flag test.
(hppa_can_use_return_insn_p): Likewise.
(hppa_init_pic_save): Emit before tail_recursion_reentry, and
cater for PROFILE_HOOK.
(hppa_profile_hook): New function.
* config/pa/pa.h (FUNCTION_PROFILER): Now does nothing.
(PROFILE_HOOK): Define.
(hppa_profile_hook): Declare.
(PROFILE_BEFORE_PROLOGUE): Delete.
(ASM_OUTPUT_REG_PUSH): Delete.
(ASM_OUTPUT_REG_POP): Delete.
* config/pa/pa.md (call_profiler): Turn it into a call insn, and
don't `use' r24. Accept function name operand, and use this and a
locally generated label to calculate pc-rel offset to func start.
2001-04-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* $(HOST_PREFIX_1)errors.o, $(HOST_PREFIX_1)ggc-none.o,
......
......@@ -883,16 +883,13 @@ extern enum cmp_type hppa_branch_type;
#define FUNCTION_PROLOGUE(FILE, SIZE) \
output_function_prologue (FILE, SIZE)
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry.
/* On HPPA, we emit profiling code as rtl via PROFILE_HOOK rather than
as assembly via FUNCTION_PROFILER. */
Because HPUX _mcount is so different, we actually emit the
profiling code in function_prologue. This just stores LABELNO for
that. */
#define FUNCTION_PROFILER(FILE, LABEL) /* nothing */
#define PROFILE_BEFORE_PROLOGUE
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ extern int hp_profile_labelno; hp_profile_labelno = (LABELNO);}
#define PROFILE_HOOK(label_no) hppa_profile_hook (label_no)
void hppa_profile_hook PARAMS ((int label_no));
/* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
the stack pointer does not matter. The value is tested only in
......@@ -1834,8 +1831,6 @@ while (0)
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii ((FILE), (P), (SIZE))
#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)
#define ASM_OUTPUT_REG_POP(FILE,REGNO)
/* This is how to output an element of a case-vector that is absolute.
Note that this method makes filling these branch delay slots
impossible. */
......
......@@ -5513,10 +5513,28 @@
;; from within its delay slot to set the value for the 2nd parameter to
;; the call.
(define_insn "call_profiler"
[(unspec_volatile [(const_int 0)] 0)
(use (match_operand:SI 0 "const_int_operand" ""))]
[(call (mem:SI (match_operand 0 "call_operand_address" ""))
(match_operand 1 "" ""))
(use (match_operand 2 "" ""))
(use (reg:SI 25))
(use (reg:SI 26))
(clobber (reg:SI 2))]
""
"{bl|b,l} _mcount,%%r2\;ldo %0(%%r2),%%r25"
"*
{
rtx xoperands[3];
output_arg_descriptor (insn);
xoperands[0] = operands[0];
xoperands[1] = operands[2];
xoperands[2] = gen_label_rtx ();
output_asm_insn (\"{bl|b,l} %0,%%r2\;ldo %1-%2(%%r2),%%r25\", xoperands);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
CODE_LABEL_NUMBER (xoperands[2]));
return \"\";
}"
[(set_attr "type" "multi")
(set_attr "length" "8")])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment