Re: [Mesa-dev] [PATCH 2/3] radv: make use of nir_move_out_const_to_consumer()

2018-11-13 Thread Samuel Pitoiset

Reviewed-by: Samuel Pitoiset 

On 11/7/18 5:20 AM, Timothy Arceri wrote:

vkpipeline-db results:

Totals from affected shaders:
SGPRS: 28400 -> 28576 (0.62 %)
VGPRS: 27916 -> 27692 (-0.80 %)
Spilled SGPRs: 140 -> 138 (-1.43 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1534456 -> 1520560 (-0.91 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 3541 -> 3582 (1.16 %)
Wait states: 0 -> 0 (0.00 %)
---
  src/amd/vulkan/radv_pipeline.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bced19573c1..12e7f43bde7 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1814,6 +1814,10 @@ radv_link_shaders(struct radv_pipeline *pipeline, 
nir_shader **shaders)
nir_lower_io_arrays_to_elements(ordered_shaders[i],
ordered_shaders[i - 1]);
  
+		if (nir_move_out_const_to_consumer(ordered_shaders[i],

+  ordered_shaders[i - 1]))
+   radv_optimize_nir(ordered_shaders[i - 1], false, false);
+
nir_remove_dead_variables(ordered_shaders[i],
  nir_var_shader_out);
nir_remove_dead_variables(ordered_shaders[i - 1],


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


Re: [Mesa-dev] [PATCH 2/3] radv: make use of nir_move_out_const_to_consumer()

2018-11-07 Thread Timothy Arceri
On 7/11/18 7:40 pm, Samuel Pitoiset wrot> On 11/7/18 5:20 AM, Timothy 
Arceri wrote:

vkpipeline-db results:

Totals from affected shaders:
SGPRS: 28400 -> 28576 (0.62 %)
VGPRS: 27916 -> 27692 (-0.80 %)
Spilled SGPRs: 140 -> 138 (-1.43 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1534456 -> 1520560 (-0.91 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 3541 -> 3582 (1.16 %)
Wait states: 0 -> 0 (0.00 %)
---
  src/amd/vulkan/radv_pipeline.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c 
b/src/amd/vulkan/radv_pipeline.c

index bced19573c1..12e7f43bde7 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1814,6 +1814,10 @@ radv_link_shaders(struct radv_pipeline 
*pipeline, nir_shader **shaders)

  nir_lower_io_arrays_to_elements(ordered_shaders[i],
  ordered_shaders[i - 1]);
+    if (nir_move_out_const_to_consumer(ordered_shaders[i],
+   ordered_shaders[i - 1]))
+    radv_optimize_nir(ordered_shaders[i - 1], false, false);


Do you really need to optimize the consumer right after?


Yes I believe so, otherwise the nir_remove_dead_variables() pass won't 
work on the consumer and we won't end up removing the varying from 
either shader stage.





+
  nir_remove_dead_variables(ordered_shaders[i],
    nir_var_shader_out);
  nir_remove_dead_variables(ordered_shaders[i - 1],


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


Re: [Mesa-dev] [PATCH 2/3] radv: make use of nir_move_out_const_to_consumer()

2018-11-07 Thread Samuel Pitoiset



On 11/7/18 5:20 AM, Timothy Arceri wrote:

vkpipeline-db results:

Totals from affected shaders:
SGPRS: 28400 -> 28576 (0.62 %)
VGPRS: 27916 -> 27692 (-0.80 %)
Spilled SGPRs: 140 -> 138 (-1.43 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1534456 -> 1520560 (-0.91 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 3541 -> 3582 (1.16 %)
Wait states: 0 -> 0 (0.00 %)


Also, I guess DOW3 is affected? It was with my experimental pass, at least.


---
  src/amd/vulkan/radv_pipeline.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bced19573c1..12e7f43bde7 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1814,6 +1814,10 @@ radv_link_shaders(struct radv_pipeline *pipeline, 
nir_shader **shaders)
nir_lower_io_arrays_to_elements(ordered_shaders[i],
ordered_shaders[i - 1]);
  
+		if (nir_move_out_const_to_consumer(ordered_shaders[i],

+  ordered_shaders[i - 1]))
+   radv_optimize_nir(ordered_shaders[i - 1], false, false);
+
nir_remove_dead_variables(ordered_shaders[i],
  nir_var_shader_out);
nir_remove_dead_variables(ordered_shaders[i - 1],


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


Re: [Mesa-dev] [PATCH 2/3] radv: make use of nir_move_out_const_to_consumer()

2018-11-07 Thread Samuel Pitoiset



On 11/7/18 5:20 AM, Timothy Arceri wrote:

vkpipeline-db results:

Totals from affected shaders:
SGPRS: 28400 -> 28576 (0.62 %)
VGPRS: 27916 -> 27692 (-0.80 %)
Spilled SGPRs: 140 -> 138 (-1.43 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1534456 -> 1520560 (-0.91 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 3541 -> 3582 (1.16 %)
Wait states: 0 -> 0 (0.00 %)
---
  src/amd/vulkan/radv_pipeline.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bced19573c1..12e7f43bde7 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1814,6 +1814,10 @@ radv_link_shaders(struct radv_pipeline *pipeline, 
nir_shader **shaders)
nir_lower_io_arrays_to_elements(ordered_shaders[i],
ordered_shaders[i - 1]);
  
+		if (nir_move_out_const_to_consumer(ordered_shaders[i],

+  ordered_shaders[i - 1]))
+   radv_optimize_nir(ordered_shaders[i - 1], false, false);


Do you really need to optimize the consumer right after?


+
nir_remove_dead_variables(ordered_shaders[i],
  nir_var_shader_out);
nir_remove_dead_variables(ordered_shaders[i - 1],


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


[Mesa-dev] [PATCH 2/3] radv: make use of nir_move_out_const_to_consumer()

2018-11-06 Thread Timothy Arceri
vkpipeline-db results:

Totals from affected shaders:
SGPRS: 28400 -> 28576 (0.62 %)
VGPRS: 27916 -> 27692 (-0.80 %)
Spilled SGPRs: 140 -> 138 (-1.43 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1534456 -> 1520560 (-0.91 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 3541 -> 3582 (1.16 %)
Wait states: 0 -> 0 (0.00 %)
---
 src/amd/vulkan/radv_pipeline.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bced19573c1..12e7f43bde7 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -1814,6 +1814,10 @@ radv_link_shaders(struct radv_pipeline *pipeline, 
nir_shader **shaders)
nir_lower_io_arrays_to_elements(ordered_shaders[i],
ordered_shaders[i - 1]);
 
+   if (nir_move_out_const_to_consumer(ordered_shaders[i],
+  ordered_shaders[i - 1]))
+   radv_optimize_nir(ordered_shaders[i - 1], false, false);
+
nir_remove_dead_variables(ordered_shaders[i],
  nir_var_shader_out);
nir_remove_dead_variables(ordered_shaders[i - 1],
-- 
2.19.1

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