[PATCH] D35189: Add GUID-ValueID map and original name to ThinLTO summary.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 12:51:07 PDT 2017


On Mon, Jul 10, 2017 at 12:37 PM, Teresa Johnson <tejohnson at google.com>
wrote:

>
>
> On Mon, Jul 10, 2017 at 12:30 PM, Peter Collingbourne via Phabricator <
> reviews at reviews.llvm.org> wrote:
>
>> pcc added a comment.
>>
>> > the global VST (for the global values we will have in the index) does
>> not.
>>
>> Not quite, global VSTs include a reference to the symbol name in the
>> strtab.
>>
>
> That's what I was thinking when we chatted about this with Haojie, but it
> turns out I was wrong. The global VST includes the value id and the bitcode
> offset of the function definition in the IR:
>  http://llvm-cs.pcc.me.uk/lib/Bitcode/Writer/BitcodeWriter.cpp#2763
>
> The offset to the symbol name is included in the MODULE_CODE_FUNCTION
> entry:
> http://llvm-cs.pcc.me.uk/lib/Bitcode/Writer/BitcodeWriter.cpp#1170
> which is not really in the global VST.
>

Of course, I totally forgot about that.

I wonder whether it would be better to emit MODULE_CODE_FUNCTION (etc.)
records into the minimised bitcode file, but of length 5 so that they
include only the name and the linkage. Then there will be no special
handling required in the index bitcode reader.

Peter


>
>> > But I think infer it from the code in my previous inline comment, it is
>> "we need the name to recompute a GUID for internal symbol promoted to
>> global", correct?
>>
>> Names of globals are also necessary for symbol resolution.
>>
>>
>> https://reviews.llvm.org/D35189
>>
>>
>>
>>
>
>
> --
> Teresa Johnson |  Software Engineer |  tejohnson at google.com |
> 408-460-2413 <(408)%20460-2413>
>



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


More information about the llvm-commits mailing list