Data layout information allows to answer questions about the size and alignment properties of a type. It enables, among others, the generation of various linear memory addressing schemes for containers of abstract types and deeper reasoning about vectors. This introduces the subsystem for modeling data layouts in MLIR. The data layout subsystem is designed to scale to MLIR's open type and operation system. At the top level, it consists of attribute interfaces that can be implemented by concrete data layout specifications; type interfaces that should be implemented by types subject to data layout; operation interfaces that must be implemented by operations that can serve as data layout scopes (e.g., modules); and dialect interfaces for data layout properties unrelated to specific types. Built-in types are handled specially to decrease the overall query cost. A concrete default implementation of these interfaces is provided in the new Target dialect. Defaults for built-in types that match the current behavior are also provided. Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D97067
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
//===- TestDialect.h - MLIR Dialect for testing -----------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines a fake 'test' dialect that can be used for testing things
|
|
// that do not have a respective counterpart in the main source directories.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MLIR_TESTDIALECT_H
|
|
#define MLIR_TESTDIALECT_H
|
|
|
|
#include "TestInterfaces.h"
|
|
#include "mlir/Dialect/DLTI/DLTI.h"
|
|
#include "mlir/Dialect/DLTI/Traits.h"
|
|
#include "mlir/Dialect/Traits.h"
|
|
#include "mlir/IR/BuiltinOps.h"
|
|
#include "mlir/IR/BuiltinTypes.h"
|
|
#include "mlir/IR/Dialect.h"
|
|
#include "mlir/IR/OpDefinition.h"
|
|
#include "mlir/IR/OpImplementation.h"
|
|
#include "mlir/IR/RegionKindInterface.h"
|
|
#include "mlir/IR/SymbolTable.h"
|
|
#include "mlir/Interfaces/CallInterfaces.h"
|
|
#include "mlir/Interfaces/ControlFlowInterfaces.h"
|
|
#include "mlir/Interfaces/CopyOpInterface.h"
|
|
#include "mlir/Interfaces/DerivedAttributeOpInterface.h"
|
|
#include "mlir/Interfaces/InferTypeOpInterface.h"
|
|
#include "mlir/Interfaces/SideEffectInterfaces.h"
|
|
|
|
namespace mlir {
|
|
class DLTIDialect;
|
|
} // namespace mlir
|
|
|
|
#include "TestOpEnums.h.inc"
|
|
#include "TestOpInterfaces.h.inc"
|
|
#include "TestOpStructs.h.inc"
|
|
#include "TestOpsDialect.h.inc"
|
|
|
|
#define GET_OP_CLASSES
|
|
#include "TestOps.h.inc"
|
|
|
|
namespace mlir {
|
|
namespace test {
|
|
void registerTestDialect(DialectRegistry ®istry);
|
|
} // namespace test
|
|
} // namespace mlir
|
|
|
|
#endif // MLIR_TESTDIALECT_H
|