[Mesa-dev] [PATCH 10/11] i965/vec4: Calculate live intervals with subregister granularity.

Matt Turner mattst88 at gmail.com
Fri Mar 20 12:45:53 PDT 2015


On Fri, Mar 20, 2015 at 11:24 AM, Francisco Jerez <currojerez at riseup.net> wrote:
> Matt Turner <mattst88 at gmail.com> writes:
>
>> On Fri, Mar 20, 2015 at 7:50 AM, Francisco Jerez <currojerez at riseup.net> wrote:
>>> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
>>> index 4b87af2..34df61e 100644
>>> --- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
>>> +++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
>>> @@ -179,7 +183,7 @@ vec4_live_variables::vec4_live_variables(const simple_allocator &alloc,
>>>  {
>>>     mem_ctx = ralloc_context(NULL);
>>>
>>> -   num_vars = alloc.count * 4;
>>> +   num_vars = alloc.total_size * 4;
>>>     block_data = rzalloc_array(mem_ctx, struct block_data, cfg->num_blocks);
>>>
>>>     bitset_words = BITSET_WORDS(num_vars);
>>> @@ -229,14 +233,14 @@ vec4_visitor::calculate_live_intervals()
>>>     if (this->live_intervals)
>>>        return;
>>>
>>> -   int *start = ralloc_array(mem_ctx, int, this->alloc.count * 4);
>>> -   int *end = ralloc_array(mem_ctx, int, this->alloc.count * 4);
>>> +   int *start = ralloc_array(mem_ctx, int, this->alloc.total_size * 4);
>>> +   int *end = ralloc_array(mem_ctx, int, this->alloc.total_size * 4);
>>>     ralloc_free(this->virtual_grf_start);
>>>     ralloc_free(this->virtual_grf_end);
>>>     this->virtual_grf_start = start;
>>>     this->virtual_grf_end = end;
>>>
>>> -   for (unsigned i = 0; i < this->alloc.count * 4; i++) {
>>> +   for (unsigned i = 0; i < this->alloc.total_size * 4; i++) {
>>>        start[i] = MAX_INSTRUCTION;
>>>        end[i] = -1;
>>>     }
>>
>> I don't follow the count -> total_size change. What's going on?
>
> We have "count" virtual GRFs, each with sizes[i] subregisters, what
> amounts to total_size individual subregisters.  We now keep track of
> each subregister as a separate variable so the liveness interval arrays
> need as many entries as the total number of subregisters.

Makes sense. Thanks.

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list