Add backend name to Target to enable runtime info to be fed back into TableGen
authorDaniel Sanders <daniel_l_sanders@apple.com>
Wed, 15 Nov 2017 23:55:44 +0000 (23:55 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Wed, 15 Nov 2017 23:55:44 +0000 (23:55 +0000)
commit725584e26d79d00ad4b14cab15babc4b4499d22e
tree1fd7014eb2c42b0874001b6dc80bb8f5807bf91c
parent82665b1ec4a0057481e4c3a8d33c5070f0fdbda5
Add backend name to Target to enable runtime info to be fed back into TableGen

Summary:
Make it possible to feed runtime information back to tablegen to enable
profile-guided tablegen-eration, detection of untested tablegen definitions, etc.

Being a cross-compiler by nature, LLVM will potentially collect data for multiple
architectures (e.g. when running 'ninja check'). We therefore need a way for
TableGen to figure out what data applies to the backend it is generating at the
time. This patch achieves that by including the name of the 'def X : Target ...'
for the backend in the TargetRegistry.

Reviewers: qcolombet

Reviewed By: qcolombet

Subscribers: jholewinski, arsenm, jyknight, aditya_nandakumar, sdardis, nemanjai, ab, nhaehnle, t.p.northover, javed.absar, qcolombet, llvm-commits, fedor.sergeev

Differential Revision: https://reviews.llvm.org/D39742

llvm-svn: 318352
16 files changed:
llvm/include/llvm/Support/TargetRegistry.h
llvm/lib/Support/TargetRegistry.cpp
llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp
llvm/lib/Target/AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp
llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp
llvm/lib/Target/BPF/TargetInfo/BPFTargetInfo.cpp
llvm/lib/Target/Hexagon/TargetInfo/HexagonTargetInfo.cpp
llvm/lib/Target/Lanai/TargetInfo/LanaiTargetInfo.cpp
llvm/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp
llvm/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp
llvm/lib/Target/NVPTX/TargetInfo/NVPTXTargetInfo.cpp
llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp
llvm/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp
llvm/lib/Target/SystemZ/TargetInfo/SystemZTargetInfo.cpp
llvm/lib/Target/X86/TargetInfo/X86TargetInfo.cpp
llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp