clang 24.0.0git
TargetLoweringInfo.cpp
Go to the documentation of this file.
1//===---- TargetLoweringInfo.cpp - Encapsulate target details ---*- C++ -*-===//
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// This file partially mimics the TargetCodeGenInfo class from the file
10// clang/lib/CodeGen/TargetInfo.cpp.
11//
12//===----------------------------------------------------------------------===//
13
14#include "TargetLoweringInfo.h"
16#include "llvm/TargetParser/Triple.h"
17
18namespace cir {
19
21
22cir::SyncScopeKind
23TargetLoweringInfo::convertSyncScope(cir::SyncScopeKind syncScope) const {
24 // By default, targets don't deal with sync scopes other than system scope.
25 return cir::SyncScopeKind::System;
26}
27
28std::unique_ptr<TargetLoweringInfo>
29createTargetLoweringInfo(const llvm::Triple &triple) {
30 switch (triple.getArch()) {
31 case llvm::Triple::amdgpu:
33 case llvm::Triple::nvptx:
34 case llvm::Triple::nvptx64:
36 case llvm::Triple::spir:
37 case llvm::Triple::spir64:
39 case llvm::Triple::spirv:
40 case llvm::Triple::spirv32:
41 case llvm::Triple::spirv64:
43 default:
45 return std::make_unique<TargetLoweringInfo>();
46 }
47}
48
49} // namespace cir
virtual cir::SyncScopeKind convertSyncScope(cir::SyncScopeKind syncScope) const
std::unique_ptr< TargetLoweringInfo > createCommonSPIRTargetLoweringInfo()
Definition SPIRV.cpp:53
std::unique_ptr< TargetLoweringInfo > createSPIRVTargetLoweringInfo()
Definition SPIRV.cpp:57
std::unique_ptr< TargetLoweringInfo > createTargetLoweringInfo(const llvm::Triple &triple)
Select target lowering rules without constructing language or ABI state.
std::unique_ptr< TargetLoweringInfo > createNVPTXTargetLoweringInfo()
Definition NVPTX.cpp:44
std::unique_ptr< TargetLoweringInfo > createAMDGPUTargetLoweringInfo()
Definition AMDGPU.cpp:50
static bool targetLoweringInfo()