[Mesa-dev] [PATCH 2/5] glsl: Remove bonus tree walking in opt_constant_folding().

Ian Romanick idr at freedesktop.org
Mon May 9 17:43:02 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 05/09/2016 08:50 AM, Kenneth Graunke wrote:
> It looks like this was missed when converting opt_constant_folding()
> from a hierarchical visitor to an rvalue visitor in 6606fde3.
> 
> ir_rvalue_visitor already processes values on the way back up the tree,
> so we will have already visited every child node.  There's no point in
> doing it again.
> 
> No change in shader-db.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  src/compiler/glsl/opt_constant_folding.cpp | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/src/compiler/glsl/opt_constant_folding.cpp b/src/compiler/glsl/opt_constant_folding.cpp
> index 150a17b..de13c9e 100644
> --- a/src/compiler/glsl/opt_constant_folding.cpp
> +++ b/src/compiler/glsl/opt_constant_folding.cpp
> @@ -89,8 +89,6 @@ ir_constant_folding_visitor::handle_rvalue(ir_rvalue **rvalue)
>     if (constant) {
>        *rvalue = constant;
>        this->progress = true;
> -   } else {
> -      (*rvalue)->accept(this);
>     }
>  }
>  
> 



More information about the mesa-dev mailing list