[Mesa-dev] [PATCH] ra: Disable round-robin strategy for optimistically colorable nodes.
Connor Abbott
cwabbott0 at gmail.com
Tue Feb 17 11:59:14 PST 2015
On Tue, Feb 17, 2015 at 2:00 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
>
> On Mon, Feb 16, 2015 at 11:39 AM, Francisco Jerez <currojerez at riseup.net>
> wrote:
>
>
> UINT_MAX would be clearer than ~0
>
>>
>> int i;
>>
>> while (progress) {
>> @@ -483,12 +490,16 @@ ra_simplify(struct ra_graph *g)
>>
>> if (!progress && best_optimistic_node != ~0U) {
>
>
> I guess we're using ~0 other places... oh well...
Grr, this one is my fault... Francisco, feel free to fix this in a
follow-up patch if you want.
>
>>
>> decrement_q(g, best_optimistic_node);
>> + stack_optimistic_start =
>> + MIN2(stack_optimistic_start, g->stack_count);
>
>
> It might be clearer to explicitly use an if here instead of the MIN2 because
> what this really means is "if (stack_optimistic_start == ~0)
> stack_optimistic_start = g->stack_count;"
I agree with this one.
>
> Other than that (and connor's comment), it looks fine to me.
>
> --Jason
>
>>
>> g->stack[g->stack_count] = best_optimistic_node;
>> g->stack_count++;
>> g->nodes[best_optimistic_node].in_stack = true;
>> progress = true;
>> }
>> }
>> +
>> + g->stack_optimistic_start = stack_optimistic_start;
>> }
>>
>> /**
>> @@ -542,7 +553,16 @@ ra_select(struct ra_graph *g)
>> g->nodes[n].reg = r;
>> g->stack_count--;
>>
>> - if (g->regs->round_robin)
>> + /* Rotate the starting point except for optimistically colorable
>> nodes.
>> + * The likelihood that we will succeed at allocating optimistically
>> + * colorable nodes is highly dependent on the way that the previous
>> + * nodes popped off the stack are laid out. The round-robin
>> strategy
>> + * increases the fragmentation of the register file and decreases
>> the
>> + * number of nearby nodes assigned to the same color, what
>> increases the
>> + * likelihood of spilling with respect to the dense packing
>> strategy.
>> + */
>> + if (g->regs->round_robin &&
>> + g->stack_count <= g->stack_optimistic_start)
>> start_search_reg = r + 1;
>> }
>>
>> --
>> 2.1.3
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list