From: David Malcolm Date: Mon, 15 Sep 2014 15:49:09 +0000 (+0000) Subject: The TARGET_CAN_FOLLOW_JUMP hook takes insns X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1ce59ab7fc8a5a55a2218ffa7e446ba655e5a6e;p=gcc.git The TARGET_CAN_FOLLOW_JUMP hook takes insns gcc/ChangeLog: * config/arc/arc.c (arc_can_follow_jump): Strengthen both params from const_rtx to const rtx_insn *. Update union members from rtx to rtx_insn *. * doc/tm.texi (TARGET_CAN_FOLLOW_JUMP): Autogenerated change. * hooks.c (hook_bool_const_rtx_const_rtx_true): Rename to... (hook_bool_const_rtx_insn_const_rtx_insn_true): ...this, and strengthen both params from const_rtx to const rtx_insn *. * hooks.h (hook_bool_const_rtx_const_rtx_true): Likewise. (hook_bool_const_rtx_insn_const_rtx_insn_true): Likewise. * reorg.c (follow_jumps): Strengthen param "jump" from rtx to rtx_insn *. * target.def (can_follow_jump): Strengthen both params from const_rtx to const rtx_insn *, and update default implementation from hook_bool_const_rtx_const_rtx_true to hook_bool_const_rtx_insn_const_rtx_insn_true. From-SVN: r215269 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4f9bd068b0..93f19406a46 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,21 @@ +2014-09-15 David Malcolm + + * config/arc/arc.c (arc_can_follow_jump): Strengthen both params + from const_rtx to const rtx_insn *. Update union members from rtx + to rtx_insn *. + * doc/tm.texi (TARGET_CAN_FOLLOW_JUMP): Autogenerated change. + * hooks.c (hook_bool_const_rtx_const_rtx_true): Rename to... + (hook_bool_const_rtx_insn_const_rtx_insn_true): ...this, and + strengthen both params from const_rtx to const rtx_insn *. + * hooks.h (hook_bool_const_rtx_const_rtx_true): Likewise. + (hook_bool_const_rtx_insn_const_rtx_insn_true): Likewise. + * reorg.c (follow_jumps): Strengthen param "jump" from rtx to + rtx_insn *. + * target.def (can_follow_jump): Strengthen both params from + const_rtx to const rtx_insn *, and update default implementation + from hook_bool_const_rtx_const_rtx_true to + hook_bool_const_rtx_insn_const_rtx_insn_true. + 2014-09-15 David Malcolm * sched-deps.c (deps_start_bb): Strengthen param "head" and local diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 2f08e7cf035..9dd19ded896 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -420,7 +420,8 @@ arc_vector_mode_supported_p (enum machine_mode mode) /* TARGET_PRESERVE_RELOAD_P is still awaiting patch re-evaluation / review. */ static bool arc_preserve_reload_p (rtx in) ATTRIBUTE_UNUSED; static rtx arc_delegitimize_address (rtx); -static bool arc_can_follow_jump (const_rtx follower, const_rtx followee); +static bool arc_can_follow_jump (const rtx_insn *follower, + const rtx_insn *followee); static rtx frame_insn (rtx); static void arc_function_arg_advance (cumulative_args_t, enum machine_mode, @@ -9214,10 +9215,10 @@ arc_decl_pretend_args (tree decl) to redirect two breqs. */ static bool -arc_can_follow_jump (const_rtx follower, const_rtx followee) +arc_can_follow_jump (const rtx_insn *follower, const rtx_insn *followee) { /* ??? get_attr_type is declared to take an rtx. */ - union { const_rtx c; rtx r; } u; + union { const rtx_insn *c; rtx_insn *r; } u; u.c = follower; if (CROSSING_JUMP_P (followee)) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 685c9b2126f..1a19dcd9b3b 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -10827,7 +10827,7 @@ filling of delay slots can result in branches being redirected, and this may in turn cause a branch offset to overflow. @end defmac -@deftypefn {Target Hook} bool TARGET_CAN_FOLLOW_JUMP (const_rtx @var{follower}, const_rtx @var{followee}) +@deftypefn {Target Hook} bool TARGET_CAN_FOLLOW_JUMP (const rtx_insn *@var{follower}, const rtx_insn *@var{followee}) FOLLOWER and FOLLOWEE are JUMP_INSN instructions; return true if FOLLOWER may be modified to follow FOLLOWEE; false, if it can't. For example, on some targets, certain kinds of branches can't be made to follow through a hot/cold partitioning. @end deftypefn diff --git a/gcc/hooks.c b/gcc/hooks.c index 3f1135472e3..6000b985133 100644 --- a/gcc/hooks.c +++ b/gcc/hooks.c @@ -116,10 +116,10 @@ hook_bool_mode_rtx_true (enum machine_mode mode ATTRIBUTE_UNUSED, return true; } -/* Generic hook that takes (rtx, rtx) and returns true. */ +/* Generic hook that takes (const rtx_insn *, const rtx_insn *) and returns true. */ bool -hook_bool_const_rtx_const_rtx_true (const_rtx follower ATTRIBUTE_UNUSED, - const_rtx followee ATTRIBUTE_UNUSED) +hook_bool_const_rtx_insn_const_rtx_insn_true (const rtx_insn *follower ATTRIBUTE_UNUSED, + const rtx_insn *followee ATTRIBUTE_UNUSED) { return true; } diff --git a/gcc/hooks.h b/gcc/hooks.h index 27ad09dd227..11811c2fece 100644 --- a/gcc/hooks.h +++ b/gcc/hooks.h @@ -36,7 +36,8 @@ extern bool hook_bool_mode_const_rtx_false (enum machine_mode, const_rtx); extern bool hook_bool_mode_const_rtx_true (enum machine_mode, const_rtx); extern bool hook_bool_mode_rtx_false (enum machine_mode, rtx); extern bool hook_bool_mode_rtx_true (enum machine_mode, rtx); -extern bool hook_bool_const_rtx_const_rtx_true (const_rtx, const_rtx); +extern bool hook_bool_const_rtx_insn_const_rtx_insn_true (const rtx_insn *, + const rtx_insn *); extern bool hook_bool_mode_uhwi_false (enum machine_mode, unsigned HOST_WIDE_INT); extern bool hook_bool_tree_false (tree); diff --git a/gcc/reorg.c b/gcc/reorg.c index 28401dda849..ee97927a6c2 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -2307,7 +2307,7 @@ fill_simple_delay_slots (int non_jumps_p) set *CROSSING to true, otherwise set it to false. */ static rtx -follow_jumps (rtx label, rtx jump, bool *crossing) +follow_jumps (rtx label, rtx_insn *jump, bool *crossing) { rtx_insn *insn; rtx_insn *next; diff --git a/gcc/target.def b/gcc/target.def index 3944507b098..752ef6bfea1 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -2278,8 +2278,8 @@ DEFHOOK false, if it can't.\ For example, on some targets, certain kinds of branches can't be made to\ follow through a hot/cold partitioning.", - bool, (const_rtx follower, const_rtx followee), - hook_bool_const_rtx_const_rtx_true) + bool, (const rtx_insn *follower, const rtx_insn *followee), + hook_bool_const_rtx_insn_const_rtx_insn_true) /* Return a register class for which branch target register optimizations should be applied. */