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: Update profile for haifa-sched's recovery blocks


> On Tue, 4 Jul 2017, Jan Hubicka wrote:
> 
> > Hi,
> > this is another bug I noticed while looking into Itanium rgression.
> > There is no profile attached to recovery blocks in scheduler.
> > I made them very unlikely, but I wonder if we can do better? After all
> > we probably know the probability of path that will lead for speculation
> > to suceed?
> 
> I don't really understand why/how that would help (after all, when doing
> speculation we must have already decided that failure is very unlikely),
> but to answer the last question, scheduler's estimation of speculation
> success is tracked using the 'ds_t' data type - see comments regarding
> 'dw_t' and 'ds_t' in sched-int.h.

Well, the probabilities/counts controls later passes. For example if chance
for speculation to fail is 1/100 one does not want to offload the block
into cold section or agressively optimize it for size.
If failure happens only over path that is predicted to not be taken at
all during execution run (for example because it leads to abort) then
such transforms are fine.

For this to work we would need to actually track profile_probability not
just sum of values convered to reg_br_prob_base. So perhaps I will keep code
as it is and add a TODO comment.  OK?

Honza
> 
> I think in haifa-sched.c 'todo_spec' variable in create_check_block_twin
> holds the desired estimation, in sel-sched.c it's 'check_ds' in
> create_speculation_check.
> 
> Alexander


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