For some time now I was curious on what the size impact of LTO was. I decided to test this with a large C++ app, clang was a natural choice. With PR8313 fixed with the proposed patch and PR8300 avoided by disabling constructor aliasing I was able to hack clang to bootstrap with LTO enabled using the gold plugin. I did the testing on linux x86-64. Gcc is the 4.4.4 included with Fedora 13. The results are: gcc -O3: 32MB gcc -Os: 25MB clang lto -Os: 22MB I then decided to try to link without export-dynamic, since it produces some fairly large tables and blocks many optimizations. The new results were gcc -O3: 30MB gcc -Os: 23MB clang lto -Os: 18 MB The full patches I used are attached. I hope to get the non-hackish bits reviewed, starting by the fix to 8313. Cheers, -- Rafael Ávila de Espíndola
> The full patches I used are attached. I hope to get the non-hackish > bits reviewed, starting by the fix to 8313.attached now. Cheers, -- Rafael Ávila de Espíndola -------------- next part -------------- A non-text attachment was scrubbed... Name: llvm.patch Type: text/x-patch Size: 25795 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101009/6f63e637/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: clang.patch Type: text/x-patch Size: 8168 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101009/6f63e637/attachment-0001.bin>
Hi Rafael,> I did the testing on linux x86-64. Gcc is the 4.4.4 included with > Fedora 13. The results are: > > gcc -O3: 32MB > gcc -Os: 25MB > clang lto -Os: 22MBhow does clang -Os without lto do? Also, what about gcc-4.5 with -flto? Ciao, Duncan.
On Oct 9, 2010, at 10:51 AM, Rafael Espindola wrote:>> The full patches I used are attached. I hope to get the non-hackish >> bits reviewed, starting by the fix to 8313. > > attached now.Wow, nice results. Please split the patches out according to what they do. Is there any impact on clang compile time by building with LTO? What about build times? :) -Chris
> how does clang -Os without lto do?Not sure. Should be able to try it next Tuesday.> Also, what about gcc-4.5 with -flto?Last time I tried gcc could not build itself with LTO, so I am not all that excited to try it :-)> Ciao, > > Duncan.Cheers, -- Rafael Ávila de Espíndola