mesa/src/compiler
Timothy Arceri 34ab9b0947 glsl: lower constant arrays to uniform arrays before optimisation loop
Previously the constant array would not get copy propagated until the backend
did its GLSL IR opt loop. I plan on removing that from i965 shortly which
caused huge regressions in Deus-ex and Tomb Raider which have large
constant arrays. Moving lowering before the opt loop in the GLSL linker
fixes this and unexpectedly improves some compute shaders also.

shader-db results BDW:

instructions helped:   shaders/closed/steam/deus-ex-mankind-divided/374.shader_test CS SIMD16: 204 -> 194 (-4.90%)
instructions helped:   shaders/closed/steam/deus-ex-mankind-divided/318.shader_test CS SIMD8: 1010 -> 741 (-26.63%)
instructions helped:   shaders/closed/steam/deus-ex-mankind-divided/144.shader_test CS SIMD8: 542 -> 385 (-28.97%)

cycles helped:   shaders/closed/steam/deus-ex-mankind-divided/318.shader_test CS SIMD8: 1831382 -> 1818492 (-0.70%)
cycles helped:   shaders/closed/steam/deus-ex-mankind-divided/144.shader_test CS SIMD8: 216238 -> 206180 (-4.65%)
cycles helped:   shaders/closed/steam/deus-ex-mankind-divided/374.shader_test CS SIMD16: 18484 -> 16644 (-9.95%)

total instructions in shared programs: 13060313 -> 13059877 (-0.00%)
instructions in affected programs: 1756 -> 1320 (-24.83%)
helped: 3
HURT: 0

total cycles in shared programs: 256586698 -> 256561910 (-0.01%)
cycles in affected programs: 2066104 -> 2041316 (-1.20%)
helped: 3
HURT: 0

V3: only call the opt loop if lowering progressed (Suggested by Eric)

V2: call opts before and after lowering (Suggested by Ken)

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-01-25 09:07:30 +11:00
..
glsl glsl: lower constant arrays to uniform arrays before optimisation loop 2017-01-25 09:07:30 +11:00
nir nir/search: Use the correct bit size for integer comparisons 2017-01-21 10:34:21 -08:00
spirv spirv: don't assert with location decorations on non i/o variables 2017-01-20 21:39:46 +00:00
.gitignore nir/spirv: Remove a duplicate spirv2nir from .gitignore 2016-10-04 07:43:15 -07:00
Android.glsl.gen.mk Android: glsl: add rules to generate ir_expression*.h header files 2016-09-06 15:58:55 +01:00
Android.glsl.mk Android: glsl: add rules to generate ir_expression*.h header files 2016-09-06 15:58:55 +01:00
Android.mk Android: glsl: add rules to generate ir_expression*.h header files 2016-09-06 15:58:55 +01:00
Android.nir.gen.mk compiler: android: flesh out nir into separate makefile 2016-04-11 19:08:23 +01:00
Android.nir.mk android: add SPIRV_FILES to libmesa_nir 2016-11-11 07:59:29 +02:00
builtin_type_macros.h glsl: Add basic ARB_gpu_shader_int64 types 2017-01-20 15:41:23 -08:00
glsl_types.cpp glsl: Add basic ARB_gpu_shader_int64 types 2017-01-20 15:41:23 -08:00
glsl_types.h glsl: Add basic ARB_gpu_shader_int64 types 2017-01-20 15:41:23 -08:00
Makefile.am compiler: avoid warning about redefinition of PYTHON_GEN 2016-10-26 14:54:26 +01:00
Makefile.glsl.am glsl: Add a lowering pass for 64-bit integer multiplication 2017-01-20 15:41:23 -08:00
Makefile.nir.am compiler: avoid warning about redefinition of PYTHON_GEN 2016-10-26 14:54:26 +01:00
Makefile.sources glsl: Add a lowering pass for 64-bit integer multiplication 2017-01-20 15:41:23 -08:00
nir_types.cpp nir: Add a C wrapper for glsl_type::is_array_of_arrays(). 2016-11-19 12:30:26 -08:00
nir_types.h nir: Add GLSL_TYPE_INT64 and GLSL_TYPE_UINT64 to glsl_get_bit_size 2017-01-20 15:41:23 -08:00
SConscript glsl: Generate ir_expression_operation.h from Python 2016-08-30 16:28:00 -07:00
SConscript.glsl mesa: Remove prog_hash_table.c 2016-09-12 10:48:35 +10:00
SConscript.nir glsl: Generate ir_expression_operation.h from Python 2016-08-30 16:28:00 -07:00
shader_enums.c compiler: add printable values for cull distance varyings. 2016-10-04 10:15:23 +10:00
shader_enums.h mesa: Introduce a compiler enum for tessellation spacing. 2017-01-07 22:22:28 -08:00
shader_info.h compiler: Merge shader_info's tcs and tes structs. 2017-01-10 13:21:21 -08:00