summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-12 02:14:39 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2017-12-12 02:14:39 +0000
commit18fc635703209d1a4ab2d9544c0f7b946e3c4c04 (patch)
tree9d5d5fdef4e1b78d7b24169be239f455f6e72a50 /gcc/emit-rtl.c
parentd2c67796f225cba27fba81f240a015a1e743d933 (diff)
downloadgcc-18fc635703209d1a4ab2d9544c0f7b946e3c4c04.tar.gz
[SFN] adjust RTL insn-walking API
This patch removes unused RTL functions, introduces alternate ones for use in a later SFN patch, and regroups other related functions so that they appear in a more consistent order. for gcc/ChangeLog * emit-rtl.c (next_nondebug_insn, prev_nondebug_insn): Reorder. (next_nonnote_nondebug_insn, prev_nonnote_nondebug_insn): Reorder. (next_nonnote_nondebug_insn_bb): New. (prev_nonnote_nondebug_insn_bb): New. (prev_nonnote_insn_bb, next_nonnote_insn_bb): Remove. * rtl.h (prev_nonnote_insn_bb, next_nonnote_insn_bb): Remove decls. (prev_nonnote_nondebug_insn_bb): Declare. (next_nonnote_nondebug_insn_bb): Declare. * cfgbuild.c (find_bb_boundaries): Adjust to skip debug insns. * cfgrtl.c (get_last_bb_insn): Likewise. * lra.c (push_insns): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255564 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c69
1 files changed, 38 insertions, 31 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 428e4743454..42de598067f 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -3370,20 +3370,17 @@ next_nonnote_insn (rtx_insn *insn)
return insn;
}
-/* Return the next insn after INSN that is not a NOTE, but stop the
- search before we enter another basic block. This routine does not
- look inside SEQUENCEs. */
+/* Return the next insn after INSN that is not a DEBUG_INSN. This
+ routine does not look inside SEQUENCEs. */
rtx_insn *
-next_nonnote_insn_bb (rtx_insn *insn)
+next_nondebug_insn (rtx_insn *insn)
{
while (insn)
{
insn = NEXT_INSN (insn);
- if (insn == 0 || !NOTE_P (insn))
+ if (insn == 0 || !DEBUG_INSN_P (insn))
break;
- if (NOTE_INSN_BASIC_BLOCK_P (insn))
- return NULL;
}
return insn;
@@ -3405,67 +3402,70 @@ prev_nonnote_insn (rtx_insn *insn)
return insn;
}
-/* Return the previous insn before INSN that is not a NOTE, but stop
- the search before we enter another basic block. This routine does
- not look inside SEQUENCEs. */
+/* Return the previous insn before INSN that is not a DEBUG_INSN.
+ This routine does not look inside SEQUENCEs. */
rtx_insn *
-prev_nonnote_insn_bb (rtx_insn *insn)
+prev_nondebug_insn (rtx_insn *insn)
{
-
while (insn)
{
insn = PREV_INSN (insn);
- if (insn == 0 || !NOTE_P (insn))
+ if (insn == 0 || !DEBUG_INSN_P (insn))
break;
- if (NOTE_INSN_BASIC_BLOCK_P (insn))
- return NULL;
}
return insn;
}
-/* Return the next insn after INSN that is not a DEBUG_INSN. This
- routine does not look inside SEQUENCEs. */
+/* Return the next insn after INSN that is not a NOTE nor DEBUG_INSN.
+ This routine does not look inside SEQUENCEs. */
rtx_insn *
-next_nondebug_insn (rtx_insn *insn)
+next_nonnote_nondebug_insn (rtx_insn *insn)
{
while (insn)
{
insn = NEXT_INSN (insn);
- if (insn == 0 || !DEBUG_INSN_P (insn))
+ if (insn == 0 || (!NOTE_P (insn) && !DEBUG_INSN_P (insn)))
break;
}
return insn;
}
-/* Return the previous insn before INSN that is not a DEBUG_INSN.
- This routine does not look inside SEQUENCEs. */
+/* Return the next insn after INSN that is not a NOTE nor DEBUG_INSN,
+ but stop the search before we enter another basic block. This
+ routine does not look inside SEQUENCEs. */
rtx_insn *
-prev_nondebug_insn (rtx_insn *insn)
+next_nonnote_nondebug_insn_bb (rtx_insn *insn)
{
while (insn)
{
- insn = PREV_INSN (insn);
- if (insn == 0 || !DEBUG_INSN_P (insn))
+ insn = NEXT_INSN (insn);
+ if (insn == 0)
+ break;
+ if (DEBUG_INSN_P (insn))
+ continue;
+ if (!NOTE_P (insn))
break;
+ if (NOTE_INSN_BASIC_BLOCK_P (insn))
+ return NULL;
}
return insn;
}
-/* Return the next insn after INSN that is not a NOTE nor DEBUG_INSN.
+/* Return the previous insn before INSN that is not a NOTE nor DEBUG_INSN.
This routine does not look inside SEQUENCEs. */
rtx_insn *
-next_nonnote_nondebug_insn (rtx_insn *insn)
+prev_nonnote_nondebug_insn (rtx_insn *insn)
{
while (insn)
{
- insn = NEXT_INSN (insn);
+ insn = PREV_INSN (insn);
if (insn == 0 || (!NOTE_P (insn) && !DEBUG_INSN_P (insn)))
break;
}
@@ -3473,17 +3473,24 @@ next_nonnote_nondebug_insn (rtx_insn *insn)
return insn;
}
-/* Return the previous insn before INSN that is not a NOTE nor DEBUG_INSN.
- This routine does not look inside SEQUENCEs. */
+/* Return the previous insn before INSN that is not a NOTE nor
+ DEBUG_INSN, but stop the search before we enter another basic
+ block. This routine does not look inside SEQUENCEs. */
rtx_insn *
-prev_nonnote_nondebug_insn (rtx_insn *insn)
+prev_nonnote_nondebug_insn_bb (rtx_insn *insn)
{
while (insn)
{
insn = PREV_INSN (insn);
- if (insn == 0 || (!NOTE_P (insn) && !DEBUG_INSN_P (insn)))
+ if (insn == 0)
break;
+ if (DEBUG_INSN_P (insn))
+ continue;
+ if (!NOTE_P (insn))
+ break;
+ if (NOTE_INSN_BASIC_BLOCK_P (insn))
+ return NULL;
}
return insn;