Hash shaders and avoid backend compiles
radeonsi uses a hash of the serialized NIR (or TGSI) to detect multiple different GLSL programs that compile down to the same thing, and they then just reuse the shader, rather than recompiling it from scratch. This can apparently cut a significant amount of time from shader-db. Possibly due to the same VS being linked with multiple FS...or different variants of shaders that preprocess to the same thing...and so on.
Apparently the serialized NIR isn't as good of a key as the TGSI (see #intel-3d February 28th IRC logs)...possibly due to variable names, SSA index numbers, variable list ordering, etc. We may want some sort of normalization pass to combat this.
We should consider doing similar hashing to avoid compile times, shrink disk cache space, and so on.