[Mesa-dev] [PATCH v7 0/6] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation
Gert Wollny
gw.fossdev at gmail.com
Mon Jul 17 15:47:22 UTC 2017
Hello Nicolai,
many thanks for the review. With this new patch set I've implemented most of your
suggestions, patch 1 and 6 are only rebased though.
The patches are also available via
https://github.com/gerddie/mesa/tree/regrename-v7
The one thing I did not do (or better said, I reverted it) is using
_mesa_register_file_name in the debug output because the names returned are not
correct for the TGSI file indices I have access to there.
Piglit doesn't show any regressions and the changes are:
- Rebase to 9ee67467
- Correct documentation of GLSL_TO_TGSI_RENAME_DEBUG in commit message.
- Fix typos, include files, formatting, and some variable names.
- Add anonymous namespace around classes.
- Replace debug_log singleton by a function.
- Cleanup the switch-case scope creation.
- Track switch variable only for SWITCH statement.
- Add test case with switch in loop that has a case where the register is
written, then falls through where it is read and correct code accordingly.
Specifically, this showed that you were right that the scope of the
case that falls through must not be extended.
- Add test case for more then one break in loop and make sure the first break
is used for life-time tracking.
- Simplify access flag tracking and merging.
- Drop special handling of registers that are only read, i.e. treat them like
unused registers since renumber_registers will do this anyway.
- Simplify the enclosing scope resolution.
- Handle TEMP[0] just like the others. Somehow I had the idea that TEMP[0] is
special and should not be touched, and the debug output running various
programs and also from piglit shaders doesn't show TEMP[0] as used.
- Optimize renaming evaluation by only copying used registers to the
reg_access array that is used for the evaluation.
Best,
Gert
Gert Wollny (6):
mesa/st: glsl_to_tgsi move some helper classes to extra files
mesa/st: glsl_to_tgsi: implement new temporary register lifetime tracker
mesa/st: glsl_to_tgsi: add tests for the new temporary lifetime tracker
mesa/st: glsl_to_tgsi: add register rename mapping evaluator
mesa/st: glsl_to_tgsi: Add test set for evaluation of rename mapping
mesa/st: glsl_to_tgsi: tie in new temporary register merge approach
configure.ac | 1 +
src/mesa/Makefile.am | 2 +-
src/mesa/Makefile.sources | 4 +
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 344 +----
src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp | 196 +++
src/mesa/state_tracker/st_glsl_to_tgsi_private.h | 167 ++
.../state_tracker/st_glsl_to_tgsi_temprename.cpp | 992 ++++++++++++
.../state_tracker/st_glsl_to_tgsi_temprename.h | 67 +
src/mesa/state_tracker/tests/Makefile.am | 36 +
.../tests/test_glsl_to_tgsi_lifetime.cpp | 1597 ++++++++++++++++++++
10 files changed, 3073 insertions(+), 333 deletions(-)
create mode 100644 src/mesa/state_tracker/st_glsl_to_tgsi_private.cpp
create mode 100644 src/mesa/state_tracker/st_glsl_to_tgsi_private.h
create mode 100644 src/mesa/state_tracker/st_glsl_to_tgsi_temprename.cpp
create mode 100644 src/mesa/state_tracker/st_glsl_to_tgsi_temprename.h
create mode 100644 src/mesa/state_tracker/tests/Makefile.am
create mode 100644 src/mesa/state_tracker/tests/test_glsl_to_tgsi_lifetime.cpp
--
2.13.0
More information about the mesa-dev
mailing list