MLIR  15.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::DataLayout Class Reference

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...
 

Static Public Member Functions

static DataLayout closest (Operation *op)
 Returns the layout of the closest parent operation carrying layout info. More...
 

Detailed Description

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 141 of file DataLayoutInterfaces.h.

Constructor & Destructor Documentation

◆ DataLayout() [1/3]

mlir::DataLayout::DataLayout ( )
explicit

Definition at line 346 of file DataLayoutInterfaces.cpp.

Referenced by closest().

◆ DataLayout() [2/3]

mlir::DataLayout::DataLayout ( DataLayoutOpInterface  op)
explicit

Definition at line 348 of file DataLayoutInterfaces.cpp.

References checkMissingLayout(), and collectParentLayouts().

◆ DataLayout() [3/3]

mlir::DataLayout::DataLayout ( ModuleOp  op)
explicit

Definition at line 356 of file DataLayoutInterfaces.cpp.

References checkMissingLayout(), and collectParentLayouts().

Member Function Documentation

◆ closest()

mlir::DataLayout mlir::DataLayout::closest ( Operation op)
static

Returns the layout of the closest parent operation carrying layout info.

Definition at line 364 of file DataLayoutInterfaces.cpp.

References collectParentLayouts(), DataLayout(), getCombinedDataLayout(), and mlir::Operation::getParentOp().

Referenced by defaultIsSmallAlloc(), foldTransferInBoundsAttribute(), mlir::linalg::promoteSubViews(), and verifyTransferOp().

◆ getTypeABIAlignment()

unsigned mlir::DataLayout::getTypeABIAlignment ( Type  t) const

◆ getTypePreferredAlignment()

unsigned mlir::DataLayout::getTypePreferredAlignment ( Type  t) const

◆ getTypeSize()

unsigned mlir::DataLayout::getTypeSize ( Type  t) const

◆ getTypeSizeInBits()

unsigned mlir::DataLayout::getTypeSizeInBits ( Type  t) const

The documentation for this class was generated from the following files: