Page MenuHomePhabricator

Always build all back-end table-gen files
AbandonedPublic

Authored by rengolin on Mar 10 2015, 4:16 AM.

Details

Summary

This commit allows all table-gen files to be generated irrespective of the
back-ends that were requested to be built. The purpose of this change is to
allow target-specific behaviour to be included in a generic target description
library that will always be built and be accessible to LLVM internal libraries
such as the assemblers and generic code-gen, as well all external tools, such
as Clang, lli, llc, lld, lldb, etc.

With this information available, the external tools will be able to use the
target-specific knowledge LLVM already has, externalised via the target
description API, to query, parse and understand architecture behaviour and
propseties without carrying such knowledge themselves.

This would ultimately common up *all* knowledge of all targets, so not only
we reduce the amount of duplication, but also we get it right on every tool,
not just the ones that we happened to coincide.

The biggest beneficiary of this change will be Clang, especially related to
the driver (for parsing and undertanding command-line options), as well as
ABI decisions and specific target behaviour during IR generation.

There is an obvious addition of compile time, but since table generation is
only a small part of the total compilation time (no more than 5% if all tables
are built), it won't amount to any significant change, even on slow targets,
such as ARM boards. Also, no generated file will be included if not strictly
needed, so the additional space taken on final binaries will be zero.

Diff Detail

Event Timeline

rengolin updated this revision to Diff 21562.Mar 10 2015, 4:16 AM
rengolin retitled this revision from to Always build all back-end table-gen files.
rengolin updated this object.
rengolin edited the test plan for this revision. (Show Details)
rengolin set the repository for this revision to rL LLVM.
rengolin added subscribers: Unknown Object (MLST), Unknown Object (MLST), rjmccall, mcrosier.
mkuper added a subscriber: mkuper.Mar 10 2015, 9:35 AM

When measuring the effect on total compilation time, did you measure release or debug builds?
The effect on debug builds may be much more significant, because it uses the just-built debug tablegen to generate the files, which can be incredibly slow.

lib/Target/BPF/CMakeTblGen.txt
7

This should probably be BPF

As I said in the email thread, I might start by adding only *GenRegisterInfo.inc and *GenSubtargetInfo.inc to reduce the compilation time and not include *all* files unnecessarily. I'll re-post the patch with that change.

And yes, that's a release build, so debug builds will have a lot bigger changes, but maybe still proportional to the overall time, which is also longer.

lib/Target/BPF/CMakeTblGen.txt
7

Hum... I'm not sure that's not intentional... BPF is not real hardware, but a meta-abstraction for the kernel, which I believe was only supported by X86. I'll have to check.

rengolin updated this revision to Diff 22002.Mar 15 2015, 1:32 PM
rengolin removed rL LLVM as the repository for this revision.

Changing the attribution section to not duplicate information. Following last round of consensus on the mailing list.

rengolin updated this revision to Diff 22004.Mar 15 2015, 1:35 PM

Sorry, uploaded a new patch to the wrong revision...

rengolin abandoned this revision.Mar 20 2015, 4:32 AM

So, it seems people are generally in agreement that we could always build *some* table gen files. And the question about why this is important cannot be answered properly without some real code around it.

I'll abandon this revision in favour of coming back with the real code, and only including the one or two files that always need to be built. We can continue from there.

Thanks everyone for the review.