[Mesa-dev] shader-db statistics generation (was: [PATCH 3/4] i965/fs: Optimize (gl_FrontFacing ? x : y)...)

Eero Tamminen eero.t.tamminen at intel.com
Thu Jan 15 00:34:35 PST 2015


Hi,

On 01/15/2015 03:04 AM, Matt Turner wrote:
> On Wed, Jan 14, 2015 at 1:52 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Wed, Jan 14, 2015 at 1:29 PM, Matt Turner <mattst88 at gmail.com> wrote:
>>> glsl: Optimize certain if-statements to just casts from the condition
>>
>> Cherry-picked to master, the shader-db results are
>>
>> total instructions in shared programs: 5965630 -> 5952789 (-0.22%)
>> instructions in affected programs:     737228 -> 724387 (-1.74%)
>> GAINED:                                5
>> LOST:                                  16
>>
>> and we hurt 20 programs: 12 vec4 programs significantly (>68%) and 8
>> SIMD8/16 programs by 1 instruction.
>
> It looks like the vec4 programs have loops that are now able to be
> unrolled, so those are actually improvements.

Out of curiosity, do you always look also at the cases where 
instructions were removed, or do you have some other way to verify that 
something didn't e.g. cause loop unrolling to fail?

Any ideas how the loop unrolling could be reliably be taken into account 
automatically in these statistics?

Maybe with some extra output from compiler which outputs loop counter 
and marks loop start and end so that statistics generator can:
- count number of loops that could / could not be be unrolled
- multiply number of instructions inside loops by loop counter,
   if the counter is a static value


	- Eero




More information about the mesa-dev mailing list