<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-size: 13px; ">
Chris,</span><div style="font-size: 13px; ">           one way to look at array bounds check optimization, and the value range propagation that it can be based on, is that it's usefulness is language dependent.  Ada and Java benefit from it greatly, C/C++ not at all, but then a "codesafe" version of C/C++ would, as John T was pointing out below.</div><div style="font-size: 13px; "><br></div><div style="font-size: 13px; ">It seems like the software engineering modularity of llvm's various analysis and transform phases lends itself to having phases that fit this description, worthwhile to have, but not necessarily linked in and/or not necessarily invoked, for every front end language.</div><div style="font-size: 13px; "><br></div><div style="font-size: 13px; ">Another approach is to only trigger the analysis/transform if any bounds check instructions have been encountered, which won't happen in traditional C/C++.</div><div style="font-size: 13px; "><br></div><div style="font-size: 13px; ">Are either of these approaches consistent with your design philosophy ?</div><div style="font-size: 13px; "><br></div><div style="font-size: 13px; ">thanks,</div><div style="font-size: 13px; ">Peter Lawrence.</div><div><br></div><div style="font-size: 13px; "><br></div><div style="font-size: 13px; ">(ps, the possible performance problem with the previous ABCD should not be a factor in the above, since while I don't yet know why that implementation suffered, or if it even did, I do know from personal experience that VRP/ABCD can be both very efficient and very effective.)</div><div style="font-size: 13px; "><br></div><div><br></div><div><br><div><div>On Feb 22, 2011, at 4:46 PM, <a href="mailto:llvmdev-request@cs.uiuc.edu">llvmdev-request@cs.uiuc.edu</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite"><p style="margin: 0.0px 0.0px 0.0px 10.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">the big problem with Patterson's VRP is that it is expensive in terms of</font></p> <p style="margin: 0.0px 0.0px 0.0px 10.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">compile time.<span class="Apple-converted-space">  </span>LLVM used to have some passes (ABCD, predsimplify) that did</font></p> <p style="margin: 0.0px 0.0px 0.0px 10.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">this kind of thing, but they were removed essentially because their compile</font></p> <p style="margin: 0.0px 0.0px 0.0px 10.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">time was too great for the goodness they brought.</font></p> </blockquote><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">I was under the impression that ABCD was removed because no one was<span class="Apple-converted-space"> </span></font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">maintaining and improving it.<span class="Apple-converted-space">  </span>Is my impression incorrect?</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">The SAFECode compiler adds additional run-time checks for array bounds<span class="Apple-converted-space"> </span></font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">checking.<span class="Apple-converted-space">  </span>If the ABCD code was working but just wasn't useful for<span class="Apple-converted-space"> </span></font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">regular C code, I'd like to know.<span class="Apple-converted-space">  </span>It may still have value for projects<span class="Apple-converted-space"> </span></font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">like SAFECode.</font></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; min-height: 16.0px"><br></p> <p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Monaco" size="3" style="font: 12.0px Monaco">-- John T.</font></p> </blockquote></div><br></div></body></html>