[Mesa-dev] [PATCH 0/2] nir/algebraic: Rewrite bit-size handling

Connor Abbott cwabbott0 at gmail.com
Thu Nov 29 18:32:01 UTC 2018


While nir_algebraic in general is great, the code to implement bit-size
inference has always been pretty fragile. While I was trying to remember
how everything worked in order to review Jason's patches touching this
area, I realized that I could make the whole thing significantly
simpler. This series is the end result of that. Since I was nice, I also
included some tests to exercise all the different errors you can hit. It
conflicts a little bit with Jason's series, since the bit size inference
algorithm has to be aware of the new sizeless comparison operators, but
I won't think it'll be too bad. And it means that I don't have to review
the trickiest prep patches for that series :)

This series is available at:
https://gitlab.freedesktop.org/cwabbott0/mesa/commits/nir-bitsize-validator-rewrite
It might be better to go there to see the final version of the
BitSizeValidator, since that part of the diff won't be too helpful.

Finally, I haven't actually tested the compiled mesa, but I'm working on
it :) It would be good to give this a run through the Intel CI.

Connor Abbott (2):
  nir/algebraic: Rewrite bit-size inference
  nir/algebraic: Add unit tests for bitsize validation

 src/compiler/Makefile.nir.am                  |   4 +-
 src/compiler/nir/meson.build                  |   7 +
 src/compiler/nir/nir_algebraic.py             | 518 ++++++++++--------
 src/compiler/nir/nir_search.c                 | 146 +----
 src/compiler/nir/nir_search.h                 |   2 +-
 .../nir/tests/algebraic_parser_test.py        | 116 ++++
 .../nir/tests/algebraic_parser_test.sh        |   3 +
 7 files changed, 424 insertions(+), 372 deletions(-)
 create mode 100644 src/compiler/nir/tests/algebraic_parser_test.py
 create mode 100644 src/compiler/nir/tests/algebraic_parser_test.sh

-- 
2.17.2



More information about the mesa-dev mailing list