aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-07-29 21:44:42 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-07-29 19:44:42 +0000
commitb5832b43726d2d44b202c7a5669b3e97a2bc60c2 (patch)
tree19cc9892c443cb833b456226ee6217fae10f6a91 /gcc
parent12285d9df86f4fa4ece1667265fe129e25287907 (diff)
downloadgcc-b5832b43726d2d44b202c7a5669b3e97a2bc60c2.zip
gcc-b5832b43726d2d44b202c7a5669b3e97a2bc60c2.tar.gz
gcc-b5832b43726d2d44b202c7a5669b3e97a2bc60c2.tar.bz2
Suggested by Richard Henderson and Richard Kenner:
* combine.c (recog_for_combine): Use the fake recog only if instruction does not match. * rtl.h (NOOP_MOVE_INSN_CODE): New. * rtlanal.c (noop_move_p): Always return 1 for NOOP_MOVE_INSN_CODE. * combine.c (try_combine): Discover noop jump as direct jump. From-SVN: r44464
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/combine.c22
-rw-r--r--gcc/rtl.h4
-rw-r--r--gcc/rtlanal.c3
4 files changed, 27 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b887349..1c84286 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+Sun Jul 29 21:38:45 CEST 2001 Jan Hubicka <jh@suse.cz>
+
+ Suggested by Richard Henderson and Richard Kenner:
+ * combine.c (recog_for_combine): Use the fake recog
+ only if instruction does not match.
+ * rtl.h (NOOP_MOVE_INSN_CODE): New.
+ * rtlanal.c (noop_move_p): Always return 1 for NOOP_MOVE_INSN_CODE.
+
+ * combine.c (try_combine): Discover noop jump as direct jump.
+
2001-07-29 Daniel Berlin <dan@cgsoftware.com>
* df.c (df_rd_global_compute): Add successors to worklist, not
diff --git a/gcc/combine.c b/gcc/combine.c
index 657a929..4ece85a 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2763,7 +2763,10 @@ try_combine (i3, i2, i1, new_direct_jump_p)
BARRIER following it since it may have initially been a
conditional jump. It may also be the last nonnote insn. */
- if (GET_CODE (newpat) == RETURN || any_uncondjump_p (i3))
+ if (GET_CODE (newpat) == RETURN || any_uncondjump_p (i3)
+ || (GET_CODE (newpat) == SET
+ && SET_SRC (newpat) == pc_rtx
+ && SET_DEST (newpat) == pc_rtx))
{
*new_direct_jump_p = 1;
@@ -9600,12 +9603,7 @@ recog_for_combine (pnewpat, insn, pnotes)
old_notes = REG_NOTES (insn);
REG_NOTES (insn) = 0;
- /* Is the result of combination a valid instruction?
- Recognize all noop sets, these will be killed by followup pass. */
- if (GET_CODE (pat) == SET && set_noop_p (pat))
- insn_code_number = INT_MAX;
- else
- insn_code_number = recog (pat, insn, &num_clobbers_to_add);
+ insn_code_number = recog (pat, insn, &num_clobbers_to_add);
/* If it isn't, there is the possibility that we previously had an insn
that clobbered some register as a side effect, but the combined
@@ -9630,13 +9628,13 @@ recog_for_combine (pnewpat, insn, pnotes)
if (pos == 1)
pat = XVECEXP (pat, 0, 0);
- /* Recognize all noop sets, these will be killed by followup pass. */
- if (GET_CODE (pat) == SET && set_noop_p (pat))
- insn_code_number = INT_MAX;
- else
- insn_code_number = recog (pat, insn, &num_clobbers_to_add);
+ insn_code_number = recog (pat, insn, &num_clobbers_to_add);
}
+ /* Recognize all noop sets, these will be killed by followup pass. */
+ if (insn_code_number < 0 && GET_CODE (pat) == SET && set_noop_p (pat))
+ insn_code_number = NOOP_MOVE_INSN_CODE, num_clobbers_to_add = 0;
+
REG_NOTES (insn) = old_notes;
/* If we had any clobbers to add, make a new pattern than contains
diff --git a/gcc/rtl.h b/gcc/rtl.h
index e7fdc98..da454c2 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -35,6 +35,10 @@ struct function;
union tree_node;
#endif
+/* Value used by some passes to "recognize" noop moves as valid instructions.
+ */
+#define NOOP_MOVE_INSN_CODE INT_MAX
+
/* Register Transfer Language EXPRESSIONS CODES */
#define RTX_CODE enum rtx_code
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index c9152ab..92220f6 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1030,6 +1030,9 @@ noop_move_p (insn)
{
rtx pat = PATTERN (insn);
+ if (INSN_CODE (insn) == NOOP_MOVE_INSN_CODE)
+ return 1;
+
/* Insns carrying these notes are useful later on. */
if (find_reg_note (insn, REG_EQUAL, NULL_RTX))
return 0;