<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">In my experience the buildsystem works fine in combination with tablegen (at least this aspect of it). The real problem here is that tablegen is just slow. Some of the X86 tables take indeed </div><div class=""><br class=""></div><div class="">Last time I looked at it tablegen had still room to optimize the way it resolves class hierarchies and the variables within which it did basically one at a time, so it needed to traverse the hierarchies again for each variables.</div><br class=""><div><blockquote type="cite" class=""><div class="">On May 27, 2017, at 12:54 PM, David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Maybe we do and build systems aren't respecting/noticing this? I'm not sure.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Sat, May 27, 2017 at 12:50 PM Craig Topper <<a href="mailto:craig.topper@gmail.com" class="">craig.topper@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">I thought we already did write tablegen output to temporary files like X86GenAsmWriter1.inc.tmp first and then diffed them with the real .inc file and conditionally copied.</div><div class="gmail_extra"></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="m_-495019445101160162gmail_signature" data-smartmail="gmail_signature">~Craig</div></div></div><div class="gmail_extra">
<br class=""><div class="gmail_quote">On Sat, May 27, 2017 at 11:02 AM, David Blaikie via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, May 26, 2017 at 8:06 PM Zachary Turner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It would be better, because a debug tablegen is slower than an optimized tablegen, but it's still slow and it doesn't address the problem that tablegen runs *at all* when it doesn't really need to. I think if tablegen wasn't running all the time we could incremental builds down from 15 minutes (and that's on my really powerful machine) to under 5, which seemed like a big productivity boost averaged out over all users x time<br class=""></blockquote><div class=""><br class="">Is that 10 minutes of running tablegen, though? I think this touches on Hal's comment:<br class="">"<span style="color:rgb(33,33,33);font-size:13px" class="">Maybe we should use a diff-and-update approach (I thought, however, that we already did that)."<br class=""></span><br class="">In that the 10 minutes is presumably from timestamp-based invalidation chaining down from running tablegen, to then rebuilding everything that depends on tablegen's output.<br class=""><br class="">That could be addressed by either the build system or tablegen writing output to a temporary file, comparing the temp to the current file, and not modifying the current file if they're the same - thus not invalidating everything down the chain that depends on the tablegen output (not sure if that's actually enough to convince a build system not to rebuild other things - but worth a shot). This is a bit of a hackaround what the build system itself could/should be doing, but in the absence of a content based invalidation scheme - addressing this one particularly critical point in LLVM's build seems like it could be worth such a workaround. (this would speed up the build for even the times when tablegen's real dependencies change - add a new function to ArrayRef, or STLExtras, etc... and tablegen runs, but it doesn't cascade to everything else). <br class=""><br class="">(plus, opt build of tablegen, so that conclusion can be reached more quickly)<br class=""><br class="">As Hal also mentioned, I'd be OK with this if there's a good logical division that can be taken more than "whatever is/isn't used in tablegen".<br class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">We've got a lot of random stuff in Support, not all really related and not all relevant to every project. It seems like we should be able to do better.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, May 26, 2017 at 6:48 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000" class=""><p class=""><br class="">
</p>
<div class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137moz-cite-prefix">On 05/26/2017 07:59 PM, Zachary Turner
wrote:<br class="">
</div>
<blockquote type="cite" class="">
<div dir="ltr" class="">It's that TableGen depends on Support, so if you
change one file in support, support gets recompiled into a new
static archive, which triggers a rerun of tablegen on all the
tablegen inputs, which is extremely slow.</div>
</blockquote>
<br class=""></div><div bgcolor="#FFFFFF" text="#000000" class="">
I thought that we had a "build an optimized tablegen even in debug
mode" setting to work around this problem. Would that avoid this
problem?</div><div bgcolor="#FFFFFF" text="#000000" class=""><br class="">
<br class="">
-Hal</div><div bgcolor="#FFFFFF" text="#000000" class=""><br class="">
<br class="">
<blockquote type="cite" class=""><br class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Fri, May 26, 2017 at 5:56 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov" target="_blank" class="">hfinkel@anl.gov</a>>
wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000" class=""><p class=""><br class="">
</p>
<br class="">
<div class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649moz-cite-prefix">On
05/26/2017 07:47 PM, Zachary Turner via llvm-dev wrote:<br class="">
</div>
<blockquote type="cite" class="">
<div dir="ltr" class="">Changing a header file somewhere and having
to spend 10 minutes waiting for a build leads to a lot
of wasted developer time.
<div class=""><br class="">
</div>
<div class="">The real culprit here is tablegen. Can we split
support and ADT into two - the parts that tablegen
depends on and the parts that it doesn't?</div>
</div>
</blockquote>
<br class="">
</div>
<div bgcolor="#FFFFFF" text="#000000" class=""> What's the actual
problem here? Is it that TableGen regenerates different
files and so we then need to rebuild all dependencies of
those files? Maybe we should use a diff-and-update approach
(I thought, however, that we already did that).<br class="">
<br class="">
-Hal<br class="">
<br class="">
</div>
<div bgcolor="#FFFFFF" text="#000000" class="">
<blockquote type="cite" class="">
<div dir="ltr" class="">
<div class=""><br class="">
</div>
<div class="">From what I can gather, Tablegen currently depends
on these headers and all of their transitive
dependencies.</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">#include "llvm/Support/Casting.h"</div>
<div class="">#include "llvm/Support/CommandLine.h"</div>
<div class="">#include "llvm/Support/Compiler.h"</div>
<div class="">#include "llvm/Support/DataTypes.h"</div>
<div class="">#include "llvm/Support/Debug.h"</div>
<div class="">#include "llvm/Support/Error.h"</div>
<div class="">#include "llvm/Support/ErrorHandling.h"</div>
<div class="">#include "llvm/Support/Format.h"</div>
<div class="">#include "llvm/Support/FormattedStream.h"</div>
<div class="">#include "llvm/Support/LEB128.h"</div>
<div class="">#include "llvm/Support/LowLevelTypeImpl.h"</div>
<div class="">#include "llvm/Support/ManagedStatic.h"</div>
<div class="">#include "llvm/Support/MathExtras.h"</div>
<div class="">#include "llvm/Support/MemoryBuffer.h"</div>
<div class="">#include "llvm/Support/PrettyStackTrace.h"</div>
<div class="">#include "llvm/Support/Regex.h"</div>
<div class="">#include "llvm/Support/SMLoc.h"</div>
<div class="">#include "llvm/Support/ScopedPrinter.h"</div>
<div class="">#include "llvm/Support/Signals.h"</div>
<div class="">#include "llvm/Support/SourceMgr.h"</div>
<div class="">#include "llvm/Support/raw_ostream.h"</div>
<div class=""><br class="">
</div>
<div class="">#include "llvm/ADT/APInt.h"</div>
<div class="">#include "llvm/ADT/ArrayRef.h"</div>
<div class="">#include "llvm/ADT/BitVector.h"</div>
<div class="">#include "llvm/ADT/CachedHashString.h"</div>
<div class="">#include "llvm/ADT/DenseSet.h"</div>
<div class="">#include "llvm/ADT/IndexedMap.h"</div>
<div class="">#include "llvm/ADT/IntEqClasses.h"</div>
<div class="">#include "llvm/ADT/MapVector.h"</div>
<div class="">#include "llvm/ADT/Optional.h"</div>
<div class="">#include "llvm/ADT/PointerUnion.h"</div>
<div class="">#include "llvm/ADT/STLExtras.h"</div>
<div class="">#include "llvm/ADT/SetVector.h"</div>
<div class="">#include "llvm/ADT/SmallPtrSet.h"</div>
<div class="">#include "llvm/ADT/SmallSet.h"</div>
<div class="">#include "llvm/ADT/SmallVector.h"</div>
<div class="">#include "llvm/ADT/SparseBitVector.h"</div>
<div class="">#include "llvm/ADT/Statistic.h"</div>
<div class="">#include "llvm/ADT/StringExtras.h"</div>
<div class="">#include "llvm/ADT/StringMap.h"</div>
<div class="">#include "llvm/ADT/StringRef.h"</div>
<div class="">#include "llvm/ADT/StringSet.h"</div>
<div class="">#include "llvm/ADT/StringSwitch.h"</div>
<div class="">#include "llvm/ADT/TinyPtrVector.h"</div>
<div class="">#include "llvm/ADT/Twine.h"</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><br class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649inbox-inbox-Apple-interchange-newline">
Is this something worth putting effort into? If so,
I volunteer.</div>
<br class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649inbox-inbox-Apple-interchange-newline">
</div>
</div>
<br class="">
<fieldset class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649mimeAttachmentHeader"></fieldset>
<br class="">
</blockquote>
</div>
<div bgcolor="#FFFFFF" text="#000000" class="">
<blockquote type="cite" class="">
<pre class="">_______________________________________________
LLVM Developers mailing list
<a class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</div>
<div bgcolor="#FFFFFF" text="#000000" class=""> <br class=""><span class="m_-495019445101160162HOEnZb"><font color="#888888" class="">
<pre class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137m_-895338599256642649moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</font></span></div><span class="m_-495019445101160162HOEnZb"><font color="#888888" class="">
</font></span></blockquote><span class="m_-495019445101160162HOEnZb"><font color="#888888" class="">
</font></span></div><span class="m_-495019445101160162HOEnZb"><font color="#888888" class="">
</font></span></blockquote><span class="m_-495019445101160162HOEnZb"><font color="#888888" class="">
<br class="">
<pre class="m_-495019445101160162m_-8452059004670669254m_3422182665239432404m_-6805375126177304137moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</font></span></div></blockquote></div><span class="m_-495019445101160162HOEnZb"><font color="#888888" class="">
_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
</font></span></blockquote></div></div>
<br class="">_______________________________________________<br class="">
LLVM Developers mailing list<br class="">
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div></blockquote></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>