crazy idea: Make all temporary symbols unnamed
Rafael EspĂndola
rafael.espindola at gmail.com
Wed Jun 17 12:02:16 PDT 2015
>> If the first one is handled, the second one goes away by making sure
>> we ignore the name of *all* .L symbols: we pick one when writing
>> assembly, but it never shows up in the final .o.
>
> How do the 'l' symbols fit into this? Unaffected, right?
Correct. They are merged by name, so their names are critical.
>> In this patch I have handled the first issue only in the ELF writer by
>> supporting unnamed symbols.
>>
>> Can symbols be unnamed on COFF and MachO?
>
> Nick?
>
>> If not, I think we could
>> still do this and let those object writers invent a deterministic name
>> at the very end, no?
>
> Sounds plausible.
>
>> I tested this locally by doing a bootstrap.
>>
>> I tested the memory savings for llvm-mc are quite noticeable. When
>> assembly a LTO llvm-as, the memory usage goes from 45,952,208 to
>> 39,137,568 bytes.
>
> Any memory stats for LTO codegen (bitcode => object)?
I collect llvm-as.opt.bc by passing -plugin-opt=save-temps to gold (no
debug info). I then used heaptrack when running "llc llvm-as.opt.bc -o
test.o -filetype=obj" and got:
patch:
bytes allocated in total (ignoring deallocations): 5.12GB (33.43MB/s)
calls to allocation functions: 16641727 (108647/s)
peak heap memory consumption: 206.75MB
total memory leaked: 32B
master:
bytes allocated in total (ignoring deallocations): 5.13GB (33.41MB/s)
calls to allocation functions: 16687572 (108757/s)
peak heap memory consumption: 209.41MB
total memory leaked: 32B
Cheers,
Rafael
More information about the llvm-commits
mailing list