Re: [Mesa-dev] [PATCH] glsl: Small optimization for constant conditionals

2014-04-17 Thread Iago Toral
Hi Kenneth, El 2014-04-17 08:57, Kenneth Graunke escribió: On 04/15/2014 03:30 AM, Iago Toral Quiroga wrote: Once the relevant branch has been identified do not iterate over the instructions in the branch, do a linked list insertion instead to avoid the loop. --- src/glsl/opt_if_simplificati

Re: [Mesa-dev] [PATCH] glsl: Small optimization for constant conditionals

2014-04-16 Thread Kenneth Graunke
On 04/15/2014 03:30 AM, Iago Toral Quiroga wrote: > Once the relevant branch has been identified do not iterate over the > instructions in the branch, do a linked list insertion instead to avoid the > loop. > --- > src/glsl/opt_if_simplification.cpp | 10 ++ > 1 file changed, 2 insertions(

[Mesa-dev] [PATCH] glsl: Small optimization for constant conditionals

2014-04-15 Thread Iago Toral Quiroga
Once the relevant branch has been identified do not iterate over the instructions in the branch, do a linked list insertion instead to avoid the loop. --- src/glsl/opt_if_simplification.cpp | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/glsl/opt_if_simplificatio

[Mesa-dev] [PATCH] glsl: Small optimization for constant conditionals

2014-04-15 Thread Iago Toral Quiroga
We are traversing the relevant branch manually with a for loop to insert the instructions one by one. I think we can insert all the instructions in a single operation using a list insert instead. One thing to notice, the insert_before() method for lists will call make_empty() on the passed list af