This is an archive of the discontinued LLVM Phabricator instance.

[gn build] Add build files for Target/X86/... and for tools/llc
ClosedPublic

Authored by thakis on Dec 10 2018, 10:25 AM.

Details

Summary

The tablegen setup for Target/X86 is a bit different from the CMake build: In the CMake build, Target/X86/CMakeLists.txt has a single tablegen target that does everything. But some of the generated files are only used privately by a subproject, so in the GN build some of the tablegen invocations are smaller-scoped, mostly for build cleanliness. (It helps also a tiny bit with build parallelism since now e.g. the cpp files in MCTargetDesc can build after just 3 .inc files are generated instead of being blocked on all 13. But it's not a big win, since things depending on Target still need to wait for all 11, even though all .inc file use is internal to lib/Target.)

Also add a build file for llc, since now all its dependencies have build files.

Diff Detail

Event Timeline

thakis created this revision.Dec 10 2018, 10:25 AM
phosek added inline comments.Dec 10 2018, 7:40 PM
llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
11

Is this intentional? If yes, can you comment on why is arm32 and arm64 being disabled?

thakis marked an inline comment as done.Dec 11 2018, 3:14 AM
thakis added inline comments.
llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
11

Yes, it's because lib/Target/BUILD.gn now use llvm_targets_to_build to set up forwarding targets but lib/Target/ARM/BUILD.gn and lib/Target/AArch64/BUILD.gn don't exist yet. When I add them I'm going to add these back. It's hopefully just commented out for a few days.

phosek accepted this revision.Dec 11 2018, 11:01 AM

LGTM

llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
11

I see, would it be possible to at least leave a TODO here so it's obvious why this is commented out?

This revision is now accepted and ready to land.Dec 11 2018, 11:01 AM
thakis marked an inline comment as done.Dec 11 2018, 4:02 PM

Thanks!

llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
11

I'll land the patch with the lines removed, not commented out. Then the file will look less weird in the meantime, and the patch adding these targets will look less mysterious too.

This revision was automatically updated to reflect the committed changes.