xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
1 //===-- TargetInfo/AMDGPUTargetInfo.cpp - TargetInfo for AMDGPU -----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "TargetInfo/AMDGPUTargetInfo.h"
14 #include "llvm/MC/TargetRegistry.h"
15 
16 using namespace llvm;
17 
18 /// The target for R600 GPUs.
19 Target &llvm::getTheR600Target() {
20   static Target TheAMDGPUTarget;
21   return TheAMDGPUTarget;
22 }
23 
24 /// The target for GCN GPUs.
25 Target &llvm::getTheGCNTarget() {
26   static Target TheGCNTarget;
27   return TheGCNTarget;
28 }
29 
30 /// Extern function to initialize the targets for the AMDGPU backend
31 extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetInfo() {
32   RegisterTarget<Triple::r600, false> R600(getTheR600Target(), "r600",
33                                            "AMD GPUs HD2XXX-HD6XXX", "AMDGPU");
34   RegisterTarget<Triple::amdgcn, false> GCN(getTheGCNTarget(), "amdgcn",
35                                             "AMD GCN GPUs", "AMDGPU");
36 }
37