[Mesa-stable] [Mesa-dev] [PATCH 1/2] glsl: Don't copy propagate from SSBO or shared variables either

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Wed Jun 13 17:09:48 UTC 2018


Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>

On Tue, Jun 12, 2018 at 03:48:13PM -0700, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Since SSBOs can be written, copy propagating a read can cause the

Optional: maybe write "... can be written by other threads"?

> value to magically change.  SSBO reads are also very expensive, so
> doing it twice will be slower.
> 
> Haswell, Broadwell, and Skylake had similar results. (Skylake shown)
> total instructions in shared programs: 14399120 -> 14399119 (<.01%)
> instructions in affected programs: 684 -> 683 (-0.15%)
> helped: 1
> HURT: 0
> 
> total cycles in shared programs: 532978931 -> 532973113 (<.01%)
> cycles in affected programs: 530484 -> 524666 (-1.10%)
> helped: 1
> HURT: 0
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> Cc: mesa-stable at lists.freedesktop.org
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106774
> ---
>  src/compiler/glsl/opt_copy_propagation.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/compiler/glsl/opt_copy_propagation.cpp b/src/compiler/glsl/opt_copy_propagation.cpp
> index 6220aa86da9..206dffe4f1c 100644
> --- a/src/compiler/glsl/opt_copy_propagation.cpp
> +++ b/src/compiler/glsl/opt_copy_propagation.cpp
> @@ -347,6 +347,8 @@ ir_copy_propagation_visitor::add_copy(ir_assignment *ir)
>     if (lhs_var != NULL && rhs_var != NULL && lhs_var != rhs_var) {
>        if (lhs_var->data.mode != ir_var_shader_storage &&
>            lhs_var->data.mode != ir_var_shader_shared &&
> +          rhs_var->data.mode != ir_var_shader_storage &&
> +          rhs_var->data.mode != ir_var_shader_shared &&
>            lhs_var->data.precise == rhs_var->data.precise) {
>           _mesa_hash_table_insert(acp, lhs_var, rhs_var);
>        }
> -- 
> 2.14.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list