This is an archive of the discontinued LLVM Phabricator instance.

gn build: Add NVPTX target
ClosedPublic

Authored by thakis on Jun 12 2019, 8:27 AM.

Details

Summary

The NVPTX target is a bit unusual in that it's the only target without a disassembler, and one of three targets without an asm parser (and the first one of those three in the gn build). NVPTX doesn't have those because it's not a binary format.

The CMake build checks for the existence of {AsmParser,Disassembler}/CMakeLists.txt when setting LLVM_ENUM_ASM_PARSERS / LLVM_ENUM_DISASSEBLERS (http://llvm-cs.pcc.me.uk/CMakeLists.txt#744). The GN build doesn't want to hit the disk for things like this, so instead I'm adding explicit targets_with_asm_parsers and targets_with_disassemblers lists. Since both are needed rarely, they are defined in their own gni files.

Diff Detail

Event Timeline

thakis created this revision.Jun 12 2019, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2019, 8:27 AM
tra added a subscriber: tra.Jun 13 2019, 11:01 AM

Yay! Thank you. Lack of this has stopped me when I tried gn last time. I'll try again once this patch lands.

phosek accepted this revision.Jun 14 2019, 10:45 AM

Since you always include all three of //llvm/lib/Target/targets.gni, //llvm/lib/Target/targets_with_asm_parsers.gni, //llvm/lib/Target/targets_with_disassemblers.gni, why not just combine all of them into //llvm/lib/Target/targets.gni? If we ever need them separately and performance becomes an issue, we can split them later.

LGTM otherwise.

This revision is now accepted and ready to land.Jun 14 2019, 10:45 AM

Thanks! Most includes of targets.gni don't need the two new files: http://llvm-cs.pcc.me.uk/?q=targets.gni

I could combine the two files into one, but I couldn't think of a good name :P

This revision was automatically updated to reflect the committed changes.