@@ -5299,6 +5299,11 @@ This hook should add additional registers that are computed by the prologue
to the hard regset for shrink-wrapping optimization purposes.
@end deftypefn
+@deftypefn {Target Hook} void TARGET_POST_EPILOGUE_PROC (rtx_insn *@var{})
+Define this hook if you have additional processing after epilogue is
+inserted into a basic block.
+@end deftypefn
+
@deftypefn {Target Hook} bool TARGET_WARN_FUNC_RETURN (tree)
True if a function's return statements should be checked for matching
the function's return type. This includes checking for falling off the end
@@ -3754,6 +3754,8 @@ the function prologue. Normally, the profiling code comes after.
@hook TARGET_SET_UP_BY_PROLOGUE
+@hook TARGET_POST_EPILOGUE_PROC
+
@hook TARGET_WARN_FUNC_RETURN
@node Shrink-wrapping separate components
@@ -6258,6 +6258,8 @@ thread_prologue_and_epilogue_insns (void)
}
}
+ targetm.post_epilogue_proc (epilogue_seq);
+
/* Threading the prologue and epilogue changes the artificial refs in the
entry and exit blocks, and may invalidate DF info for tail calls. */
if (optimize
@@ -501,6 +501,13 @@ hook_bool_rtx_insn_int_false (rtx_insn *, int)
return false;
}
+/* Generic hook that takes a rtx_insn * and returns void. */
+
+void
+hook_void_rtx_insn (rtx_insn *)
+{
+}
+
/* Generic hook that takes a rtx_insn * and an int and returns void. */
void
@@ -60,6 +60,7 @@ extern bool hook_bool_const_tree_hwi_hwi_const_tree_true (const_tree,
extern bool hook_bool_rtx_insn_true (rtx_insn *);
extern bool hook_bool_rtx_false (rtx);
extern bool hook_bool_rtx_insn_int_false (rtx_insn *, int);
+extern void hook_void_rtx_insn (rtx_insn *);
extern bool hook_bool_uintp_uintp_false (unsigned int *, unsigned int *);
extern bool hook_bool_reg_class_t_false (reg_class_t regclass);
extern bool hook_bool_mode_mode_reg_class_t_true (machine_mode, machine_mode,
@@ -6840,6 +6840,14 @@ to the hard regset for shrink-wrapping optimization purposes.",
void, (struct hard_reg_set_container *),
NULL)
+/* Post epilogue processing. */
+DEFHOOK
+(post_epilogue_proc,
+ "Define this hook if you have additional processing after epilogue is\n\
+inserted into a basic block.",
+ void, (rtx_insn *),
+ hook_void_rtx_insn)
+
/* For targets that have attributes that can affect whether a
function's return statements need checking. For instance a 'naked'
function attribute. */
Define TARGET_POST_EPILOGUE_PROC if you have additional processing after epilogue is inserted into a basic block. gcc/ChangeLog: * doc/tm.texi: Regenerate. * doc/tm.texi.in: Document TARGET_POST_EPILOGUE_PROC. * function.cc (thread_prologue_and_epilogue_insns): Allow targets to have additional processingafter epilogue is inserted into a basic block. * hooks.cc (hook_void_rtx_insn): Define default handler. * hooks.h (hook_void_rtx_insn): Declare. * target.def: New hook. Signed-off-by: Fei Gao <gaofei@eswincomputing.com> --- gcc/doc/tm.texi | 5 +++++ gcc/doc/tm.texi.in | 2 ++ gcc/function.cc | 2 ++ gcc/hooks.cc | 7 +++++++ gcc/hooks.h | 1 + gcc/target.def | 8 ++++++++ 6 files changed, 25 insertions(+)