Re: [Mesa-dev] [PATCH 00/11 v2] TGSI: improved live range tracking, also including arrays

2018-04-01 Thread Gert Wollny
Am Freitag, den 30.03.2018, 17:05 +0200 schrieb Dieter Nützel:
> Am 30.03.2018 17:01, schrieb Ilia Mirkin:
> > On Fri, Mar 30, 2018 at 10:33 AM, Dieter Nützel  > de> 
> > wrote:
> > > For the series:
> > > 
> > > Tested-by: Dieter Nützel 
> > > 
> > > with glmark2, UH, UV, KDE Plasma5 (my desktop)
> > > R600_DEBUG=sisched,nir
> > > but on radeonsi, Polaris 20 (RX580) not r600 ;-)
> > 
> > This series is relevant to TGSI. However you're forcing the nir
> > path.
> > Your testing was largely a no-op, I'm afraid.
> > 
> >   -ilia
> 
> Oh dear, yes shit ;-)
> I'll retry without 'nir' then...

Thanks for the effort in testing this series, but on radeonsi also on
the TGSI path this series is mostly irrelevant, because apart from the
first patch it is only enabled when the driver doesn't request skipping
"merge_registers" and radionsi is one of the drivers who does return a
non-zero value for PIPE_SHADER_CAP_TGSI_SKIP_MERGE_REGISTERS (I guess
the llvm backend takes care of this optimization anyway).

Best, 
Gert

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/11 v2] TGSI: improved live range tracking, also including arrays

2018-03-30 Thread Dieter Nützel

Am 30.03.2018 17:01, schrieb Ilia Mirkin:
On Fri, Mar 30, 2018 at 10:33 AM, Dieter Nützel  
wrote:

For the series:

Tested-by: Dieter Nützel 

with glmark2, UH, UV, KDE Plasma5 (my desktop)
R600_DEBUG=sisched,nir
but on radeonsi, Polaris 20 (RX580) not r600 ;-)


This series is relevant to TGSI. However you're forcing the nir path.
Your testing was largely a no-op, I'm afraid.

  -ilia


Oh dear, yes shit ;-)
I'll retry without 'nir' then...

Argh.

Dieter
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/11 v2] TGSI: improved live range tracking, also including arrays

2018-03-30 Thread Ilia Mirkin
On Fri, Mar 30, 2018 at 10:33 AM, Dieter Nützel  wrote:
> For the series:
>
> Tested-by: Dieter Nützel 
>
> with glmark2, UH, UV, KDE Plasma5 (my desktop)
> R600_DEBUG=sisched,nir
> but on radeonsi, Polaris 20 (RX580) not r600 ;-)

This series is relevant to TGSI. However you're forcing the nir path.
Your testing was largely a no-op, I'm afraid.

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 00/11 v2] TGSI: improved live range tracking, also including arrays

2018-03-30 Thread Dieter Nützel

For the series:

Tested-by: Dieter Nützel 

with glmark2, UH, UV, KDE Plasma5 (my desktop)
R600_DEBUG=sisched,nir
but on radeonsi, Polaris 20 (RX580) not r600 ;-)

GREAT work Gert!

Dieter

Am 26.03.2018 11:27, schrieb Gert Wollny:

Dear all,

this is the merged version of two series [1] (TGSI: split, merge
and interleave arrays) and [2] (mesa/st/glsl_to_tgsi: Properly
resolve life times for simple if/else + use constructs) I sent
earlier. Considering that both parts target the same optimization
step and fix a bug if both are applied, I thought it is better to
add this second patch to the series. Changes refer to v1 of [1]:

v2:
 - rebase patches to latest HEAD
 - add some code that allows obtaining some statistics about register
   and instruction usage
 - Add patch [2] that improves resolving the live range estimation with
   simple if/else and use constructs. By adding this patch the series
   fixes https://bugs.freedesktop.org/show_bug.cgi?id=105371

 v1:
Patch 1: Split arrays that are only accessed directly:
I posted a first version off the the array splitting in patch 1 some
time ago. Eric Anholt pointed out that this might be done in
opt_array_splitting.cpp, but in another comment Timothy pointed out
that this is far from trivial, and he also pointed out that he was
proposing similar patches for NIR, but since currently no NIR->TGSI
transformation is available, TGSI based drivers can't make use of this.

While the reminder off the series could be applied without this patch, 
I
think it makes less sense to do all the optimizations on arrays that 
could
simply be split into individual registers, so I repost the patch with 
some

changes.

I tried to be exhaustive with comments and make the variable any type 
names
self-explaining, but since I've been staring at this code for a long 
time I
don't think I am capable of seeing any problems any more, so comments 
are very

welcome.

Best,
Gert

PS: I have no git write access.


[1] https://patchwork.freedesktop.org/series/37991/
[2] https://patchwork.freedesktop.org/series/39471/

Gert Wollny (11):
  mesa/st: glsl_to_tgsi: Split arrays who's elements are only accessed
directly
  mesa/st/glsl_to_tgsi: rename lifetime to register_live_range
  mesa/st: Add helper classes for array merging and interleaving
  mesa/st/glsl_to_tgsi: Add class to hold array information
  mesa/st/glsl_to_tgsi: Add array merge logic
  mesa/st/tests: Add unit tests for array merge helper classes.
  mesa/st/glsl_to_tgsi: refactor access_record and its use
  mesa/st/glsl_to_tgsi: move evaluation of read mask up in the call
hierarchy
  mesa/st/glsl_to_tgsi: add class for array access tracking
  mesa/st/glsl_to_tgsi: add array life range evaluation into tracking
code
  mesa/st/glsl_to_tgsi: Expose array live range tracking and merging

 src/mesa/Makefile.sources  |   2 +
 src/mesa/meson.build   |   2 +
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 144 +++-
 .../state_tracker/st_glsl_to_tgsi_array_merge.cpp  | 735 
+

 .../state_tracker/st_glsl_to_tgsi_array_merge.h| 186 ++
 .../state_tracker/st_glsl_to_tgsi_temprename.cpp   | 290 +---
 .../state_tracker/st_glsl_to_tgsi_temprename.h |  47 +-
 src/mesa/state_tracker/tests/Makefile.am   |  20 +-
 src/mesa/state_tracker/tests/st_tests_common.cpp   |  25 +-
 src/mesa/state_tracker/tests/st_tests_common.h |  20 +-
 .../tests/test_glsl_to_tgsi_array_merge.cpp| 296 +
 .../tests/test_glsl_to_tgsi_lifetime.cpp   |  10 +-
 12 files changed, 1644 insertions(+), 133 deletions(-)
 create mode 100644 
src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp
 create mode 100644 
src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h

 create mode 100644
src/mesa/state_tracker/tests/test_glsl_to_tgsi_array_merge.cpp

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 00/11 v2] TGSI: improved live range tracking, also including arrays

2018-03-26 Thread Gert Wollny
Dear all, 

this is the merged version of two series [1] (TGSI: split, merge 
and interleave arrays) and [2] (mesa/st/glsl_to_tgsi: Properly 
resolve life times for simple if/else + use constructs) I sent
earlier. Considering that both parts target the same optimization 
step and fix a bug if both are applied, I thought it is better to 
add this second patch to the series. Changes refer to v1 of [1]: 

v2: 
 - rebase patches to latest HEAD
 - add some code that allows obtaining some statistics about register
   and instruction usage
 - Add patch [2] that improves resolving the live range estimation with 
   simple if/else and use constructs. By adding this patch the series 
   fixes https://bugs.freedesktop.org/show_bug.cgi?id=105371

 v1: 
Patch 1: Split arrays that are only accessed directly:  
I posted a first version off the the array splitting in patch 1 some 
time ago. Eric Anholt pointed out that this might be done in 
opt_array_splitting.cpp, but in another comment Timothy pointed out 
that this is far from trivial, and he also pointed out that he was 
proposing similar patches for NIR, but since currently no NIR->TGSI 
transformation is available, TGSI based drivers can't make use of this. 

While the reminder off the series could be applied without this patch, I 
think it makes less sense to do all the optimizations on arrays that could 
simply be split into individual registers, so I repost the patch with some 
changes. 

I tried to be exhaustive with comments and make the variable any type names 
self-explaining, but since I've been staring at this code for a long time I
don't think I am capable of seeing any problems any more, so comments are very 
welcome.

Best, 
Gert 

PS: I have no git write access. 


[1] https://patchwork.freedesktop.org/series/37991/ 
[2] https://patchwork.freedesktop.org/series/39471/

Gert Wollny (11):
  mesa/st: glsl_to_tgsi: Split arrays who's elements are only accessed
directly
  mesa/st/glsl_to_tgsi: rename lifetime to register_live_range
  mesa/st: Add helper classes for array merging and interleaving
  mesa/st/glsl_to_tgsi: Add class to hold array information
  mesa/st/glsl_to_tgsi: Add array merge logic
  mesa/st/tests: Add unit tests for array merge helper classes.
  mesa/st/glsl_to_tgsi: refactor access_record and its use
  mesa/st/glsl_to_tgsi: move evaluation of read mask up in the call
hierarchy
  mesa/st/glsl_to_tgsi: add class for array access tracking
  mesa/st/glsl_to_tgsi: add array life range evaluation into tracking
code
  mesa/st/glsl_to_tgsi: Expose array live range tracking and merging

 src/mesa/Makefile.sources  |   2 +
 src/mesa/meson.build   |   2 +
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 144 +++-
 .../state_tracker/st_glsl_to_tgsi_array_merge.cpp  | 735 +
 .../state_tracker/st_glsl_to_tgsi_array_merge.h| 186 ++
 .../state_tracker/st_glsl_to_tgsi_temprename.cpp   | 290 +---
 .../state_tracker/st_glsl_to_tgsi_temprename.h |  47 +-
 src/mesa/state_tracker/tests/Makefile.am   |  20 +-
 src/mesa/state_tracker/tests/st_tests_common.cpp   |  25 +-
 src/mesa/state_tracker/tests/st_tests_common.h |  20 +-
 .../tests/test_glsl_to_tgsi_array_merge.cpp| 296 +
 .../tests/test_glsl_to_tgsi_lifetime.cpp   |  10 +-
 12 files changed, 1644 insertions(+), 133 deletions(-)
 create mode 100644 src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.cpp
 create mode 100644 src/mesa/state_tracker/st_glsl_to_tgsi_array_merge.h
 create mode 100644 
src/mesa/state_tracker/tests/test_glsl_to_tgsi_array_merge.cpp

-- 
2.13.6

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev