<div dir="ltr">On 22 January 2014 09:16, Connor Abbott <span dir="ltr"><<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This series enables GLSL IR support for SSA, including passes to convert<br>
to and from SSA form. SSA is a form of the intermediate representation<br>
of a compiler in which each variable is assigned exactly once. SSA form<br>
makes many optimizations faster and easier to write, and enables other<br>
more powerful optimizations. SSA is used in GCC [1] and LLVM [2] as well<br>
as various compiler backends within Mesa itself, such as r600g-sb and<br>
Nouveau. Adding support for SSA will allow the various optimizations<br>
these backends perform to be implemented in one place, instead of<br>
making each driver reinvent the wheel (as several have already done).<br>
Additionally, all new backends would recieve these optimizations,<br>
reducing the burden of writing a compiler backend for a new driver.<br>
<br>
Even though no optimization passes are now implemented, I am putting out<br>
this series to solicit feedback on the design, to make sure I don't have<br>
to rewrite things before I go ahead and write these new passes.<br>
<br>
There are no piglit regressions on Softpipe, except for the<br>
spec/OpenGL 2.0/max-samplers test, which only passed before because the<br>
compiler happened to unroll the loop; the extra copies caused by the<br>
conversion to and from SSA stop the compiler from unrolling, meaning<br>
that the resulting GLSL IR code contains an indirect sampler index which<br>
glsl-to-tgsi can't handle.<br></blockquote><div><br></div><div>I had a detailed look at your patches and I really like where you're going with this. I sent a lot of feedback in response to patches 4, 5, 7, 9, and 10; I don't think any of my feedback would require a major change to your overall plan. Nice work! Consider patches 1, 2, 3, 6, 8, and 11:<br>
<br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com" target="_blank">stereotype441@gmail.com</a>><br><br></div><div>Note, however, that probably patch 11 should be postponed until we've written something that makes use of the SSA form (i.e. the GVN-GCM algorithm you mentioned, or a direct conversion from GLSL IR to an SSA backend).<br>
</div></div></div></div>