[Mesa-dev] [PATCH 9/9] i965: Use NIR by default for Fragment shaders on SNB+

Matt Turner mattst88 at gmail.com
Wed Mar 18 23:16:07 PDT 2015


On Tue, Mar 17, 2015 at 10:56 PM, Matt Turner <mattst88 at gmail.com> wrote:
> Thanks. Looked through stats and at some of the regressions.

I disabled the pow(x, y) optimization in NIR, turned off the SEL
peephole in the fs backend, and added neg/abs to
block_check_for_allowed_instrs() (will test and send a patch) to make
other differences more apparent.

The biggest thing I'm seeing so far is that NIR greedily combines
multiplies into MADs, even when the multiplication's result is used in
multiple places, meaning we still have to do the multiply.

shaders/warsow/7.shader_test is a great (and small) example of this.

I think the same might apply to matching saturate. In
valley/medium/242 we match some min(max(x, 0.0), 1.0) where the result
of the max(x, 1.0) is used in another place. It doesn't seem to cause
extra instructions, so I'm not sure it's actually a problem.

The actual regression in valley/medium/242 is pretty clear -- we're
not matching MADs when the the addition is negated. I have a patch for
this already. I'll test it and send it out.

I'm having a hard time finding regressions that aren't because of
being too greedy with MADs.


More information about the mesa-dev mailing list