Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-28 Thread Jan Ziak
I would like to mention that the response Ian posted was/is a nice read. I am not sure what to write in response. Let me just note that adding formalisms to Mesa would lead to both higher performance and higher safety. If you do not want C++ in Mesa, maybe it would be acceptable for Mesa developer

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-19 Thread Eero Tamminen
Hi, On 18.10.2016 20:12, Jan Ziak wrote: [...] Never profile with -O0 or disabled function inlining. Seriously? Nobody's going to take seriously optimization results taken from non-optimized builds. Mesa uses -g -O2 with --enable-debug, so that's what you should use too. Don't use any o

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Michael Schellenberger Costa
Hi Jan, On 18.10.2016 00:07, Jan Ziak wrote: This patch replaces the ir_variable_refcount_entry's linked-list with an array-list. The array-list has local storage which does not require ANY additional allocations if the list has small number of elements. The size of this storage is configurabl

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Ian Romanick
On 10/18/2016 10:12 AM, Jan Ziak wrote: >> Regarding C++ templates, the compiler doesn't use them. If u_vector >> (Dave Airlie?) provides the same functionality as your array, I >> suggest we use u_vector instead. > > Let me repeat what you just wrote, because it is unbelievable: You are > advisin

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
On Tue, Oct 18, 2016 at 8:04 PM, Marek Olšák wrote: > On Tue, Oct 18, 2016 at 7:12 PM, Jan Ziak <0xe2.0x9a.0...@gmail.com> > wrote: > >> Regarding C++ templates, the compiler doesn't use them. If u_vector > >> (Dave Airlie?) provides the same functionality as your array, I > >> suggest we use u_v

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
Perf stat results for shader-db: This is measured on an AMD Kaveri CPU. gcc-6.2.0 -fno-omit-frame-pointer -g -O2 Unpatched: $ cd shader-db $ ../run-upstream perfstat-u --repeat=5 -- ./run -1 shaders >/dev/null Performance counter stats for './run -1 shaders' (5 runs): 13689.962374

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Marek Olšák
On Tue, Oct 18, 2016 at 7:12 PM, Jan Ziak <0xe2.0x9a.0...@gmail.com> wrote: >> Regarding C++ templates, the compiler doesn't use them. If u_vector >> (Dave Airlie?) provides the same functionality as your array, I >> suggest we use u_vector instead. > > Let me repeat what you just wrote, because it

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
> Regarding C++ templates, the compiler doesn't use them. If u_vector > (Dave Airlie?) provides the same functionality as your array, I > suggest we use u_vector instead. Let me repeat what you just wrote, because it is unbelievable: You are advising the use of non-templated collection types in C+

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Marek Olšák
On Tue, Oct 18, 2016 at 3:55 PM, Eero Tamminen wrote: > Hi, > > On 18.10.2016 16:25, Jan Ziak wrote: >> >> On Tue, Oct 18, 2016 at 3:12 PM, Nicolai Hähnle >> wrote: >>> >>> On 18.10.2016 15:07, Jan Ziak wrote: On Tue Oct 18 09:29:59 UTC 2016, Eero Tamminen wrote: > > On 18.10.20

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Eero Tamminen
Hi, On 18.10.2016 16:25, Jan Ziak wrote: On Tue, Oct 18, 2016 at 3:12 PM, Nicolai Hähnle wrote: On 18.10.2016 15:07, Jan Ziak wrote: On Tue Oct 18 09:29:59 UTC 2016, Eero Tamminen wrote: On 18.10.2016 01:07, Jan Ziak wrote: - The total number of executed instructions goes down from 64.184 t

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
Hi Michael, thanks for the suggestions about code formatting. I formatted the whole fast_list.h file in the Netbeans editor and uploaded a new revision of the patch. Jan On Tue, Oct 18, 2016 at 1:42 PM, Michael Schellenberger Costa wrote: > Hi Jan, > > On 18.10.2016 00:07, Jan Ziak wrote: >> >>

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
On Tue, Oct 18, 2016 at 3:32 PM, Emil Velikov wrote: > On 17 October 2016 at 23:07, Jan Ziak <0xe2.0x9a.0...@gmail.com> wrote: > >> - exec_list assign_list; >> + arraylist assign_list; >> > Just an FYI - when people started using C++ for glsl there was an > agreement that templating is not to

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Emil Velikov
On 17 October 2016 at 23:07, Jan Ziak <0xe2.0x9a.0...@gmail.com> wrote: > - exec_list assign_list; > + arraylist assign_list; > Just an FYI - when people started using C++ for glsl there was an agreement that templating is not to be used. Not sure if it still holds true, nowadays. Emil __

[Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
This patch replaces the ir_variable_refcount_entry's linked-list with an array-list. The array-list has local storage which does not require ANY additional allocations if the list has small number of elements. The size of this storage is configurable for each variable. Benchmark results for "./ru

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
On Tue, Oct 18, 2016 at 3:12 PM, Nicolai Hähnle wrote: > On 18.10.2016 15:07, Jan Ziak wrote: >> >> On Tue Oct 18 09:29:59 UTC 2016, Eero Tamminen wrote: >>> >>> On 18.10.2016 01:07, Jan Ziak wrote: - The total number of executed instructions goes down from 64.184 to 63.797 g

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Nicolai Hähnle
On 18.10.2016 15:07, Jan Ziak wrote: On Tue Oct 18 09:29:59 UTC 2016, Eero Tamminen wrote: On 18.10.2016 01:07, Jan Ziak wrote: - The total number of executed instructions goes down from 64.184 to 63.797 giga-instructions when Mesa is compiled with "gcc -O0 ..." Please don't do performance

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Jan Ziak
On Tue Oct 18 09:29:59 UTC 2016, Eero Tamminen wrote: > On 18.10.2016 01:07, Jan Ziak wrote: >> - The total number of executed instructions goes down from 64.184 to 63.797 >> giga-instructions when Mesa is compiled with "gcc -O0 ..." > >Please don't do performance related decisions based on data

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-18 Thread Eero Tamminen
Hi, On 18.10.2016 01:07, Jan Ziak wrote: This patch replaces the ir_variable_refcount_entry's linked-list with an array-list. The array-list has local storage which does not require ANY additional allocations if the list has small number of elements. The size of this storage is configurable for

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-17 Thread Dave Airlie
On 18 October 2016 at 08:45, Thomas Helland wrote: > > 18. okt. 2016 00.07 skrev "Jan Ziak" <0xe2.0x9a.0...@gmail.com>: >> >> This patch replaces the ir_variable_refcount_entry's linked-list >> with an array-list. >> >> The array-list has local storage which does not require ANY additional >> allo

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-17 Thread
On Tue, Oct 18, 2016 at 12:45 AM, Thomas Helland wrote: > I can't quite tell, as Gmail tends to mangle whitespace stuff, > but it looks like there might be some style issues with > not everything following the three-space indent, no tabs > policy that mesa tries to stick to. I followed the 3-spac

Re: [Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-17 Thread Thomas Helland
18. okt. 2016 00.07 skrev "Jan Ziak" <0xe2.0x9a.0...@gmail.com>: > > This patch replaces the ir_variable_refcount_entry's linked-list > with an array-list. > > The array-list has local storage which does not require ANY additional > allocations if the list has small number of elements. The size of

[Mesa-dev] [PATCH] glsl: optimize list handling in opt_dead_code

2016-10-17 Thread Jan Ziak
This patch replaces the ir_variable_refcount_entry's linked-list with an array-list. The array-list has local storage which does not require ANY additional allocations if the list has small number of elements. The size of this storage is configurable for each variable. Benchmark results for "./ru