This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
loop header heuristics fix
- To: rth at cygnus dot com, gcc-patches at gcc dot gnu dot org, patches at x86-64 dot org
- Subject: loop header heuristics fix
- From: Jan Hubicka <jh at suse dot cz>
- Date: Sun, 10 Jun 2001 10:54:19 +0200
Hi,
I've got my experimental framework running again and found that the
implementation of loop header heuiristics is broken and basically
works just for trivial loops with empty body as I've misunderstood
the placing of LOOP_CONT notes.
After this patch the hitrate of hruiristcs is very close to 100% and
it gets to be one of most succesfull ones we have.
Ne čen 10 10:51:26 CEST 2001 Jan Hubicka <jh@suse.cz>
* jump.c (duplicate_loop_exit_test): Fix loop header heuristics.
*** jump.c.old1 Sun Jun 10 10:44:52 2001
--- jump.c Sun Jun 10 10:48:36 2001
*************** duplicate_loop_exit_test (loop_start)
*** 1257,1269 ****
rtx label = JUMP_LABEL (copy);
if (label)
{
! if (PREV_INSN (label)
! && GET_CODE (PREV_INSN (label)) == NOTE
! && (NOTE_LINE_NUMBER (PREV_INSN (label))
! == NOTE_INSN_LOOP_CONT))
! {
predict_insn_def (copy, PRED_LOOP_HEADER, TAKEN);
- }
else
predict_insn_def (copy, PRED_LOOP_HEADER, NOT_TAKEN);
}
--- 1257,1268 ----
rtx label = JUMP_LABEL (copy);
if (label)
{
! /* The jump_insn after loop_start should be followed
! by barrier and loopback label. */
! if (prev_nonnote_insn (label)
! && (PREV_INSN (prev_nonnote_insn (label))
! == NEXT_INSN (loop_start)))
predict_insn_def (copy, PRED_LOOP_HEADER, TAKEN);
else
predict_insn_def (copy, PRED_LOOP_HEADER, NOT_TAKEN);
}