* reorg.c (label_before_next_insn): New function.
(relax_delay_slots): Use it instead of prev_label.
* rtl.h (prev_label): Delete declaration.
* emit-rtl.c (prev_label): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180674
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-10-30 David S. Miller <davem@davemloft.net>
+
+ * reorg.c (label_before_next_insn): New function.
+ (relax_delay_slots): Use it instead of prev_label.
+ * rtl.h (prev_label): Delete declaration.
+ * emit-rtl.c (prev_label): Remove.
+
2011-10-30 Revital Eres <revital.eres@linaro.org>
* modulo-sched.c (generate_prolog_epilog): Mark prolog and epilog
return insn;
}
-/* Return the last CODE_LABEL before the insn INSN, or 0 if there is none. */
-
-rtx
-prev_label (rtx insn)
-{
- while (insn)
- {
- insn = PREV_INSN (insn);
- if (insn == 0 || LABEL_P (insn))
- break;
- }
-
- return insn;
-}
-
/* Return the last label to mark the same position as LABEL. Return LABEL
itself if it is null or any return rtx. */
delete_computation (insn);
}
+static rtx
+label_before_next_insn (rtx x, rtx scan_limit)
+{
+ rtx insn = next_active_insn (x);
+ while (insn)
+ {
+ insn = PREV_INSN (insn);
+ if (insn == scan_limit || insn == NULL_RTX)
+ return NULL_RTX;
+ if (LABEL_P (insn))
+ break;
+ }
+ return insn;
+}
+
\f
/* Once we have tried two ways to fill a delay slot, make a pass over the
code to try to improve the results and to do such things as more jump
identical to the one in its delay slot. In this case, we can just
delete the branch and the insn in its delay slot. */
if (next && NONJUMP_INSN_P (next)
- && prev_label (next_active_insn (next)) == target_label
+ && label_before_next_insn (next, insn) == target_label
&& simplejump_p (insn)
&& XVECLEN (pat, 0) == 2
&& rtx_equal_p (PATTERN (next), PATTERN (XVECEXP (pat, 0, 1))))
extern rtx prev_active_insn (rtx);
extern rtx next_active_insn (rtx);
extern int active_insn_p (const_rtx);
-extern rtx prev_label (rtx);
extern rtx next_label (rtx);
extern rtx skip_consecutive_labels (rtx);
extern rtx next_cc0_user (rtx);