| 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 | |
| 21 | namespace llvm { |
| 22 | class Triple; |
| 23 | } // namespace llvm |
| 24 | |
| 25 | namespace cir { |
| 26 | |
| 27 | class TargetLoweringInfo { |
| 28 | public: |
| 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. |
| 41 | std::unique_ptr<TargetLoweringInfo> |
| 42 | createTargetLoweringInfo(const llvm::Triple &triple); |
| 43 | |
| 44 | // Target-specific factory functions. |
| 45 | std::unique_ptr<TargetLoweringInfo> createAMDGPUTargetLoweringInfo(); |
| 46 | |
| 47 | std::unique_ptr<TargetLoweringInfo> createNVPTXTargetLoweringInfo(); |
| 48 | |
| 49 | std::unique_ptr<TargetLoweringInfo> createCommonSPIRTargetLoweringInfo(); |
| 50 | |
| 51 | std::unique_ptr<TargetLoweringInfo> createSPIRVTargetLoweringInfo(); |
| 52 | |
| 53 | } // namespace cir |
| 54 | |
| 55 | #endif |
| 56 | |