glsl: Optimize the SoftFP64 shader when first creating it.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 8 Aug 2019 08:44:52 +0000 (01:44 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 12 Aug 2019 17:42:32 +0000 (10:42 -0700)
commit5180a222c0058d0ecd23816151ffcdd158a0febc
tree61f68f7b205b5be301b4fcc0d482f927ea6f9ec8
parent914ecc9384ef31411bb06178f01cb0b2683fa344
glsl: Optimize the SoftFP64 shader when first creating it.

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).

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/glsl/glsl_to_nir.cpp