LLVM 23.0.0git
AMDGPUTargetInfo.cpp
Go to the documentation of this file.
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
16
17using namespace llvm;
18
19/// The target for R600 GPUs.
21 static Target TheAMDGPUTarget;
22 return TheAMDGPUTarget;
23}
24
25/// The target for GCN GPUs.
27 static Target TheGCNTarget;
28 return TheGCNTarget;
29}
30
31/// The target for GCN GPUs, registered under the legacy "amdgcn" name. This
32/// should be removed when all tool users of "amdgcn" are migrated.
34 static Target TheGCNLegacyTarget;
35 return TheGCNLegacyTarget;
36}
37
38/// Extern function to initialize the targets for the AMDGPU backend
42 "AMD GPUs HD2XXX-HD6XXX", "AMDGPU");
43 Target &GCNTgt = getTheGCNTarget();
44 RegisterTarget<Triple::amdgpu, false> GCN(GCNTgt, "amdgpu", "AMDGPU gfx6+",
45 "AMDGPU");
46
47 // Register the legacy "amdgcn" name for use with -march. It must not take
48 // possession of the Triple::amdgpu tag, so it uses a match function that
49 // never matches a triple. This hack is copied from AArch64's handling of
50 // "arm64".
52 "legacy name for amdgpu", "AMDGPU",
53 [](Triple::ArchType) { return false; });
54}
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTargetInfo()
Extern function to initialize the targets for the AMDGPU backend.
#define LLVM_ABI
Definition Compiler.h:215
#define LLVM_EXTERNAL_VISIBILITY
Definition Compiler.h:132
Target - Wrapper for Target specific information.
This is an optimization pass for GlobalISel generic memory operations.
Target & getTheR600Target()
The target for R600 GPUs.
Target & getTheGCNTarget()
The target for GCN GPUs.
Target & getTheGCNLegacyTarget()
The target for GCN GPUs, registered under the legacy "amdgcn" architecture name for use with -march.
RegisterTarget - Helper template for registering a target, for use in the target's initialization fun...
static LLVM_ABI void RegisterTarget(Target &T, const char *Name, const char *ShortDesc, const char *BackendName, Target::ArchMatchFnTy ArchMatchFn, bool HasJIT=false)
RegisterTarget - Register the given target.