summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-27 07:27:12 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-27 07:27:12 +0000
commita255f65a7c9820a126c7f94f5fa7b1c885a92807 (patch)
tree3acb7007422c04dcb1bc209a9aeb6d560798c498 /gcc/gcse.c
parent54d688ae6b3f3b5421563eaffca0fbcc53d61641 (diff)
downloadgcc-a255f65a7c9820a126c7f94f5fa7b1c885a92807.tar.gz
* expr.h (canonicalize_condition, get_condition): Add an int argument.
* gcse.c (fis_get_condition): Reimplement using get_condition, leaving it to check whether the condition is still valid at the jump insn. * ifcvt.c (noce_get_condition): Likewise. (noce_get_alt_condition): Update call to canonicalize_condition. * loop-iv.c (simplify_using_initial_values): Update call to get_condition. Remove FIXME. (check_simple_exit): Update call to get_condition. * loop-unswitch.c (may_unswitch_on): Likewise. * loop.c (check_dbra_loop): Likewise. (canonicalize_condition, get_condition): Add an argument to say whether the condition must still be valid at INSN. (get_condition_for_loop): Update call to get_condition. Require that the condition be valid at INSN. * predict.c (estimate_probability): Update call to get_condition. Remove unused earliest parameter. (expected_value_to_br_prob): Update call to canonicalize_condition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85218 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 1d7212559b5..b99fc415eaf 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -3687,52 +3687,7 @@ cprop (int alter_jumps)
rtx
fis_get_condition (rtx jump)
{
- rtx cond, set, tmp, insn, earliest;
- bool reverse;
-
- if (! any_condjump_p (jump))
- return NULL_RTX;
-
- set = pc_set (jump);
- cond = XEXP (SET_SRC (set), 0);
-
- /* If this branches to JUMP_LABEL when the condition is false,
- reverse the condition. */
- reverse = (GET_CODE (XEXP (SET_SRC (set), 2)) == LABEL_REF
- && XEXP (XEXP (SET_SRC (set), 2), 0) == JUMP_LABEL (jump));
-
- /* Use canonicalize_condition to do the dirty work of manipulating
- MODE_CC values and COMPARE rtx codes. */
- tmp = canonicalize_condition (jump, cond, reverse, &earliest, NULL_RTX,
- false);
- if (!tmp)
- return NULL_RTX;
-
- /* Verify that the given condition is valid at JUMP by virtue of not
- having been modified since EARLIEST. */
- for (insn = earliest; insn != jump; insn = NEXT_INSN (insn))
- if (INSN_P (insn) && modified_in_p (tmp, insn))
- break;
- if (insn == jump)
- return tmp;
-
- /* The condition was modified. See if we can get a partial result
- that doesn't follow all the reversals. Perhaps combine can fold
- them together later. */
- tmp = XEXP (tmp, 0);
- if (!REG_P (tmp) || GET_MODE_CLASS (GET_MODE (tmp)) != MODE_INT)
- return NULL_RTX;
- tmp = canonicalize_condition (jump, cond, reverse, &earliest, tmp,
- false);
- if (!tmp)
- return NULL_RTX;
-
- /* For sanity's sake, re-validate the new result. */
- for (insn = earliest; insn != jump; insn = NEXT_INSN (insn))
- if (INSN_P (insn) && modified_in_p (tmp, insn))
- return NULL_RTX;
-
- return tmp;
+ return get_condition (jump, NULL, false, true);
}
/* Check the comparison COND to see if we can safely form an implicit set from