This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] optimizing predictable branches on x86
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Nick Piggin <nickpiggin at yahoo dot com dot au>, GCC <gcc at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Mar 2008 12:55:19 +0100
- Subject: Re: [RFA] optimizing predictable branches on x86
- References: <998d0e4a0802260806i5d5b1becn2e630770b8579bf8@mail.gmail.com> <200802271800.10048.nickpiggin@yahoo.com.au> <20080303113811.GA30291@atrey.karlin.mff.cuni.cz> <47CBE566.6070400@gnu.org>
>
> > /* High branch cost, expand as the bitwise OR of the conditions.
> > Do the same if the RHS has side effects, because we're effectively
> > turning a TRUTH_OR_EXPR into a TRUTH_ORIF_EXPR. */
> >! if (BRANCH_COST (!optimize_size, false)>= 4
> >! || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
>
> What does BRANCH_COST (!optimize_save, ...) mean?
This leaked here from older version of patch. I updated it to
! if (BRANCH_COST (cfun->function_frequency > FUNCTION_FREQUENCY_NORMAL,
! false) >= 4
!
like it is handled in other cases. Once we will get hotness info
available during expansion, we will simply pass it here.
>
> Related -- could you define auxiliary macros for BRANCH_COST (foo, false)?
But I can also hide the cfun->function_frequency trick in
DEFAULT_BRANCH_COST macro if it seems to help. (in longer term I hope
they will all go away as expansion needs to be aware of hotness info
anyway)
Honza
>
> Thanks!
>
> Paolo