[Mesa-dev] [PATCH 0/9] NIR: Several optimization patches

Jason Ekstrand jason at jlekstrand.net
Mon Mar 23 20:13:00 PDT 2015


This series contains several optimization-related patches that are all
focussed around being able to do better at emitting MAD instructions.

Final shader-db results for the whole series on Haswell:

   total NIR instructions in shared programs: 2183472 -> 2152911 (-1.40%)
   NIR instructions in affected programs:     1299664 -> 1269103 (-2.35%)
   helped:                                    7106
   HURT:                                      321

   total FS instructions in shared programs:  4419884 -> 4378433 (-0.94%)
   FS instructions in affected programs:      1895564 -> 1854113 (-2.19%)
   helped:                                    10025
   HURT:                                      221
   GAINED:                                    81
   LOST:                                      8

There is one notable place where this hurts us.  There are three shaders in
Kerbal Space Program that now spill.  However, this does not seem to be the
fault of NIR.  See patch 8 for more details.

Jason Ekstrand (9):
  nir/algebraic: #define around structure definitions
  nir/algebraic: Add a seperate section for "late" optimizations
  i965/nir: Use the late optimizations
  nir: Move the compare-with-zero optimizations to the late section
  nir: Add a dedicated ffma peephole optimization
  i965/nir: Use the dedicated ffma peephole
  nir/peephole_ffma: Be less agressive about fusing multiply-adds
  i965/nir: Run the ffma peephole after the rest of the optimizations
  i965: Use the same nir options for all gens

 src/glsl/Makefile.sources                |   1 +
 src/glsl/nir/nir.h                       |   1 +
 src/glsl/nir/nir_algebraic.py            |  17 +-
 src/glsl/nir/nir_opt_algebraic.py        |  20 ++-
 src/glsl/nir/nir_opt_peephole_ffma.c     | 261 +++++++++++++++++++++++++++++++
 src/mesa/drivers/dri/i965/brw_context.c  |  11 +-
 src/mesa/drivers/dri/i965/brw_fs_nir.cpp |  11 ++
 7 files changed, 300 insertions(+), 22 deletions(-)
 create mode 100644 src/glsl/nir/nir_opt_peephole_ffma.c

-- 
2.3.3



More information about the mesa-dev mailing list