<p dir="ltr"><br>
On Dec 4, 2014 11:22 PM, "Kenneth Graunke" <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> wrote:<br>
><br>
> On Friday, November 21, 2014 10:23:43 AM Matt Turner wrote:<br>
> > On Tue, Nov 11, 2014 at 9:41 AM, Matt Turner <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>> wrote:<br>
> > > The rest of our backend optimizations have replaced the need for this<br>
> > > since it was written.<br>
> > ><br>
> > > instructions in affected programs:     30626 -> 30564 (-0.20%)<br>
> > ><br>
> > > Hurts a small number of CSGO shaders by one instruction, but helps even<br>
> > > more. Hurts two by a larger number because of something I noticed when I<br>
> > > first wrote the SEL peephole: try_replace_with_sel() operates on<br>
> > > instructions before we've demoted uniforms to pull constants. So code<br>
> > > like<br>
> > ><br>
> > >    var.x = ( -abs(r6.w) >= 0.0 ) ? pc[82].x : r9.x;<br>
> > >    var.y = ( -abs(r6.w) >= 0.0 ) ? pc[82].y : r9.y;<br>
> > >    var.z = ( -abs(r6.w) >= 0.0 ) ? pc[82].z : r9.z;<br>
> > >    var.w = ( -abs(r6.w) >= 0.0 ) ? pc[82].w : r9.w;<br>
> > ><br>
> > > where pc[82] gets demoted to a pull constant, we end up emitting a<br>
> > > send(4) instruction to load pc[82] each time, and since they're in<br>
> > > different basic blocks because we mishandle the ternary operator in this<br>
> > > case we can't combine them. Once we handle this common ternary pattern<br>
> > > better the problem will go away.<br>
> > > ---<br>
> ><br>
> > Thoughts?<br>
><br>
> I don't know...if I'm reading the above text correctly, this doesn't look<br>
> compelling.  Your argument for deleting this is "it's not necessary anymore",<br>
> but you go on to undermine that by saying that it hurts a few shaders, and<br>
> even quadrouples the number of pull loads in a few cases...<br>
><br>
> Sure, it'll get fixed if we handle ternary operations better...but we haven't<br>
> yet...so...</p>
<p dir="ltr">First off, how is this different from the sel peephole?</p>
<p dir="ltr">Second, at the risk of sounding like a broken record, NIR should fix this for us.  That said, I'm a little hesitant to delete whole passes until we know what kind of code it will generate.</p>
<p dir="ltr">--Jason</p>
<p dir="ltr">><br>
> I'm pretty confused.  Maybe I'm misreading your justification...<br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
><br>
</p>