MLIR
16.0.0git
|
#include "mlir/Interfaces/DataLayoutInterfaces.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Operation.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/MathExtras.h"
#include "mlir/Interfaces/DataLayoutAttrInterface.cpp.inc"
#include "mlir/Interfaces/DataLayoutOpInterface.cpp.inc"
#include "mlir/Interfaces/DataLayoutTypeInterface.cpp.inc"
Go to the source code of this file.
Functions | |
static void | reportMissingDataLayout (Type type) |
Reports that the given type is missing the data layout information and exits. More... | |
static unsigned | getIndexBitwidth (DataLayoutEntryListRef params) |
Returns the bitwidth of the index type if specified in the param list. More... | |
static DataLayoutEntryInterface | findEntryForIntegerType (IntegerType intType, ArrayRef< DataLayoutEntryInterface > params) |
static unsigned | extractABIAlignment (DataLayoutEntryInterface entry) |
static unsigned | getIntegerTypeABIAlignment (IntegerType intType, ArrayRef< DataLayoutEntryInterface > params) |
static unsigned | getFloatTypeABIAlignment (FloatType fltType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params) |
static unsigned | extractPreferredAlignment (DataLayoutEntryInterface entry) |
static unsigned | getIntegerTypePreferredAlignment (IntegerType intType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params) |
static unsigned | getFloatTypePreferredAlignment (FloatType fltType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params) |
static DataLayoutSpecInterface | getSpec (Operation *operation) |
static void | collectParentLayouts (Operation *leaf, SmallVectorImpl< DataLayoutSpecInterface > &specs, SmallVectorImpl< Location > *opLocations=nullptr) |
Populates opsWithLayout with the list of proper ancestors of leaf that are either modules or implement the DataLayoutOpInterface . More... | |
static DataLayoutSpecInterface | getCombinedDataLayout (Operation *leaf) |
Returns a layout spec that is a combination of the layout specs attached to the given operation and all its ancestors. More... | |
template<typename OpTy > | |
void | checkMissingLayout (DataLayoutSpecInterface originalLayout, OpTy op) |
static unsigned | cachedLookup (Type t, DenseMap< Type, unsigned > &cache, function_ref< unsigned(Type)> compute) |
Looks up the value for the given type key in the given cache. More... | |
|
static |
Looks up the value for the given type key in the given cache.
If there is no such value in the cache, compute it using the given callback and put it in the cache before returning.
Definition at line 401 of file DataLayoutInterfaces.cpp.
Referenced by mlir::DataLayout::getTypeABIAlignment(), mlir::DataLayout::getTypePreferredAlignment(), mlir::DataLayout::getTypeSize(), and mlir::DataLayout::getTypeSizeInBits().
void checkMissingLayout | ( | DataLayoutSpecInterface | originalLayout, |
OpTy | op | ||
) |
Definition at line 338 of file DataLayoutInterfaces.cpp.
Referenced by mlir::DataLayout::DataLayout().
|
static |
Populates opsWithLayout
with the list of proper ancestors of leaf
that are either modules or implement the DataLayoutOpInterface
.
Definition at line 250 of file DataLayoutInterfaces.cpp.
References mlir::Operation::getParentOp().
Referenced by mlir::DataLayout::closest(), mlir::DataLayout::DataLayout(), getCombinedDataLayout(), and mlir::detail::verifyDataLayoutOp().
|
static |
Definition at line 105 of file DataLayoutInterfaces.cpp.
Referenced by getFloatTypeABIAlignment(), and getIntegerTypeABIAlignment().
|
static |
Definition at line 160 of file DataLayoutInterfaces.cpp.
Referenced by getFloatTypePreferredAlignment(), and getIntegerTypePreferredAlignment().
|
static |
Definition at line 90 of file DataLayoutInterfaces.cpp.
Referenced by getIntegerTypeABIAlignment(), and getIntegerTypePreferredAlignment().
|
static |
Returns a layout spec that is a combination of the layout specs attached to the given operation and all its ancestors.
Definition at line 281 of file DataLayoutInterfaces.cpp.
References collectParentLayouts(), and getSpec().
Referenced by mlir::DataLayout::closest(), and mlir::detail::verifyDataLayoutOp().
|
static |
Definition at line 124 of file DataLayoutInterfaces.cpp.
References extractABIAlignment(), and mlir::DataLayout::getTypeSize().
Referenced by mlir::detail::getDefaultABIAlignment().
|
static |
Definition at line 177 of file DataLayoutInterfaces.cpp.
References extractPreferredAlignment(), and mlir::DataLayout::getTypeABIAlignment().
Referenced by mlir::detail::getDefaultPreferredAlignment().
|
static |
Returns the bitwidth of the index type if specified in the param list.
Assumes 64-bit index otherwise.
Definition at line 37 of file DataLayoutInterfaces.cpp.
Referenced by mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), and mlir::detail::getDefaultTypeSizeInBits().
|
static |
Definition at line 112 of file DataLayoutInterfaces.cpp.
References extractABIAlignment(), and findEntryForIntegerType().
Referenced by mlir::detail::getDefaultABIAlignment().
|
static |
Definition at line 167 of file DataLayoutInterfaces.cpp.
References extractPreferredAlignment(), findEntryForIntegerType(), and mlir::DataLayout::getTypeSize().
Referenced by mlir::detail::getDefaultPreferredAlignment().
|
static |
Definition at line 237 of file DataLayoutInterfaces.cpp.
Referenced by getCombinedDataLayout(), and mlir::detail::verifyDataLayoutOp().
Reports that the given type is missing the data layout information and exits.
Definition at line 26 of file DataLayoutInterfaces.cpp.
Referenced by mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultPreferredAlignment(), and mlir::detail::getDefaultTypeSizeInBits().