<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">The problem is that there are lots of exit points, and you don’t want to manually restore the IRBuilder location at each one of them. The function vectorizerTree alone has 13 exit points, because we try to reduce compile time and break out as early as possible. <div><br><div><div>On Jul 8, 2013, at 5:11 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="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;">*looks at code*<br><br>Aha. Interesting. Why not just save the instruction that you'd like to<br>insert at on the side (or a stack of such if that's what's going on)?<br>I'm not clear on what BuilderLocGuard is doing other than the saving<br>of the instruction off to the side, but I admit that I've not looked a<br>whole lot :)<br><br>-eric<br><br>On Mon, Jul 8, 2013 at 5:06 PM, Nadav Rotem <<a href="mailto:nrotem@apple.com">nrotem@apple.com</a>> wrote:<br><blockquote type="cite">SetInsertPoint does set both, but the GetInsertPoint returns only the<br>Instruction (and not the BB).  I ran into this with the RAII class that<br>saves the IRBuilder location.  Actually, Alexey's ASan bot helped me<br>discover it :)<br><br><br>On 07/08/13, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:<br><br>On Mon, Jul 8, 2013 at 4:27 PM, Nadav Rotem <<a href="mailto:nrotem@apple.com">nrotem@apple.com</a>> wrote:<br><blockquote type="cite">Author: nadav<br>Date: Mon Jul  8 18:27:43 2013<br>New Revision: 185883<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=185883&view=rev">http://llvm.org/viewvc/llvm-project?rev=185883&view=rev</a><br>Log:<br>Fix a bug in IRBuilder::ClearInsertionPoint. The IR Builder needs to reset<br>both the BB and the insert point inside the BB.<br><br></blockquote><br>I'd run into this in the past and didn't think much of it because all<br>of the SetInsertPoint routines set both variables. How'd you run into<br>this?<br><br>-eric</blockquote></div></blockquote></div><br></div></body></html>