1//===- DLTIBase.td - Target information dialect base defs ---*- tablegen -*-==// 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#ifndef DLTI_BASE 10#define DLTI_BASE 11 12include "mlir/IR/OpBase.td" 13 14def DLTI_Dialect : Dialect { 15 let name = "dlti"; 16 let cppNamespace = "::mlir"; 17 let hasOperationAttrVerify = 1; 18 19 let description = [{ 20 The Data Layout and Target Information (DLTI) dialect is intended to hold 21 attributes and other components pertaining to descriptions of in-memory 22 data layout and compilation targets. 23 }]; 24 25 let extraClassDeclaration = [{ 26 // Top-level attribute name for arbitrary description. 27 constexpr const static ::llvm::StringLiteral 28 kMapAttrName = "dlti.map"; 29 30 // Top-level attribute name for data layout description. 31 constexpr const static ::llvm::StringLiteral 32 kDataLayoutAttrName = "dlti.dl_spec"; 33 34 // Top-level attribute name for target system description. 35 constexpr const static ::llvm::StringLiteral 36 kTargetSystemDescAttrName = "dlti.target_system_spec"; 37 38 // Top-level attribute name for target device description. 39 constexpr const static ::llvm::StringLiteral 40 kTargetDeviceDescAttrName = "dlti.target_device_spec"; 41 42 // Constants used in entries. 43 constexpr const static ::llvm::StringLiteral 44 kDataLayoutEndiannessKey = "dlti.endianness"; 45 46 constexpr const static ::llvm::StringLiteral 47 kDataLayoutEndiannessBig = "big"; 48 49 constexpr const static ::llvm::StringLiteral 50 kDataLayoutEndiannessLittle = "little"; 51 52 constexpr const static ::llvm::StringLiteral 53 kDataLayoutAllocaMemorySpaceKey = "dlti.alloca_memory_space"; 54 55 constexpr const static ::llvm::StringLiteral 56 kDataLayoutProgramMemorySpaceKey = "dlti.program_memory_space"; 57 58 constexpr const static ::llvm::StringLiteral 59 kDataLayoutGlobalMemorySpaceKey = "dlti.global_memory_space"; 60 61 constexpr const static ::llvm::StringLiteral 62 kDataLayoutStackAlignmentKey = "dlti.stack_alignment"; 63 }]; 64 65 let useDefaultAttributePrinterParser = 1; 66} 67 68def HasDefaultDLTIDataLayout : NativeOpTrait<"HasDefaultDLTIDataLayout"> { 69 let cppNamespace = "::mlir"; 70} 71 72#endif // DLTI_BASE 73