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: [cfg-branch]: Software Trace Cache


> > +#define BB_TO_KEY(bb) ((BB_FREQ_MAX)-((bb)->frequency))
> 
> I guess you can use negative keys dirrectly.

Yes, of course. I want to find the basic block with maximum frequency and because there is only a function for getting a minimum any function that is constant-frequency is OK.

> The frequencies can exceed the BB_FREQ_MAX macro, quite surprisingly, when
> crossjumping manages to merge two frequent paths together.
> 
> > +  int branch_threshold[] = {400, 200, 100, 0};
> > +  int exec_threshold[] = {500, 200, 50, 0};
> 
> Shouldn't this be normalized to REG_BB_FREQ_BASE and MAX_BB_FREQ so we can
> change the constants later w/o affecting the behaviour of algorithm?

These values are not absolute values, they are the per milles (the tenths of per cent; in Czech: promile (desetina procenta)) of the REG_BR_PROB_BASE and bb0->frequency:

        find_group_of_traces (branch_threshold[i] * REG_BR_PROB_BASE / 1000,
                              exec_threshold[i] * bb0->frequency / 1000,
                              traces, &n_traces, i, &heap);

> > +  /* make_reorder_chain (); */
> 
> Remove the comment and make_reorder_chain function.

OK.

Josef


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