diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-17 19:21:09 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-17 19:21:09 +0000 |
commit | 124d766df38802d862e5580e8395953c6c19ec80 (patch) | |
tree | 0304d00cbc94155e5757d349d3e7de66029fc4e0 /gcc/reorg.c | |
parent | 221322607b378b288dece023897a34ef14aefe8a (diff) | |
download | gcc-124d766df38802d862e5580e8395953c6c19ec80.tar.gz |
* loop.c (canonicalize_condition): Add WANT_REG argument.
Stop the search if we match it.
* expr.h (canonicalize_condition): Update decl.
* predict.c (expected_value_to_br_prob): Use it. Track last
expected value note.
(find_expected_value): Remove.
* reorg.c (mostly_true_jump): Always use BR_PROB if present.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33214 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r-- | gcc/reorg.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c index 379def73cbb..cce40c0d7cf 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -900,30 +900,29 @@ mostly_true_jump (jump_insn, condition) rtx jump_insn, condition; { rtx target_label = JUMP_LABEL (jump_insn); - rtx insn; + rtx insn, note; int rare_dest = rare_destination (target_label); int rare_fallthrough = rare_destination (NEXT_INSN (jump_insn)); /* If branch probabilities are available, then use that number since it always gives a correct answer. */ - if (flag_branch_probabilities) + note = find_reg_note (jump_insn, REG_BR_PROB, 0); + if (note) { - rtx note = find_reg_note (jump_insn, REG_BR_PROB, 0); - if (note) - { - int prob = XINT (note, 0); + int prob = INTVAL (XEXP (note, 0)); - if (prob >= REG_BR_PROB_BASE * 9 / 10) - return 2; - else if (prob >= REG_BR_PROB_BASE / 2) - return 1; - else if (prob >= REG_BR_PROB_BASE / 10) - return 0; - else - return -1; - } + if (prob >= REG_BR_PROB_BASE * 9 / 10) + return 2; + else if (prob >= REG_BR_PROB_BASE / 2) + return 1; + else if (prob >= REG_BR_PROB_BASE / 10) + return 0; + else + return -1; } + /* ??? Ought to use estimate_probability instead. */ + /* If this is a branch outside a loop, it is highly unlikely. */ if (GET_CODE (PATTERN (jump_insn)) == SET && GET_CODE (SET_SRC (PATTERN (jump_insn))) == IF_THEN_ELSE |