[Mesa-dev] [PATCH] nir/search: Save/restore the variables_seen bitmask when matching

Ian Romanick idr at freedesktop.org
Fri May 8 15:31:34 PDT 2015

On 05/08/2015 03:25 PM, Jason Ekstrand wrote:
> On Fri, May 8, 2015 at 3:20 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> On 05/08/2015 11:55 AM, Jason Ekstrand wrote:
>>> On Fri, May 8, 2015 at 11:53 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>>>> total instructions in shared programs: 7152330 -> 7137006 (-0.21%)
>>>> instructions in affected programs:     1330548 -> 1315224 (-1.15%)
>>>> helped:                                5797
>>>> HURT:                                  76
>>> I'm doing some looking into the hurt programs.  It seems as if there
>>> are some very strange interatctions between flrp and ffma.  I'm still
>>> working out exactly how to fix it up.
>> Yes, I noticed this too.  Did you see my reply to Ken earlier today?
>> The problem I noticed /seems/ restricted to cases where the would-be
>> interpolant is scalar but the other values are vector.
> It would surprise me a lot of that mattered.  At the point where we do
> opt_algebraic in NIR, we've already scalarized things.  That said,
> there is a *lot* going on in an optimization loop so anything's
> possible.

If I take the shader_runner test that I included in the e-mail to Ken
and s/float alpha/vec3 alpha/ I get LRPs.  I made some obvious tweaks to
opt_algebraic to handle the mix of scalar and vector, and something like
150 shaders were helped.

I spent about an hour digging into it, and I came up dry.  I have tried
adding some rules to nir_opt_algebraic.py to convert the fmul/ffma to
flrp, and I couldn't get a break point at the nir_opt_ffma to trigger.
I was going to ask about it at the office on Monday, but it came up on
the list first.

More information about the mesa-dev mailing list