1786032029
Profiling showed that maintaining this ssa_srcs set consumes ~3% of CTS time with a debugoptimized build. Unfortunately, we really do benefit from getting this coverage in CI. So rather than remove the validation, let's optimize the data structure used so we can keep the coverage at a fraction of the cost. The expensive piece is the pointer set, which is backed by a relatively expensive hash table. It would be much cheaper to use an invasive set instead, with a single "present" bit. We don't want to bloat nir_src for this, however there's an easy solution: use a tagged pointer to steal a bit in the nir_src for the job. We untag everything at the end of validation (and this meta-invariant is asserted with an auxiliary counter), so while we mutate the IR while validating, the mutations do not escape nir_validate. We tag the parent pointer and not the def pointer, because it is dramatically less used and therefore has far fewer disrupted call sites. The M1 job is improved from 3:03 to 2:55 of deqp-runner reported time, which is excellent. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26084>