All,<br>I have some code that looks like the following:<br><br>{<br> double a, b, c;<br> for (...) {<br> ...<br> a = lots of FP math;<br> b = lots of FP math;<br> c = lots of FP math;<br> if (cond) {<br> a = 0.0;<br>
b = 0.1;<br> c = 0.2;<br> }<br> ...<br> }<br>}<br><br>Could we not convert the hammock into a diamond and move the initial computation of a, b, and c into the else block. Something like this:<br><br>{<br>
double a, b, c;<br>
for (...) {<br>
...<br> if (cond) {<br>
a = 0.0;<br>
b = 0.1;<br>
c = 0.2;<br>
} else {<br>
a = lots of FP math;<br> b = lots of FP math;<br> c = lots of FP math;<br> }<br>
...<br>
}<br>
}<br>
<br>Does a similar optimization exist? If not, would the SimplifyCFG pass be an appropriate home for such an optimization?<br><br> Chad<br>