<div dir="ltr">Hi!<div><br></div><div>Just wanted to say I've tried building Chrome with this (with -g2 -O2) on Linux and didn't see a noticeable difference in compile time. </div><div>Unfortunately running llvm-locstats fails on the chrome binary, so no coverage stats.</div><div><br></div><div>-Amy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 28, 2021 at 10:12 AM Jeremy Morse via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi llvm-dev@,<br>
<br>
tl;dr, If you build a large optimised x86 codebase with clang and want<br>
better variable locations when debugging, please consider testing the<br>
"-Xclang -fexperimental-debug-variable-locations" command line switch<br>
for clang.<br>
<br>
I've been putting together a new mechanism for tracking variable<br>
locations after instruction selection [0-2], and it's now reaching<br>
maturity. From r8612417e5a5 it's able to build stage2 clang, various<br>
benchmarks and a popular game engine, delivering improved variable<br>
location coverage as described in [2]. However, I fear the<br>
compile-time performance characteristics are going to be substantially<br>
different. I've tried my best to keep things fast, but when there's<br>
more data being produced there'll inevitably be some kind of slowdown,<br>
and it's hard to determine which workloads might be affected. Thus: if<br>
you'd like to lend a hand, please consider running a build with this<br>
flag, and see whether there's a disproportionate compile-time<br>
performance drop. CTMark times show a 1% to 5% performance cost right<br>
now [3], higher for -O0 [4] simply because I haven't focused on -O0<br>
(yet).<br>
<br>
There are a few more coverage-improving patches (such as D104519) that<br>
are yet to land / be published, but what's in-tree already gives good<br>
improvements versus DBG_VALUE-based tracking. Right now only x86 works<br>
really well -- I've made a start on aarch64 to ease adoption [5], but<br>
it's not all there yet.<br>
<br>
The overall mechanism involves annotating instructions with debugging<br>
information instead of attaching it to registers. As a consequence,<br>
additional book-keeping is needed in target-specific optimisations.<br>
Adding that support is probably more a marathon than a sprint;<br>
documenting exactly what needs to be done is in the "TODO" column too.<br>
<br>
We could consider turning this feature on by default for major targets<br>
sometime around llvm-14; I don't have a plan for that yet, but<br>
previous feedback has been positive and the coverage improvements are<br>
encouraging.<br>
<br>
[0] <a href="https://lists.llvm.org/pipermail/llvm-dev/2020-February/139440.html" rel="noreferrer" target="_blank">https://lists.llvm.org/pipermail/llvm-dev/2020-February/139440.html</a><br>
[1] <a href="https://lists.llvm.org/pipermail/llvm-dev/2020-June/142368.html" rel="noreferrer" target="_blank">https://lists.llvm.org/pipermail/llvm-dev/2020-June/142368.html</a><br>
[2] <a href="https://lists.llvm.org/pipermail/llvm-dev/2020-November/146444.html" rel="noreferrer" target="_blank">https://lists.llvm.org/pipermail/llvm-dev/2020-November/146444.html</a><br>
[3] <a href="http://llvm-compile-time-tracker.com/compare.php?from=28ec787eca6ca5460fac9e0f9235bd89436309d0&to=3313f75407bf1f1f4dd787e5233d99cc9e42ba55&stat=instructions" rel="noreferrer" target="_blank">http://llvm-compile-time-tracker.com/compare.php?from=28ec787eca6ca5460fac9e0f9235bd89436309d0&to=3313f75407bf1f1f4dd787e5233d99cc9e42ba55&stat=instructions</a><br>
[4] <a href="http://llvm-compile-time-tracker.com/compare.php?from=bc06b434f0309a9d731f02561301867adeccc622&to=28ec787eca6ca5460fac9e0f9235bd89436309d0&stat=instructions" rel="noreferrer" target="_blank">http://llvm-compile-time-tracker.com/compare.php?from=bc06b434f0309a9d731f02561301867adeccc622&to=28ec787eca6ca5460fac9e0f9235bd89436309d0&stat=instructions</a><br>
[5] See stack at <a href="https://reviews.llvm.org/D104519" rel="noreferrer" target="_blank">https://reviews.llvm.org/D104519</a><br>
<br>
--<br>
Thanks,<br>
Jeremy<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>