<div dir="ltr">On Wed, Apr 3, 2013 at 11:56 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</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">GLBenchmark 2.7's shaders contain conditional blocks like:<br>
<br>
if (x) {<br>
if (y) {<br>
...<br>
}<br>
}<br>
<br>
where the outer conditional's then clause contains exactly one statement<br>
(the nested if) and there are no else clauses. This can easily be<br>
optimized into:<br>
<br>
if (x && y) {<br>
...<br>
}<br>
<br>
This saves a few instructions in GLBenchmark 2.7:<br>
<br>
total instructions in shared programs: 11833 -> 11649 (-1.55%)<br>
instructions in affected programs: 8234 -> 8050 (-2.23%)<br>
<br>
It also helps CS:GO slightly (-0.05%/-0.22%). More importantly,<br>
however, it simplifies the control flow graph, which could enable other<br>
optimizations.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br></blockquote><div><br></div><div style>Reviewed-by: Matt Turner <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>></div>
<div style><br></div><div style>Any measurable performance improvement? </div></div></div></div>