[Mesa-dev] [PATCH 0/3] NIR constant reassociation

Connor Abbott cwabbott0 at gmail.com
Sat Feb 7 17:05:43 PST 2015

This series extends nir_algebraic/nir_search to support matching on arbitrary
opcodes, and then uses it to implement constant reassociation similar to what
we already do in opt_algebraic. I haven't piglit tested this yet, although I
did verify that it did the right thing in a few simple tests. Note that for
pigliting it might be wise to turn off opt_algebraic since in some cases (but
not all) it will do the same optimization so we don't get a chance to exercise
the code.

This series is also available at

git://people.freedesktop.org/~cwabbott0/mesa nir-reassociate-consts

Connor Abbott (3):
  nir/search: add support for opcode variables
  nir/search: constant fold as we're building expressions
  nir/opt_algebraic: add constant reassociation rules

 src/glsl/nir/nir_algebraic.py     | 68 ++++++++++++++++++++++++++++++-----
 src/glsl/nir/nir_opt_algebraic.py | 10 ++++++
 src/glsl/nir/nir_search.c         | 74 +++++++++++++++++++++++++++++++++++----
 src/glsl/nir/nir_search.h         | 21 ++++++++++-
 4 files changed, 156 insertions(+), 17 deletions(-)


More information about the mesa-dev mailing list