2012-12-12 05:25:42 +08:00
|
|
|
//===-- TargetInfo/AMDGPUTargetInfo.cpp - TargetInfo for AMDGPU -----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-06-08 04:28:43 +08:00
|
|
|
#include "AMDGPUTargetMachine.h"
|
2012-12-12 05:25:42 +08:00
|
|
|
#include "llvm/Support/TargetRegistry.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
2017-07-02 11:24:54 +08:00
|
|
|
/// \brief The target which supports all AMD GPUs. This will eventually
|
2015-01-07 02:00:21 +08:00
|
|
|
/// be deprecated and there will be a R600 target and a GCN target.
|
2016-10-10 07:00:34 +08:00
|
|
|
Target &llvm::getTheAMDGPUTarget() {
|
|
|
|
static Target TheAMDGPUTarget;
|
|
|
|
return TheAMDGPUTarget;
|
|
|
|
}
|
2015-01-07 02:00:21 +08:00
|
|
|
/// \brief The target for GCN GPUs
|
2016-10-10 07:00:34 +08:00
|
|
|
Target &llvm::getTheGCNTarget() {
|
|
|
|
static Target TheGCNTarget;
|
|
|
|
return TheGCNTarget;
|
|
|
|
}
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
/// \brief Extern function to initialize the targets for the AMDGPU backend
|
2015-06-13 11:28:10 +08:00
|
|
|
extern "C" void LLVMInitializeAMDGPUTargetInfo() {
|
2016-10-10 07:00:34 +08:00
|
|
|
RegisterTarget<Triple::r600, false> R600(getTheAMDGPUTarget(), "r600",
|
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
|
|
|
"AMD GPUs HD2XXX-HD6XXX", "AMDGPU");
|
2016-10-10 07:00:34 +08:00
|
|
|
RegisterTarget<Triple::amdgcn, false> GCN(getTheGCNTarget(), "amdgcn",
|
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
|
|
|
"AMD GCN GPUs", "AMDGPU");
|
2012-12-12 05:25:42 +08:00
|
|
|
}
|