On Saturday, April 6, 2013, Cameron McInally  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">All kidding aside, an instruction is an instruction. We have the functionality in hardware for free; it would be a shame not to use it. I should also mention that for our team, performance is job #1. Extra instructions, however insignificant, don't go over well without solid justification.</div>

</div></blockquote><div><br></div><div>A compromise might be to add an llvm.div.or.trap intrinsic, similar to the llvm.add.with.overflow intrinsics used to implement Clang's optional integer overflow checks, which could be emitted efficiently on x86 or other platforms where division by zero or INT_MAX/-1 traps natively.<span></span><span></span></div>
<div><br></div><div>-Joe</div>