Re: [Mesa-dev] [PATCH v3] glsl: Optimize min/max expression trees

2014-09-30 Thread Iago Toral Quiroga
On lun, 2014-09-29 at 13:19 -0400, Connor Abbott wrote: On Mon, Sep 29, 2014 at 7:49 AM, Iago Toral Quiroga ito...@igalia.com wrote: Original patch by Petri Latvala petri.latv...@intel.com: Add an optimization pass that drops min/max expression operands that can be proven to not

Re: [Mesa-dev] [PATCH v3] glsl: Optimize min/max expression trees

2014-09-30 Thread Iago Toral Quiroga
I just noticed that we should add: index a4fe2bd..ca53eb8 100644 --- a/src/glsl/opt_minmax.cpp +++ b/src/glsl/opt_minmax.cpp @@ -415,6 +415,17 @@ ir_minmax_visitor::prune_expression(ir_expression *expr, minmax_range baserange) } } + /* If we got here we could not discard any of

[Mesa-dev] [PATCH v3] glsl: Optimize min/max expression trees

2014-09-29 Thread Iago Toral Quiroga
Original patch by Petri Latvala petri.latv...@intel.com: Add an optimization pass that drops min/max expression operands that can be proven to not contribute to the final result. The algorithm is similar to alpha-beta pruning on a minmax search, from the field of AI. This optimization pass can

Re: [Mesa-dev] [PATCH v3] glsl: Optimize min/max expression trees

2014-09-29 Thread Connor Abbott
On Mon, Sep 29, 2014 at 7:49 AM, Iago Toral Quiroga ito...@igalia.com wrote: Original patch by Petri Latvala petri.latv...@intel.com: Add an optimization pass that drops min/max expression operands that can be proven to not contribute to the final result. The algorithm is similar to