aboutsummaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1994-06-14 13:18:43 -0600
committerJeff Law <law@gcc.gnu.org>1994-06-14 13:18:43 -0600
commit3480bb98425cfd31e76057ad52e7a039dee20a79 (patch)
tree9ada8dc73a09377ab6597e86279771aff5a63b15 /gcc/jump.c
parent36e2f858ba48aa9230e081ac48f69ae11fd623f1 (diff)
downloadgcc-3480bb98425cfd31e76057ad52e7a039dee20a79.zip
gcc-3480bb98425cfd31e76057ad52e7a039dee20a79.tar.gz
gcc-3480bb98425cfd31e76057ad52e7a039dee20a79.tar.bz2
jump.c (condjump_in_parallel_p): New function to detect conditional jumps within PARALLEL insns.
* jump.c (condjump_in_parallel_p): New function to detect conditional jumps within PARALLEL insns. (jump_optimize): Allow for some simple optimizations involving conditional jumps within PARALLEL insns. * reorg.c (get_jump_flags): Handle conditional jumps in PARALLEL insns. (get_branch_condition, fill_simple_delay_slots): Likewise. (fill_eager_delay_slots, relax_delay_slots, dbr_schedule): Likewise. From-SVN: r7452
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 40258a5..05938d2 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -566,6 +566,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
rtx temp, temp1, temp2, temp3, temp4, temp5, temp6;
rtx nlabel;
int this_is_simplejump, this_is_condjump, reversep;
+ int this_is_condjump_in_parallel;
#if 0
/* If NOT the first iteration, if this is the last jump pass
(just before final), do the special peephole optimizations.
@@ -605,6 +606,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
this_is_simplejump = simplejump_p (insn);
this_is_condjump = condjump_p (insn);
+ this_is_condjump_in_parallel = condjump_in_parallel_p (insn);
/* Tension the labels in dispatch tables. */
@@ -1644,7 +1646,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
}
/* Detect a conditional jump jumping over an unconditional jump. */
- else if (this_is_condjump && ! this_is_simplejump
+ else if ((this_is_condjump || this_is_condjump_in_parallel)
+ && ! this_is_simplejump
&& reallabelprev != 0
&& GET_CODE (reallabelprev) == JUMP_INSN
&& prev_active_insn (reallabelprev) == insn
@@ -2830,6 +2833,39 @@ condjump_p (insn)
return 0;
}
+/* Return nonzero if INSN is a (possibly) conditional jump
+ and nothing more. */
+
+int
+condjump_in_parallel_p (insn)
+ rtx insn;
+{
+ register rtx x = PATTERN (insn);
+
+ if (GET_CODE (x) != PARALLEL)
+ return 0;
+ else
+ x = XVECEXP (x, 0, 0);
+
+ if (GET_CODE (x) != SET)
+ return 0;
+ if (GET_CODE (SET_DEST (x)) != PC)
+ return 0;
+ if (GET_CODE (SET_SRC (x)) == LABEL_REF)
+ return 1;
+ if (GET_CODE (SET_SRC (x)) != IF_THEN_ELSE)
+ return 0;
+ if (XEXP (SET_SRC (x), 2) == pc_rtx
+ && (GET_CODE (XEXP (SET_SRC (x), 1)) == LABEL_REF
+ || GET_CODE (XEXP (SET_SRC (x), 1)) == RETURN))
+ return 1;
+ if (XEXP (SET_SRC (x), 1) == pc_rtx
+ && (GET_CODE (XEXP (SET_SRC (x), 2)) == LABEL_REF
+ || GET_CODE (XEXP (SET_SRC (x), 2)) == RETURN))
+ return 1;
+ return 0;
+}
+
/* Return 1 if X is an RTX that does nothing but set the condition codes
and CLOBBER or USE registers.
Return -1 if X does explicitly set the condition codes,