#include "mlir/Dialect/DLTI/DLTI.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectImplementation.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
usingnamespacemlir;
#include "mlir/Dialect/DLTI/DLTIDialect.cpp.inc"
#define GET_ATTRDEF_CLASSES
#include "mlir/Dialect/DLTI/DLTIAttrs.cpp.inc"
#define DEBUG_TYPE …
namespace mlir {
namespace detail {
class DataLayoutEntryAttrStorage : public AttributeStorage { … };
}
}
DataLayoutEntryAttr DataLayoutEntryAttr::get(StringAttr key, Attribute value) { … }
DataLayoutEntryAttr DataLayoutEntryAttr::get(Type key, Attribute value) { … }
DataLayoutEntryKey DataLayoutEntryAttr::getKey() const { … }
Attribute DataLayoutEntryAttr::getValue() const { … }
Attribute DataLayoutEntryAttr::parse(AsmParser &parser, Type ty) { … }
void DataLayoutEntryAttr::print(AsmPrinter &os) const { … }
static LogicalResult verifyEntries(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<DataLayoutEntryInterface> entries) { … }
LogicalResult MapAttr::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<DataLayoutEntryInterface> entries) { … }
LogicalResult
DataLayoutSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<DataLayoutEntryInterface> entries) { … }
static void
overwriteDuplicateEntries(SmallVectorImpl<DataLayoutEntryInterface> &oldEntries,
ArrayRef<DataLayoutEntryInterface> newEntries) { … }
static LogicalResult
combineOneSpec(DataLayoutSpecInterface spec,
DenseMap<TypeID, DataLayoutEntryList> &entriesForType,
DenseMap<StringAttr, DataLayoutEntryInterface> &entriesForID) { … }
DataLayoutSpecAttr
DataLayoutSpecAttr::combineWith(ArrayRef<DataLayoutSpecInterface> specs) const { … }
StringAttr
DataLayoutSpecAttr::getEndiannessIdentifier(MLIRContext *context) const { … }
StringAttr
DataLayoutSpecAttr::getAllocaMemorySpaceIdentifier(MLIRContext *context) const { … }
StringAttr DataLayoutSpecAttr::getProgramMemorySpaceIdentifier(
MLIRContext *context) const { … }
StringAttr
DataLayoutSpecAttr::getGlobalMemorySpaceIdentifier(MLIRContext *context) const { … }
StringAttr
DataLayoutSpecAttr::getStackAlignmentIdentifier(MLIRContext *context) const { … }
Attribute DataLayoutSpecAttr::parse(AsmParser &parser, Type type) { … }
void DataLayoutSpecAttr::print(AsmPrinter &os) const { … }
namespace mlir {
template <>
struct FieldParser<DeviceIDTargetDeviceSpecPair> { … };
inline AsmPrinter &operator<<(AsmPrinter &printer,
DeviceIDTargetDeviceSpecPair param) { … }
}
LogicalResult
TargetDeviceSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<DataLayoutEntryInterface> entries) { … }
LogicalResult
TargetSystemSpecAttr::verify(function_ref<InFlightDiagnostic()> emitError,
ArrayRef<DeviceIDTargetDeviceSpecPair> entries) { … }
static std::pair<DLTIQueryInterface, Operation *>
getClosestQueryable(Operation *op) { … }
FailureOr<Attribute>
dlti::query(Operation *op, ArrayRef<DataLayoutEntryKey> keys, bool emitError) { … }
constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutAttrName;
constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutEndiannessKey;
constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutEndiannessBig;
constexpr const StringLiteral mlir::DLTIDialect::kDataLayoutEndiannessLittle;
namespace {
class TargetDataLayoutInterface : public DataLayoutDialectInterface { … };
}
void DLTIDialect::initialize() { … }
LogicalResult DLTIDialect::verifyOperationAttribute(Operation *op,
NamedAttribute attr) { … }