nir: use a single set during CSE
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 17 Aug 2020 18:56:16 +0000 (19:56 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 15 Jun 2021 17:57:07 +0000 (17:57 +0000)
commit964f59d20efd6b39732bda53963ef54bceaeb370
treec927b8596872b768e6edc66f4f20d0b5bd9f626a
parentcb1ddff350f661adb00f185f9ae202151ac3c339
nir: use a single set during CSE

Use a single set and ensure dominance by checking after a equivalent
instruction is found.

Besides removing the need to copy a set, this also lets us resize the set
at the start of the pass in the next commit.

ministat (CSE only):
Difference at 95.0% confidence
-984.956 +/- 28.8559
-6.90075% +/- 0.190231%
(Student's t, pooled s = 26.9052)

ministat (entire run):
Difference at 95.0% confidence
-1246.1 +/- 257.253
-0.998972% +/- 0.205094%
(Student's t, pooled s = 239.863)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6390>
src/compiler/nir/nir_instr_set.c
src/compiler/nir/nir_instr_set.h
src/compiler/nir/nir_opt_cse.c
src/compiler/nir/nir_opt_gcm.c