MLIR
17.0.0git
|
The main mechanism for performing data layout queries. More...
#include "mlir/Interfaces/DataLayoutInterfaces.h"
Public Member Functions | |
DataLayout () | |
DataLayout (DataLayoutOpInterface op) | |
DataLayout (ModuleOp op) | |
unsigned | getTypeSize (Type t) const |
Returns the size of the given type in the current scope. More... | |
unsigned | getTypeSizeInBits (Type t) const |
Returns the size in bits of the given type in the current scope. More... | |
unsigned | getTypeABIAlignment (Type t) const |
Returns the required alignment of the given type in the current scope. More... | |
unsigned | getTypePreferredAlignment (Type t) const |
Returns the preferred of the given type in the current scope. More... | |
Attribute | getAllocaMemorySpace () const |
Returns the memory space used for AllocaOps. More... | |
Static Public Member Functions | |
static DataLayout | closest (Operation *op) |
Returns the layout of the closest parent operation carrying layout info. More... | |
The main mechanism for performing data layout queries.
Instances of this class can be created for an operation implementing DataLayoutOpInterface. Upon construction, a layout spec combining that of the given operation with all its ancestors will be computed and used to handle further requests. For efficiency, results to all requests will be cached in this object. Therefore, if the data layout spec for the scoping operation, or any of the enclosing operations, changes, the cache is no longer valid. The user is responsible creating a new DataLayout object after any spec change. In debug mode, the cache validity is being checked in every request.
Definition at line 145 of file DataLayoutInterfaces.h.
|
explicit |
Definition at line 358 of file DataLayoutInterfaces.cpp.
|
explicit |
Definition at line 360 of file DataLayoutInterfaces.cpp.
References checkMissingLayout(), and collectParentLayouts().
|
explicit |
Definition at line 369 of file DataLayoutInterfaces.cpp.
References checkMissingLayout(), and collectParentLayouts().
|
static |
Returns the layout of the closest parent operation carrying layout info.
Definition at line 378 of file DataLayoutInterfaces.cpp.
References mlir::Operation::getParentOp().
Referenced by defaultIsSmallAlloc().
mlir::Attribute mlir::DataLayout::getAllocaMemorySpace | ( | ) | const |
Returns the memory space used for AllocaOps.
Definition at line 473 of file DataLayoutInterfaces.cpp.
References mlir::detail::getDefaultAllocaMemorySpace().
unsigned mlir::DataLayout::getTypeABIAlignment | ( | Type | t | ) | const |
Returns the required alignment of the given type in the current scope.
Definition at line 449 of file DataLayoutInterfaces.cpp.
References cachedLookup(), mlir::detail::getDefaultABIAlignment(), and mlir::Type::getTypeID().
Referenced by calculateStructAlignment(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), getFloatTypePreferredAlignment(), mlir::LLVM::LLVMStructType::getTypeSizeInBits(), and translateDataLayout().
unsigned mlir::DataLayout::getTypePreferredAlignment | ( | Type | t | ) | const |
Returns the preferred of the given type in the current scope.
Definition at line 461 of file DataLayoutInterfaces.cpp.
References cachedLookup(), mlir::detail::getDefaultPreferredAlignment(), and mlir::Type::getTypeID().
Referenced by mlir::detail::getDefaultPreferredAlignment(), and translateDataLayout().
unsigned mlir::DataLayout::getTypeSize | ( | Type | t | ) | const |
Returns the size of the given type in the current scope.
Definition at line 425 of file DataLayoutInterfaces.cpp.
References cachedLookup(), mlir::detail::getDefaultTypeSize(), and mlir::Type::getTypeID().
Referenced by allocBuffer(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultTypeSizeInBits(), getFloatTypeABIAlignment(), getIntegerTypePreferredAlignment(), mlir::LLVMTypeConverter::getMemRefDescriptorSize(), mlir::LLVM::LLVMStructType::getTypeSizeInBits(), mlir::LLVMTypeConverter::getUnrankedMemRefDescriptorSize(), and handleByValArgument().
unsigned mlir::DataLayout::getTypeSizeInBits | ( | Type | t | ) | const |
Returns the size in bits of the given type in the current scope.
Definition at line 437 of file DataLayoutInterfaces.cpp.
References cachedLookup(), mlir::detail::getDefaultTypeSizeInBits(), and mlir::Type::getTypeID().
Referenced by defaultIsSmallAlloc(), mlir::detail::getDefaultTypeSizeInBits(), mlir::LowerToLLVMOptions::LowerToLLVMOptions(), translateDataLayout(), and verifyTransferOp().