[LLVMdev] [PATCH] with no response: Bug 13163 - BlockAddress instruction with use from the global context is damaged during module link

Nick Lewycky nicholas at mxc.ca
Sat May 4 10:47:45 PDT 2013


Chris Lattner wrote:
>
> On Apr 17, 2013, at 7:26 PM, Yuri<yuri at rawbw.com>  wrote:
>
>> On 10/02/2012 13:01, Duncan Sands wrote:
>>>
>>> I think Chris is the right person to look at this, hopefully he will.
>>
>> Now 5 months passed. I updated the patch for this current revision.
>> Can anybody review this and check in please?
>>
>> http://llvm.org/bugs/show_bug.cgi?id=13163
>>
>
> Realistically speaking, I'm not going to be able to review this patch in a useful way.  Is there anyone else who can review this patch for Yuri?

Yuri, I think this problem can be solved without changing BlockAddress. 
There's already code in LLVM which creates deferred block addresses; it 
happens when we read .bc files (function local constants are loaded from 
the .bc file first, followed by the actual instruction stream and basic 
blocks). The short answer is that you can create a placeholder 
GlobalVariable, then RAUW it away with the blockaddr once all the blocks 
are loaded. See how BlockAddrFwdRefs works in 
lib/Bitcode/Reader/BitcodeReader.cpp.

Sorry I haven't reviewed this patch previously, I'm willing to take 
responsibility for reviews of this sort of thing.

Nick



More information about the llvm-dev mailing list