[PATCH] Check calls before loop unrolling
Tue Aug 25 02:26:14 GMT 2020
On 2020-08-24 19:16, Jan Hubicka wrote:
>> On Thu, Aug 20, 2020 at 6:35 AM guojiufu via Gcc-patches
>> <firstname.lastname@example.org> wrote:
>> > Hi,
>> > This patch is checking the _average_ number of calls which is the
>> > summary of call numbers multiply the possibility of the call maybe
>> > executed. The _average_ number could be a fraction, to keep the
>> > precision, the param is the threshold number multiply 10000.
>> Can you try mimicking what try_unroll_loop_completely on GIMPLE does
>> instead? IIRC the main motivation to not unroll calls is the spilling
>> around it which we cannot estimate very well. And that spilling
>> irrespective of whether the call is in a hot or cold path so I'm not
>> it makes sense to use the "average" number of calls here.
In try_unroll_loop_completely, it is checking the calls in the hot path:
num_non_pure_calls_on_hot_path), and avoid unrolling if there is.
This is one reason for here to use "average".
> As long as I remember, we excluded calls simply becuase it is/was an
> expensive intruction so it was an indication that the loop overhead is
> small compared to the overhead of loop body.
Thanks, Honza and Richard!
More information about the Gcc-patches