[Mesa-dev] [PATCH] nir: add is_used_once for fmul(fexp2(a), fexp2(b)) to fexp2(fadd(a, b))

Ian Romanick idr at freedesktop.org
Thu Feb 15 01:49:27 UTC 2018


On 02/14/2018 05:36 PM, Ian Romanick wrote:
> Do you have shader-db results?  Did you try having only one is_used_once?

I think you sent out a hastebin link with results before, but it's not
loading now.

> On 02/05/2018 07:07 AM, Samuel Pitoiset wrote:
>> Otherwise the code size increases because the original fexp2()
>> instructions can't be deleted.
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>  src/compiler/nir/nir_opt_algebraic.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py
>> index b30d1df199..d40d59b5cd 100644
>> --- a/src/compiler/nir/nir_opt_algebraic.py
>> +++ b/src/compiler/nir/nir_opt_algebraic.py
>> @@ -336,7 +336,7 @@ optimizations = [
>>     (('~flog2', ('frcp', a)), ('fneg', ('flog2', a))),
>>     (('~flog2', ('frsq', a)), ('fmul', -0.5, ('flog2', a))),
>>     (('~flog2', ('fpow', a, b)), ('fmul', b, ('flog2', a))),
>> -   (('~fmul', ('fexp2', a), ('fexp2', b)), ('fexp2', ('fadd', a, b))),
>> +   (('~fmul', ('fexp2(is_used_once)', a), ('fexp2(is_used_once)', b)), ('fexp2', ('fadd', a, b))),
>>     # Division and reciprocal
>>     (('~fdiv', 1.0, a), ('frcp', a)),
>>     (('fdiv', a, b), ('fmul', a, ('frcp', b)), 'options->lower_fdiv'),
>>
> 
> _______________________________________________
> 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