This is the mail archive of the 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: [PATCH] Strip only selected predictors after early tree passes (PR tree-optimization/85799).

> Hi.
> This patch adds an argument to the strip predictor pass. Early
> version strips only selected hints that are not reliable when
> inlining happens. The rest is striped in late tree passes.
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> Ready to be installed?
> Martin
> gcc/ChangeLog:
> 2018-08-09  Martin Liska  <>
>         PR tree-optimization/85799
> 	* passes.def: Add new pass_strip_predict_hints_early.
> 	* predict.c (make_pass_profile): Add
>         pass_data_strip_predict_hints_early and
>         new pass pass_strip_predict_hints_early.
> 	(strip_predictor_early): New function.
> 	(pass_strip_predict_hints::execute): Call strip_predict_hints.
> 	(strip_predict_hints): New.
> 	(class pass_strip_predict_hints_early): New.
> 	(make_pass_strip_predict_hints_early): Likewise.
> 	* predict.def: Fix documentation.
> 	* tree-pass.h (make_pass_strip_predict_hints_early): New.
> gcc/testsuite/ChangeLog:
> 2018-08-09  Martin Liska  <>

>  	  NEXT_PASS (pass_split_functions);
> -	  NEXT_PASS (pass_strip_predict_hints);
> +	  NEXT_PASS (pass_strip_predict_hints_early);

Perhaps we want to add bool parameter
 NEXT_PASS (pass_strip_predict_hints, true /* early_p */);
> +/* Return true when PRED predictor should be removed after early
> +   tree passes.  */

Please add bit of reasoning why some stuff is left for late (i.e. we want it
to survive inlining so we don't get into this trap again)

OK with this change.


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