aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2003-06-12 04:15:56 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2003-06-12 04:15:56 +0000
commit2fa4a84980a8076f2819d0eac793a3fa215c6276 (patch)
tree85141565fe52d7f0a1a45c4dc9d1cb2189baa8da /gcc/reload1.c
parent58ac1d7f0ed6264255737ccba13f32d70fb79d22 (diff)
downloadgcc-2fa4a84980a8076f2819d0eac793a3fa215c6276.zip
gcc-2fa4a84980a8076f2819d0eac793a3fa215c6276.tar.gz
gcc-2fa4a84980a8076f2819d0eac793a3fa215c6276.tar.bz2
gcse.c (fis_get_condition): Make it a global function.
* gcse.c (fis_get_condition): Make it a global function. * reload1.c (reload_cse_move2add): Detect implicit sets. * rtl.h: Add a prototype for fis_get_condition. From-SVN: r67814
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index f8b3d5a..12f6689 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -9314,6 +9314,30 @@ reload_cse_move2add (first)
}
}
note_stores (PATTERN (insn), move2add_note_store, NULL);
+
+ /* If INSN is a conditional branch, we try to extract an
+ implicit set out of it. */
+ if (any_condjump_p (insn) && onlyjump_p (insn))
+ {
+ rtx cnd = fis_get_condition (insn);
+
+ if (cnd != NULL_RTX
+ && GET_CODE (cnd) == NE
+ && GET_CODE (XEXP (cnd, 0)) == REG
+ /* The following two checks, which are also in
+ move2add_note_store, are intended to reduce the
+ number of calls to gen_rtx_SET to avoid memory
+ allocation if possible. */
+ && SCALAR_INT_MODE_P (GET_MODE (XEXP (cnd, 0)))
+ && HARD_REGNO_NREGS (REGNO (XEXP (cnd, 0)), GET_MODE (XEXP (cnd, 0))) == 1
+ && GET_CODE (XEXP (cnd, 1)) == CONST_INT)
+ {
+ rtx implicit_set =
+ gen_rtx_SET (VOIDmode, XEXP (cnd, 0), XEXP (cnd, 1));
+ move2add_note_store (SET_DEST (implicit_set), implicit_set, 0);
+ }
+ }
+
/* If this is a CALL_INSN, all call used registers are stored with
unknown values. */
if (GET_CODE (insn) == CALL_INSN)