1//===---- TargetLoweringInfo.h - 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.h.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_LIB_CIR_DIALECT_TRANSFORMS_TARGETLOWERING_TARGETLOWERINGINFO_H
15#define LLVM_CLANG_LIB_CIR_DIALECT_TRANSFORMS_TARGETLOWERING_TARGETLOWERINGINFO_H
16
17#include "clang/CIR/Dialect/IR/CIROpsEnums.h"
18#include <memory>
19#include <string>
20
21namespace llvm {
22class Triple;
23} // namespace llvm
24
25namespace cir {
26
27class TargetLoweringInfo {
28public:
29 virtual ~TargetLoweringInfo();
30
31 virtual cir::SyncScopeKind
32 convertSyncScope(cir::SyncScopeKind syncScope) const;
33
34 virtual unsigned
35 getTargetAddrSpaceFromCIRAddrSpace(cir::LangAddressSpace addrSpace) const {
36 return 0;
37 };
38};
39
40/// Select target lowering rules without constructing language or ABI state.
41std::unique_ptr<TargetLoweringInfo>
42createTargetLoweringInfo(const llvm::Triple &triple);
43
44// Target-specific factory functions.
45std::unique_ptr<TargetLoweringInfo> createAMDGPUTargetLoweringInfo();
46
47std::unique_ptr<TargetLoweringInfo> createNVPTXTargetLoweringInfo();
48
49std::unique_ptr<TargetLoweringInfo> createCommonSPIRTargetLoweringInfo();
50
51std::unique_ptr<TargetLoweringInfo> createSPIRVTargetLoweringInfo();
52
53} // namespace cir
54
55#endif
56