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]
Other format: [Raw text]

Re: [RFC] asm goto


On 07/27/2009 03:29 PM, Adam Nemet wrote:
Isn't the prediction logic a little too subtle here?  I.e. the fact that
in

// bb0
if (foo)
   goto L1;

if (0)
{
   L1:
   // bb1
}

// bb2
L2:

We assume that bb0->bb2 is more likely than bb0->bb1?  Is this BTW a
heuristic we already have?  PRED_GOTO maybe?

A heuristic that minimizes the number of jumps will order the blocks properly, given that it can neither remove nor invert the asm goto jump.


That said, I have an additional plan for

L1: __attribute__((cold))

that will affect the prediction logic such that the BB beginning with L1 should be put into the .text.unlikely section (if supported), and edges to this label should be considered very unlikely.

But let's keep the two issues separate here.



r~


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