summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-01 22:37:34 +0000
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-01 22:37:34 +0000
commitd2fcadb2503af7b4ce326d1b395f52a55145d040 (patch)
treec299c1a2e197ee72eb8dccea66a72117a75aa238 /gcc/combine.c
parent518a433d6ff659b766ce4f52cb5edb15a72123ed (diff)
downloadgcc-d2fcadb2503af7b4ce326d1b395f52a55145d040.tar.gz
* combine.c (try_combine): Use is_parallel_of_n_reg_sets some more.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218249 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index b9319023c34..f471920b23e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2832,43 +2832,33 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
This undoes a previous combination and allows us to match a branch-and-
decrement insn. */
- if (i1 == 0 && GET_CODE (PATTERN (i2)) == PARALLEL
- && XVECLEN (PATTERN (i2), 0) >= 2
- && GET_CODE (XVECEXP (PATTERN (i2), 0, 0)) == SET
+ if (i1 == 0
+ && is_parallel_of_n_reg_sets (i2, 2)
&& (GET_MODE_CLASS (GET_MODE (SET_DEST (XVECEXP (PATTERN (i2), 0, 0))))
== MODE_CC)
&& GET_CODE (SET_SRC (XVECEXP (PATTERN (i2), 0, 0))) == COMPARE
&& XEXP (SET_SRC (XVECEXP (PATTERN (i2), 0, 0)), 1) == const0_rtx
- && GET_CODE (XVECEXP (PATTERN (i2), 0, 1)) == SET
- && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)))
&& rtx_equal_p (XEXP (SET_SRC (XVECEXP (PATTERN (i2), 0, 0)), 0),
SET_SRC (XVECEXP (PATTERN (i2), 0, 1)))
&& !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)), i2, i3)
&& !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)), i2, i3))
{
- for (i = XVECLEN (PATTERN (i2), 0) - 1; i >= 2; i--)
- if (GET_CODE (XVECEXP (PATTERN (i2), 0, i)) != CLOBBER)
- break;
-
- if (i == 1)
- {
- /* We make I1 with the same INSN_UID as I2. This gives it
- the same DF_INSN_LUID for value tracking. Our fake I1 will
- never appear in the insn stream so giving it the same INSN_UID
- as I2 will not cause a problem. */
+ /* We make I1 with the same INSN_UID as I2. This gives it
+ the same DF_INSN_LUID for value tracking. Our fake I1 will
+ never appear in the insn stream so giving it the same INSN_UID
+ as I2 will not cause a problem. */
- i1 = gen_rtx_INSN (VOIDmode, NULL, i2, BLOCK_FOR_INSN (i2),
- XVECEXP (PATTERN (i2), 0, 1), INSN_LOCATION (i2),
- -1, NULL_RTX);
- INSN_UID (i1) = INSN_UID (i2);
+ i1 = gen_rtx_INSN (VOIDmode, NULL, i2, BLOCK_FOR_INSN (i2),
+ XVECEXP (PATTERN (i2), 0, 1), INSN_LOCATION (i2),
+ -1, NULL_RTX);
+ INSN_UID (i1) = INSN_UID (i2);
- SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0));
- SUBST (XEXP (SET_SRC (PATTERN (i2)), 0),
- SET_DEST (PATTERN (i1)));
- unsigned int regno = REGNO (SET_DEST (PATTERN (i1)));
- SUBST_LINK (LOG_LINKS (i2),
- alloc_insn_link (i1, regno, LOG_LINKS (i2)));
- }
+ SUBST (PATTERN (i2), XVECEXP (PATTERN (i2), 0, 0));
+ SUBST (XEXP (SET_SRC (PATTERN (i2)), 0),
+ SET_DEST (PATTERN (i1)));
+ unsigned int regno = REGNO (SET_DEST (PATTERN (i1)));
+ SUBST_LINK (LOG_LINKS (i2),
+ alloc_insn_link (i1, regno, LOG_LINKS (i2)));
}
/* If I2 is a PARALLEL of two SETs of REGs (and perhaps some CLOBBERs),