[PATCH] D12618: Reserve a vendor reserved block ID for bitcode

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 08:03:19 PDT 2015


Hi Rafael,

> On Sep 4, 2015, at 6:23 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
> 
> Needs a test showing that it is actually ignored.

Good point! Done.

> 
> Can you expand on how you intend this to be used? We have a documented
> policy on supporting old bitcode:
> 
> http://llvm.org/docs/DeveloperPolicy.html#ir-backwards-compatibility
> 
> 
> Is that not what you are looking for?

Our current issue is not reading old bitcode but what to do with new bitcode.

For instance you install a beta version of Xcode, build a project with LTO, and then revert Xcode to the previous version.
At this point the bitcode on your disk is too new for your installed toolchain and a non-clean build may crash libLTO.

Another case is when some people distribute static archive that contains bitcode. Right now we end-up with terrible crash reports while we want to improve user experience with great diagnostics.

Thanks,

— 
Mehdi



> 
> 
> On 3 September 2015 at 20:11, Mehdi AMINI <mehdi.amini at apple.com> wrote:
>> joker.eph created this revision.
>> joker.eph added a reviewer: rafael.
>> joker.eph added a subscriber: llvm-commits.
>> 
>> The idea is that vendor toolchains can insert a block for their own
>> internal purpose while generating bitcode that will be compatible
>> with the open-source tools. The latter just ignoring this block.
>> 
>> We (Apple) intend to use it for versioning the bitcode. The versioning
>> would not make sense with respect to open-source release since our
>> internal versions/releases don't align.
>> 
>> http://reviews.llvm.org/D12618
>> 
>> Files:
>>  include/llvm/Bitcode/LLVMBitCodes.h
>> 
>> Index: include/llvm/Bitcode/LLVMBitCodes.h
>> ===================================================================
>> --- include/llvm/Bitcode/LLVMBitCodes.h
>> +++ include/llvm/Bitcode/LLVMBitCodes.h
>> @@ -34,7 +34,8 @@
>>     CONSTANTS_BLOCK_ID,
>>     FUNCTION_BLOCK_ID,
>> 
>> -    UNUSED_ID1,
>> +    // Valid inside vendor specific toolchains only, discarded by open-source
>> +    VENDOR_RESERVED_ID,
>> 
>>     VALUE_SYMTAB_BLOCK_ID,
>>     METADATA_BLOCK_ID,
>> 
>> 



More information about the llvm-commits mailing list