From 21ffb9589ebd03e7d6e0b6f2d14bb3c437cc9b6f Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Sun, 26 Oct 2014 10:40:52 +0000 Subject: [PATCH] mep.c (mep_mul_hilo_bypass_1): Delete. gcc/ * config/mep/mep.c (mep_mul_hilo_bypass_1): Delete. (mep_mul_hilo_bypass_p): Use FOR_EACH_SUBRTX. From-SVN: r216706 --- gcc/ChangeLog | 5 +++++ gcc/config/mep/mep.c | 27 +++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 055cc20616a..d3aecdef5ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-10-26 Richard Sandiford + + * config/mep/mep.c (mep_mul_hilo_bypass_1): Delete. + (mep_mul_hilo_bypass_p): Use FOR_EACH_SUBRTX. + 2014-10-26 Richard Sandiford * config/mep/mep.c (mep_store_find_set): Take a const_rtx and diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c index b503afff533..838f88b89b1 100644 --- a/gcc/config/mep/mep.c +++ b/gcc/config/mep/mep.c @@ -6710,18 +6710,6 @@ mep_store_data_bypass_p (rtx_insn *prev, rtx_insn *insn) return INSN_P (insn) ? mep_store_data_bypass_1 (prev, PATTERN (insn)) : false; } -/* A for_each_rtx subroutine of mep_mul_hilo_bypass_p. Return 1 if *X - is a register other than LO or HI and if PREV sets *X. */ - -static int -mep_mul_hilo_bypass_1 (rtx *x, void *prev) -{ - return (REG_P (*x) - && REGNO (*x) != LO_REGNO - && REGNO (*x) != HI_REGNO - && reg_set_p (*x, (const_rtx) prev)); -} - /* Return true if, apart from HI/LO, there are no true dependencies between multiplication instructions PREV and INSN. */ @@ -6733,8 +6721,19 @@ mep_mul_hilo_bypass_p (rtx_insn *prev, rtx_insn *insn) pat = PATTERN (insn); if (GET_CODE (pat) == PARALLEL) pat = XVECEXP (pat, 0, 0); - return (GET_CODE (pat) == SET - && !for_each_rtx (&SET_SRC (pat), mep_mul_hilo_bypass_1, prev)); + if (GET_CODE (pat) != SET) + return false; + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, SET_SRC (pat), NONCONST) + { + const_rtx x = *iter; + if (REG_P (x) + && REGNO (x) != LO_REGNO + && REGNO (x) != HI_REGNO + && reg_set_p (x, prev)) + return false; + } + return true; } /* Return true if INSN is an ldc instruction that issues to the -- 2.30.2