about those clang warnings

Kevin Funk kfunk at kde.org
Wed Jan 27 16:22:00 UTC 2016


On Wednesday, January 27, 2016 04:53:39 PM René J.V. Bertin wrote:
> On Wednesday January 27 2016 16:15:05 Kevin Funk wrote:
> > Non-static build of the Clang/LLVM executables is another issue. Runtime
> > relocations have an immense impact on execution time of those tools (esp.
> > since they're usually short-living processes, invoked numerous times)
> 
> Ah, you mean whether or not clang or clang++ link to libLLVM? 

Yes.

My distro-provided clang executable just links against:
        libLLVM-3.7.so.1
        (and other base system libs, such as pthread, libstdc++, ...)

Clang from self-compiled Clang/LLVM build (using shared libs) links against:
        libLLVMX86CodeGen.so => /home/kfunk/devel/build/llvm/lib/
libLLVMX86CodeGen.so (0x00007fdbbd2c9000)
        libLLVMX86AsmPrinter.so => /home/kfunk/devel/build/llvm/lib/
libLLVMX86AsmPrinter.so (0x00007fdbbd27a000)
        libLLVMX86AsmParser.so => /home/kfunk/devel/build/llvm/lib/
libLLVMX86AsmParser.so (0x00007fdbbd1d8000)
        libLLVMX86Desc.so => /home/kfunk/devel/build/llvm/lib/
libLLVMX86Desc.so (0x00007fdbbcfff000)
        libLLVMX86Info.so => /home/kfunk/devel/build/llvm/lib/
libLLVMX86Info.so (0x00007fdbbcffc000)
        libLLVMX86Disassembler.so => /home/kfunk/devel/build/llvm/lib/
libLLVMX86Disassembler.so (0x00007fdbbce96000)
        libLLVMAnalysis.so => /home/kfunk/devel/build/llvm/lib/
libLLVMAnalysis.so (0x00007fdbbccc6000)
        libLLVMCodeGen.so => /home/kfunk/devel/build/llvm/lib/
libLLVMCodeGen.so (0x00007fdbbca75000)
        ... and a lot more ...

You see the difference... This has an impact on startup performance.

> That is indeed
> the case for the MacPorts llvm/clang builds, and not for Apple's system
> clang from what I can see.

> Your explanation should mean that any performance differences (due to
> runtime relocation) should disappear when compiling large enough files,
> which isn't exactly what I'm seeing (705Kb small C file):

I never said it may disappear. It's just more noticeable in that case.
 
> /usr/bin/clang (600.0.57 based on LLVM 3.5): 5.308 user_cpu 0.153 kernel_cpu
> 0:05.70 total_time 95.6%CPU (hah, so it isn't a 3.6 version after all...)
> /opt/local/bin/clang-mp-3.6 (3.6.2/final): 7.999 user_cpu 0.170 kernel_cpu
> 0:08.17 total_time 99.8%CPU /opt/local/bin/clang-mp-3.7 (3.7.0/final):
> 9.229 user_cpu 0.167 kernel_cpu 0:09.63 total_time 97.4%CPU

Check your Clang/LLVM build I'd say and tune the optimization flags (note that 
RelWithDebInfo is also not ideal).

Cheers,
Kevin
 
> Cheers,
> René

-- 
Kevin Funk | kfunk at kde.org | http://kfunk.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160127/e5d57e12/attachment.sig>


More information about the KDevelop-devel mailing list