Re: [Mesa-dev] [PATCH] nir: switch fmul to increase chance of optimising it away

2017-01-12 Thread Timothy Arceri
Thinking about it some more I think I can come up with something hopefully much better than this and my other patch "nir: shuffle fmuls to allow const evaluation" combined. On Thu, 2017-01-12 at 15:20 +1100, Timothy Arceri wrote: > If one of the inputs to the multiplcation in ffma is the result

Re: [Mesa-dev] [PATCH] nir: switch fmul to increase chance of optimising it away

2017-01-11 Thread Timothy Arceri
On Thu, 2017-01-12 at 15:20 +1100, Timothy Arceri wrote: > If one of the inputs to the multiplcation in ffma is the result of > an fmul there is a chance that we can reuse the result of that > fmul in other ffma calls if we do the multiplication in the right > order. > > For example it is a fairly

Re: [Mesa-dev] [PATCH] nir: switch fmul to increase chance of optimising it away

2017-01-11 Thread Timothy Arceri
I can change this to use a symbol e.g. '!' for non const but since we are moving towards helpers I did it this way for now. On Thu, 2017-01-12 at 15:20 +1100, Timothy Arceri wrote: > If one of the inputs to the multiplcation in ffma is the result of > an fmul there is a chance that we can reuse th

[Mesa-dev] [PATCH] nir: switch fmul to increase chance of optimising it away

2017-01-11 Thread Timothy Arceri
If one of the inputs to the multiplcation in ffma is the result of an fmul there is a chance that we can reuse the result of that fmul in other ffma calls if we do the multiplication in the right order. For example it is a fairly common pattern for shaders to do something similar to this: const