* [MIPS] RFA: Use new rtl iterators in mips_sim_wait_regs_1
@ 2014-10-25 9:40 Richard Sandiford
2014-10-25 20:55 ` Matthew Fortune
0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2014-10-25 9:40 UTC (permalink / raw)
To: gcc-patches; +Cc: clm, matthew.fortune
This is part of a series to remove uses of for_each_rtx from the ports.
Tested by making sure there were no code changes for gcc.dg, gcc.c-torture
and g++.dg for mips64-elf. OK to install?
Thanks,
Richard
gcc/
* config/mips/mips.c (mips_sim_insn): Update comment.
(mips_sim_wait_regs_2): Delete.
(mips_sim_wait_regs_1): Use FOR_EACH_SUBRTX_VAR.
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c 2014-10-25 09:51:21.129845072 +0100
+++ gcc/config/mips/mips.c 2014-10-25 09:51:21.522848575 +0100
@@ -15468,7 +15468,7 @@ mips_annotate_pic_calls (void)
}
}
\f
-/* A temporary variable used by for_each_rtx callbacks, etc. */
+/* A temporary variable used by note_uses callbacks, etc. */
static rtx_insn *mips_sim_insn;
/* A structure representing the state of the processor pipeline.
@@ -15562,23 +15562,16 @@ mips_sim_wait_reg (struct mips_sim *stat
}
}
-/* A for_each_rtx callback. If *X is a register, advance simulation state
- DATA until mips_sim_insn can read the register's value. */
-
-static int
-mips_sim_wait_regs_2 (rtx *x, void *data)
-{
- if (REG_P (*x))
- mips_sim_wait_reg ((struct mips_sim *) data, mips_sim_insn, *x);
- return 0;
-}
-
-/* Call mips_sim_wait_regs_2 (R, DATA) for each register R mentioned in *X. */
+/* A note_uses callback. For each register in *X, advance simulation
+ state DATA until mips_sim_insn can read the register's value. */
static void
mips_sim_wait_regs_1 (rtx *x, void *data)
{
- for_each_rtx (x, mips_sim_wait_regs_2, data);
+ subrtx_var_iterator::array_type array;
+ FOR_EACH_SUBRTX_VAR (iter, array, *x, NONCONST)
+ if (REG_P (*iter))
+ mips_sim_wait_reg ((struct mips_sim *) data, mips_sim_insn, *iter);
}
/* Advance simulation state STATE until all of INSN's register
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [MIPS] RFA: Use new rtl iterators in mips_sim_wait_regs_1
2014-10-25 9:40 [MIPS] RFA: Use new rtl iterators in mips_sim_wait_regs_1 Richard Sandiford
@ 2014-10-25 20:55 ` Matthew Fortune
0 siblings, 0 replies; 2+ messages in thread
From: Matthew Fortune @ 2014-10-25 20:55 UTC (permalink / raw)
To: Richard Sandiford, gcc-patches; +Cc: clm
> gcc/
> * config/mips/mips.c (mips_sim_insn): Update comment.
> (mips_sim_wait_regs_2): Delete.
> (mips_sim_wait_regs_1): Use FOR_EACH_SUBRTX_VAR.
OK
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-25 20:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-25 9:40 [MIPS] RFA: Use new rtl iterators in mips_sim_wait_regs_1 Richard Sandiford
2014-10-25 20:55 ` Matthew Fortune
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).