[llvm] r185883 - Fix a bug in IRBuilder::ClearInsertionPoint. The IR Builder needs to reset both the BB and the insert point inside the BB.

Nadav Rotem nrotem at apple.com
Mon Jul 8 17:20:20 PDT 2013


no problem  ;) 

On Jul 8, 2013, at 5:19 PM, Eric Christopher <echristo at gmail.com> wrote:

> Interesting, sure, makes sense.
> 
> Thanks!
> 
> -eric
> 
> On Mon, Jul 8, 2013 at 5:17 PM, Nadav Rotem <nrotem at apple.com> wrote:
>> 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.
>> 
>> On Jul 8, 2013, at 5:11 PM, Eric Christopher <echristo at gmail.com> wrote:
>> 
>> *looks at code*
>> 
>> Aha. Interesting. Why not just save the instruction that you'd like to
>> insert at on the side (or a stack of such if that's what's going on)?
>> I'm not clear on what BuilderLocGuard is doing other than the saving
>> of the instruction off to the side, but I admit that I've not looked a
>> whole lot :)
>> 
>> -eric
>> 
>> On Mon, Jul 8, 2013 at 5:06 PM, Nadav Rotem <nrotem at apple.com> wrote:
>> 
>> SetInsertPoint does set both, but the GetInsertPoint returns only the
>> Instruction (and not the BB).  I ran into this with the RAII class that
>> saves the IRBuilder location.  Actually, Alexey's ASan bot helped me
>> discover it :)
>> 
>> 
>> On 07/08/13, Eric Christopher <echristo at gmail.com> wrote:
>> 
>> On Mon, Jul 8, 2013 at 4:27 PM, Nadav Rotem <nrotem at apple.com> wrote:
>> 
>> Author: nadav
>> Date: Mon Jul  8 18:27:43 2013
>> New Revision: 185883
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=185883&view=rev
>> Log:
>> Fix a bug in IRBuilder::ClearInsertionPoint. The IR Builder needs to reset
>> both the BB and the insert point inside the BB.
>> 
>> 
>> I'd run into this in the past and didn't think much of it because all
>> of the SetInsertPoint routines set both variables. How'd you run into
>> this?
>> 
>> -eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130708/f01ac00e/attachment.html>


More information about the llvm-commits mailing list