[Mesa-dev] [PATCH v2] nir: add a comparison simplification
Ian Romanick
idr at freedesktop.org
Fri Mar 16 14:35:41 UTC 2018
On 03/16/2018 01:58 AM, Timothy Arceri wrote:
>
>
> On 16/03/18 19:34, Samuel Pitoiset wrote:
>>
>>
>> On 03/16/2018 09:15 AM, Timothy Arceri wrote:
>>> On 16/03/18 18:45, Samuel Pitoiset wrote:
>>>> shader stats?
>>>
>>> I didn't bother posting them because they are misleading. There are a
>>> few instructions remove here and there but the main changes are due
>>> to loop unrolling.
>>>
>>> Totals from affected shaders:
>>> SGPRS: 640 -> 664 (3.75 %)
>>> VGPRS: 352 -> 368 (4.55 %)
>>> Spilled SGPRs: 6 -> 8 (33.33 %)
>>> Spilled VGPRs: 0 -> 0 (0.00 %)
>>> Private memory VGPRs: 0 -> 0 (0.00 %)
>>> Scratch size: 0 -> 0 (0.00 %) dwords per thread
>>> Code Size: 24200 -> 36216 (49.65 %) bytes
>>> LDS: 0 -> 0 (0.00 %) blocks
>>> Max Waves: 52 -> 51 (-1.92 %)
>>> Wait states: 0 -> 0 (0.00 %)
>>
>> Mmmh, the stats don't seem really good to me. Which games are affected
>> by this change?
>
> Just Tomb Raider.
>
>>
>> As you know, we shouldn't *always* trust shader stats. Though, it
>> would quite appreciated to run some benchmarks in this situation.
>
> I've benchmarked it and there was no change. The stats are misleading
> because register and code size increase but that is an expected outcome
> of loop unrolling. At the end of the day this is a clear simplification
> of logic, any bad outcome would indicate we should tune loop unrolling
> rather than reject this patch IMO.
For Intel runs of shader-db, our script doesn't count shaders that had
loops change in the instruction count changes. :)
>>>> On 03/16/2018 06:48 AM, Timothy Arceri wrote:
>>>>> These can be found in the Tomb Raider shaders, eliminating them
>>>>> helps unroll more loops.
>>>>> ---
>>>>> src/compiler/nir/nir_opt_algebraic.py | 1 +
>>>>> 1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/src/compiler/nir/nir_opt_algebraic.py
>>>>> b/src/compiler/nir/nir_opt_algebraic.py
>>>>> index c9575e6be4..2148bc121b 100644
>>>>> --- a/src/compiler/nir/nir_opt_algebraic.py
>>>>> +++ b/src/compiler/nir/nir_opt_algebraic.py
>>>>> @@ -152,6 +152,7 @@ optimizations = [
>>>>> (('inot', ('ige', a, b)), ('ilt', a, b)),
>>>>> (('inot', ('ieq', a, b)), ('ine', a, b)),
>>>>> (('inot', ('ine', a, b)), ('ieq', a, b)),
>>>>> + (('ine', ('b2i', 'a at bool'), 0), 'a'),
>>>>> # 0.0 >= b2f(a)
>>>>> # b2f(a) <= 0.0
>>>>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the mesa-dev
mailing list