<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 12, 2016, at 9:05 AM, Joe Groff via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">It looks like LLVM does not recognize the overflow traps Swift emits on arithmetic operations as dead code, so that prevents it from completely eliminating the Swift loop. That's a bug worth fixing in Swift, but unlikely to make a major difference in real, non-dead code.<span class="Apple-converted-space"> </span></span></div></blockquote></div><br class=""><div class="">The traps aren’t dead if they are reachable. Eventually we will teach LLVM about less-strict trap semantics so they can be speculated and reordered. But for now we can do that sort of thing in SIL in the most important cases.</div><div class=""><br class=""></div><div class="">-Andy</div></body></html>