2012-05-05 04:18:50 +08:00
|
|
|
//===-- NVPTXTargetInfo.cpp - NVPTX Target Implementation -----------------===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-05-05 04:18:50 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2019-05-15 07:56:18 +08:00
|
|
|
#include "TargetInfo/NVPTXTargetInfo.h"
|
2012-05-05 04:18:50 +08:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
2016-10-10 07:00:34 +08:00
|
|
|
Target &llvm::getTheNVPTXTarget32() {
|
|
|
|
static Target TheNVPTXTarget32;
|
|
|
|
return TheNVPTXTarget32;
|
|
|
|
}
|
|
|
|
Target &llvm::getTheNVPTXTarget64() {
|
|
|
|
static Target TheNVPTXTarget64;
|
|
|
|
return TheNVPTXTarget64;
|
|
|
|
}
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2019-06-11 11:21:13 +08:00
|
|
|
extern "C" void LLVMInitializeNVPTXTargetInfo() {
|
2016-10-10 07:00:34 +08:00
|
|
|
RegisterTarget<Triple::nvptx> X(getTheNVPTXTarget32(), "nvptx",
|
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
2017-11-16 07:55:44 +08:00
|
|
|
"NVIDIA PTX 32-bit", "NVPTX");
|
2016-10-10 07:00:34 +08:00
|
|
|
RegisterTarget<Triple::nvptx64> Y(getTheNVPTXTarget64(), "nvptx64",
|
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
2017-11-16 07:55:44 +08:00
|
|
|
"NVIDIA PTX 64-bit", "NVPTX");
|
2012-05-05 04:18:50 +08:00
|
|
|
}
|