mesa/src/compiler
Ian Romanick 619c51722b nir: Add some missing "optimization undo" patterns
d8d18516b0 and 03fb13f646 added some patterns to undo conversions like

   (('ior', ('flt', a, b), ('flt', a, c)), ('flt', a, ('fmax', b, c)))

If further optimization cause some of the operands to either be the same
or be constants, undoing the transformation can lead to further savings.

I don't know why these patterns were not added in those patches.  I did
not check to see which specific patterns actually helped.  I just added
all of them for symmetry.  This prevents some loop unrolling regressions
Plane Shift caused by Samuel's "nir: implement the GLSL equivalent of if
simplication in nir_opt_if" patch.

Skylake and Broadwell had similar results. (Skylake shown)
total instructions in shared programs: 14369768 -> 14369557 (<.01%)
instructions in affected programs: 44076 -> 43865 (-0.48%)
helped: 141
HURT: 0
helped stats (abs) min: 1 max: 5 x̄: 1.50 x̃: 1
helped stats (rel) min: 0.07% max: 1.52% x̄: 0.66% x̃: 0.60%
95% mean confidence interval for instructions value: -1.67 -1.32
95% mean confidence interval for instructions %-change: -0.72% -0.59%
Instructions are helped.

total cycles in shared programs: 532430629 -> 532425772 (<.01%)
cycles in affected programs: 1170832 -> 1165975 (-0.41%)
helped: 101
HURT: 5
helped stats (abs) min: 1 max: 160 x̄: 48.54 x̃: 32
helped stats (rel) min: <.01% max: 8.49% x̄: 2.76% x̃: 2.03%
HURT stats (abs)   min: 2 max: 22 x̄: 9.20 x̃: 4
HURT stats (rel)   min: <.01% max: 0.05% x̄: 0.02% x̃: <.01%
95% mean confidence interval for cycles value: -53.64 -38.00
95% mean confidence interval for cycles %-change: -3.06% -2.20%
Cycles are helped.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2018-06-01 10:13:16 -07:00
..
glsl glsl: Add ir_binop_vector_extract in NIR 2018-06-01 18:09:22 +02:00
nir nir: Add some missing "optimization undo" patterns 2018-06-01 10:13:16 -07:00
spirv compiler/spirv: reject invalid shader code properly 2018-06-01 08:09:35 -07:00
.gitignore nir/spirv: Remove a duplicate spirv2nir from .gitignore 2016-10-04 07:43:15 -07:00
Android.glsl.gen.mk Android: clean-up trailing '\' in make variables 2017-03-22 17:52:06 +00:00
Android.glsl.mk android: glsl: build shader cache sources 2017-02-20 16:30:37 +00: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 android: Use new nir intrinsics python scripts 2018-03-28 14:48:47 +03:00
Android.nir.mk android: fix libmesa_nir build 2017-07-21 08:47:56 +03:00
blob.c blob: Don't set overrun if reading 0 bytes at end of data 2017-10-31 23:36:54 -07:00
blob.h blob: Use intptr_t instead of ssize_t 2017-10-13 15:02:34 -07:00
builtin_type_macros.h glsl_types: vec8/vec16 support 2018-03-25 10:42:54 -04:00
glsl_types.cpp glsl: prevent spurious Valgrind errors when serializing NIR 2018-04-20 09:21:23 +02:00
glsl_types.h mesa: include mtypes.h less 2018-04-12 19:31:30 -04:00
Makefile.am autotools: Include new meson files 2018-04-20 20:26:56 -07:00
Makefile.glsl.am compiler: All leaf Makefile.am should use += 2018-03-29 14:09:41 -07:00
Makefile.nir.am nir: Fix a typo in src/compiler/Makefile.nir.am 2018-04-09 08:32:45 -06:00
Makefile.sources nir: Add the start of a format conversion helper header 2018-05-09 11:16:33 -07:00
Makefile.spirv.am spirv: autotools: add vtn_gather_types_c.py in distribution tarball 2018-04-10 10:37:46 +02:00
meson.build meson: remove dummy_cpp 2018-04-24 14:08:15 -07:00
nir_types.cpp glsl_types: vec8/vec16 support 2018-03-25 10:42:54 -04:00
nir_types.h compiler: int8/uint8 support 2018-03-14 10:08:42 -04:00
SConscript spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
SConscript.glsl mesa: Remove prog_hash_table.c 2016-09-12 10:48:35 +10:00
SConscript.nir nir: mako all the intrinsics 2018-03-27 08:36:37 -04:00
SConscript.spirv spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
shader_enums.c compiler: Add SYSTEM_VALUE_IS_INDEXED_DRAW and instrinsics 2018-05-02 11:20:40 +02:00
shader_enums.h compiler: Add SYSTEM_VALUE_IS_INDEXED_DRAW and instrinsics 2018-05-02 11:20:40 +02:00
shader_info.h mesa: Add GL/GLSL plumbing for ARB_fragment_shader_interlock. 2018-06-01 16:36:36 +01:00