This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: Installed preliminary branch pred/block reordering code.


Jason

Jason Eckhardt wrote:


> +       /* EQ tests are usually false and NE tests are usually true.  Also,
> +        most quantities are positive, so we can make the appropriate guesses
> +        about signed comparisons against zero.  */
> +       switch (GET_CODE (cond))
> +       {
> +       case CONST_INT:
> +         /* Unconditional branch.  */
> +         prob = REG_BR_PROB_BASE / 2;
> +       case EQ:
> +         prob = REG_BR_PROB_BASE / 10;
> +       case NE:
> +         prob = REG_BR_PROB_BASE / 2;
> +       case LE:
> +       case LT:
> +         if (XEXP (cond, 1) == const0_rtx)
> +           prob = REG_BR_PROB_BASE / 10;
> +         break;
> +       case GE:
> +       case GT:
> +         if (XEXP (cond, 1) == const0_rtx
> +             || (GET_CODE (XEXP (cond, 1)) == CONST_INT
> +                 && INTVAL (XEXP (cond, 1)) == -1))
> +           prob = REG_BR_PROB_BASE / 2;
> +         break;
> +
> +       default:
> +         prob = 0;
> +       }
> +       if (! find_reg_note (last_insn, REG_BR_PROB, 0))
> +       REG_NOTES (last_insn)
> +         = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob),
> +                              REG_NOTES (last_insn));
> +     }
> + }
> +

This above switch statement looks like its missing `break`s for
the `CONST_INT`,`EQ` and `NE' cases ? 

Graham

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]