[PATCH] genmatch: isolate reporting into a function

Jeff Law law@redhat.com
Fri Sep 14 17:30:00 GMT 2018


On 9/3/18 1:56 AM, Martin Liška wrote:
> Hi.
> 
> This is small improvement for {gimple,generic}-match.c files.
> The code path that reports application of a pattern is now guarded
> with __builtin_expect. And reporting function lives in gimple.c.
> 
> For gimple-match.o, difference is:
> 
> bloaty /tmp/after.o -- /tmp/before.o
>      VM SIZE                           FILE SIZE
>  ++++++++++++++ GROWING             ++++++++++++++
>   [ = ]       0 .rela.debug_loc     +58.5Ki  +0.5%
>   +0.7% +7.70Ki .text               +7.70Ki  +0.7%
>   [ = ]       0 .debug_info         +3.53Ki  +0.6%
>   [ = ]       0 .rela.debug_ranges  +2.02Ki  +0.0%
>   [ = ]       0 .debug_loc          +1.86Ki  +0.7%
>   +0.7%    +448 .eh_frame              +448  +0.7%
>   [ = ]       0 .rela.eh_frame         +192  +0.7%
>   [ = ]       0 .rela.debug_line        +48  +0.4%
>   [ = ]       0 .debug_str              +26  +0.0%
>   +6.9%      +9 .rodata.str1.1           +9  +6.9%
> 
>  -------------- SHRINKING           --------------
>  -97.5% -24.8Ki .rodata.str1.8      -24.8Ki -97.5%
>   [ = ]       0 .symtab             -14.7Ki -26.1%
>   [ = ]       0 .strtab             -3.57Ki  -2.2%
>   [ = ]       0 .rela.debug_info    -2.81Ki  -0.0%
>   [ = ]       0 .debug_line         -2.14Ki  -0.6%
>   [ = ]       0 .rela.text             -816  -0.1%
>   [ = ]       0 .rela.text.unlikely    -288  -0.1%
>   -0.1%    -131 .text.unlikely         -131  -0.1%
>   [ = ]       0 [Unmapped]              -23 -14.0%
>   [ = ]       0 .debug_abbrev            -2  -0.1%
> 
>   -1.2% -16.8Ki TOTAL               +25.1Ki  +0.1%
> 
> I'm testing the patch.
> Thoughts?
> 
> Martin
> 
> gcc/ChangeLog:
> 
> 2018-08-31  Martin Liska  <mliska@suse.cz>
> 
> 	* genmatch.c (output_line_directive): Add new argument
> 	fnargs.
> 	(dt_simplify::gen_1): Generate call to report_match_pattern
> 	function and wrap that into __builtin_expect.
> 	* gimple.c (report_match_pattern): New function.
> 	* gimple.h (report_match_pattern): Likewise.
Seems reasonable, though I'm not generally a fan of __builtin_expect :-)

jeff



More information about the Gcc-patches mailing list