mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
ra: Take advantage of the adjacency list in finding a node to spill.
This revealed a bug in ra_get_spill_benefit where we only considered the benefit of the first adjacency we were to remove, explaining some of the ugly spilling I've seen in shaders. Because of the reduced spilling, it reduces the runtime of glsl-fs-convolution-1 36.9% +/- 0.9% (n=5).
This commit is contained in:
parent
ea8e21856e
commit
d5a53ad271
1 changed files with 6 additions and 6 deletions
|
|
@ -401,17 +401,17 @@ ra_get_spill_benefit(struct ra_graph *g, unsigned int n)
|
|||
float benefit = 0;
|
||||
int n_class = g->nodes[n].class;
|
||||
|
||||
/* Define the benefit of eliminating an interference between n, j
|
||||
/* Define the benefit of eliminating an interference between n, n2
|
||||
* through spilling as q(C, B) / p(C). This is similar to the
|
||||
* "count number of edges" approach of traditional graph coloring,
|
||||
* but takes classes into account.
|
||||
*/
|
||||
for (j = 0; j < g->count; j++) {
|
||||
if (j != n && g->nodes[n].adjacency[j]) {
|
||||
unsigned int j_class = g->nodes[j].class;
|
||||
benefit += ((float)g->regs->classes[n_class]->q[j_class] /
|
||||
for (j = 0; j < g->nodes[n].adjacency_count; j++) {
|
||||
unsigned int n2 = g->nodes[n].adjacency_list[j];
|
||||
if (n != n2) {
|
||||
unsigned int n2_class = g->nodes[n2].class;
|
||||
benefit += ((float)g->regs->classes[n_class]->q[n2_class] /
|
||||
g->regs->classes[n_class]->p);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue