[PATCH] Pack MCSymbol flags and common alignment

Pete Cooper peter_cooper at apple.com
Tue Jun 30 14:30:50 PDT 2015


Here’s a new version of the patch for using 5-bits for alignment.  Please review when you get a chance.

Last one after this will just be to make flags 16-bits and move it to before Index.

Thanks,
Pete

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcsymbol-packing.patch
Type: application/octet-stream
Size: 2763 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150630/9e3c9754/attachment.obj>
-------------- next part --------------



> On Jun 30, 2015, at 2:03 PM, Pete Cooper <peter_cooper at apple.com> wrote:
> 
> 
>> On Jun 29, 2015, at 12:38 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>> 
>> LGTM
> Thanks!  r241115.
> 
> Pete
>> 
>> On 26 June 2015 at 16:02, Pete Cooper <peter_cooper at apple.com> wrote:
>>> 
>>>> On Jun 22, 2015, at 10:24 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>>>> 
>>>> 
>>>>> On Jun 22, 2015, at 9:35 PM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>>>>> 
>>>>> Or use one fewer bit for ELF. Nothing is going to align a common to 4 GB :-)
>>>> If only that were true, but i’m sure someone will be crazy enough to write an asm test doing just that :)
>>>> 
>>>> ...
>>>>> 
>>>>> On 23 June 2015 at 00:23, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>>>>>> Another option would be to use one of the low bits it SectionOrFragment.
>>>> I like this solution.  Will get a patch ready tomorrow.
>>> Sorry, tomorrow ended up being a few days.
>>> 
>>> How does this look for the packing a bit in to SectionOrFragment?
>>> 
>>> 
>>> 
>>>> 
>>>> Pete
>>>>>> 
>>>>>> With that you could keep 5 bits in the base for common.
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On 22 June 2015 at 19:19, Pete Cooper <peter_cooper at apple.com> wrote:
>>>>>>> I should say, i forgot to clang-format this.  I’ll of course do that before commit as there’s a bunch of 80-cols violations right now.
>>>>>>> 
>>>>>>> Pete
>>>>>>>> On Jun 22, 2015, at 4:05 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>>>>>>>> 
>>>>>>>> Hi Rafael
>>>>>>>> 
>>>>>>>> MCSymbol has 32-bits of flags and 32-bits of common alignment.
>>>>>>>> 
>>>>>>>> However, we only need to represent power of 2 alignments, and no subclasses need more than 16 bits of flags.  We also have 20 bits of bitfields remaining unused.
>>>>>>>> 
>>>>>>>> This patch takes those 20-bits and exposes them as SubclassData.
>>>>>>>> 
>>>>>>>> On COFF, we used 16-bits for flags and the remainder are unused.
>>>>>>>> On ELF, we used 5 bits to store the log2(align) which allows alignments up to 2^31, i.e., any power of 2 which fits in an unsigned.  The remaining 15 are enough for the ELF flags.
>>>>>>>> On MachO, we need 16-bits for flags, and the remaining 4-bits are enough for 2^15 which MCSymbolMachO::getEncodedFlags() already asserted we didn’t exceed.
>>>>>>>> 
>>>>>>>> This ultimately gets MCSymbol down to 24-bits for the base class.  I don’t think its possible to pack the data in any better at this point.
>>>>>>>> 
>>>>>>>> Cheers,
>>>>>>>> Pete
>>>>>>>> 
>>>>>>>> <mcsymbol-packing.patch>
>>>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>> 
>>> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list