By optimizing the shader before inlining, we avoid having to redo this work for each inlined copy of a function. It should also reduce the memory consumption a bit.
This cuts the KHR-GL46.arrays_of_arrays_gl.SubroutineFunctionCalls2 runtime by 25% on my Icelake. That test compiles many shaders, which contain large types (dmat4) and division (expensive operations).
5180a222c00 glsl: Optimize the SoftFP64 shader when first creating it.
src/compiler/glsl/glsl_to_nir.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)