[PATCH] Strip only selected predictors after early tree passes (PR tree-optimization/85799).

Jan Hubicka hubicka@ucw.cz
Thu Aug 9 12:48:00 GMT 2018


> 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  <mliska@suse.cz>
> 
>         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  <mliska@suse.cz>

OK
>  	  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.

Honza



More information about the Gcc-patches mailing list