util/ra: Improve ra_set_finalize() performance.
BITSET_FOR_EACH_SET can walk a sparse set (such as a register class's set of registers) much faster than just iterating over individual bits. Improves freedreno startup time (as measured by shader-db ./run shaders/closed/gputest/triangle on my x86 system) by -4.12679% +/- 1.99006% (n=151) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4537>
This commit is contained in:
parent
53ac2dabec
commit
05e6f763e7
|
@ -400,12 +400,9 @@ ra_set_finalize(struct ra_regs *regs, unsigned int **q_values)
|
|||
unsigned int rc;
|
||||
int max_conflicts = 0;
|
||||
|
||||
for (rc = 0; rc < regs->count; rc++) {
|
||||
BITSET_FOREACH_SET(rc, regs->classes[c]->regs, regs->count) {
|
||||
int conflicts = 0;
|
||||
|
||||
if (!reg_belongs_to_class(rc, regs->classes[c]))
|
||||
continue;
|
||||
|
||||
util_dynarray_foreach(®s->regs[rc].conflict_list,
|
||||
unsigned int, rbp) {
|
||||
unsigned int rb = *rbp;
|
||||
|
|
Loading…
Reference in New Issue