nir/dce: replace instruction worklist with ssa def bitset
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 17 Nov 2020 16:27:26 +0000 (16:27 +0000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 24 Feb 2021 09:58:59 +0000 (09:58 +0000)
commit325f627d88623dc2906a159b8c2617f5413b28cf
treef598a9324dee5fe5fa5154113c6c0a0510a15972
parent15e1979c51b911ebaf6330c79b62144c7d8ea081
nir/dce: replace instruction worklist with ssa def bitset

Instead of a keeping a worklist of live instructions, use a bitset of live
ssa defs and iterate over instructions in reverse.

Compile-time (nir_opt_dce):
Difference at 95.0% confidence
-931.911 +/- 4.41383
-26.0263% +/- 0.105781%
(Student's t, pooled s = 5.21293)

Compile-time (overall):
Difference at 95.0% confidence
-882.245 +/- 28.3492
-2.08541% +/- 0.0665121%
(Student's t, pooled s = 33.4818)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7691>
src/compiler/nir/nir_opt_dce.c