nir/instr_set: Use _mesa_set_search_or_add()
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 27 Mar 2019 11:11:36 +0000 (12:11 +0100)
committerConnor Abbott <cwabbott0@gmail.com>
Fri, 31 May 2019 17:13:59 +0000 (19:13 +0200)
commit3bd073301182b4bb2dae28bee6175ebe78184f3d
tree6b59b3382a553615306982fd89c100232d720160
parent8a838e172f3f796b2d5d01cb51e05b37ae6f48f5
nir/instr_set: Use _mesa_set_search_or_add()

Before this change, we were searching for each instruction twice, once
when checking if it exists and once when figuring out where to insert
it. By using the new function, we can do everything we need to do in one
operation.

Compilation time numbers for my shader-db database:

Difference at 95.0% confidence
-4.04706 +/- 0.669508
-0.922142% +/- 0.151948%
(Student's t, pooled s = 0.95824)

Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_instr_set.c