[PATCH] Pack MCSymbol flags and common alignment

Pete Cooper peter_cooper at apple.com
Mon Jun 22 16:19:28 PDT 2015


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>





More information about the llvm-commits mailing list