MLIR
20.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 uint64_t | 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 uint64_t | extractABIAlignment (DataLayoutEntryInterface entry) |
static uint64_t | getIntegerTypeABIAlignment (IntegerType intType, ArrayRef< DataLayoutEntryInterface > params) |
static uint64_t | getFloatTypeABIAlignment (FloatType fltType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params) |
static uint64_t | extractPreferredAlignment (DataLayoutEntryInterface entry) |
static uint64_t | getIntegerTypePreferredAlignment (IntegerType intType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params) |
static uint64_t | getFloatTypePreferredAlignment (FloatType fltType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params) |
static DataLayoutSpecInterface | getSpec (Operation *operation) |
static TargetSystemSpecInterface | getTargetSystemSpec (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) |
template<typename T > | |
static T | cachedLookup (Type t, DenseMap< Type, T > &cache, function_ref< T(Type)> compute) |
Looks up the value for the given type key in the given cache. More... | |
Variables | |
constexpr static const uint64_t | kDefaultBitsInByte = 8u |
|
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 513 of file DataLayoutInterfaces.cpp.
void checkMissingLayout | ( | DataLayoutSpecInterface | originalLayout, |
OpTy | op | ||
) |
Definition at line 443 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 348 of file DataLayoutInterfaces.cpp.
References mlir::Operation::getParentOp().
Referenced by mlir::DataLayout::DataLayout(), getCombinedDataLayout(), and mlir::detail::verifyDataLayoutOp().
|
static |
Definition at line 109 of file DataLayoutInterfaces.cpp.
References kDefaultBitsInByte.
Referenced by getFloatTypeABIAlignment(), and getIntegerTypeABIAlignment().
|
static |
Definition at line 168 of file DataLayoutInterfaces.cpp.
References kDefaultBitsInByte.
Referenced by getFloatTypePreferredAlignment(), and getIntegerTypePreferredAlignment().
|
static |
Definition at line 92 of file DataLayoutInterfaces.cpp.
References mlir::Type::getIntOrFloatBitWidth().
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 379 of file DataLayoutInterfaces.cpp.
References collectParentLayouts(), and getSpec().
Referenced by mlir::detail::verifyDataLayoutOp().
|
static |
Definition at line 131 of file DataLayoutInterfaces.cpp.
References extractABIAlignment(), and mlir::DataLayout::getTypeSize().
Referenced by mlir::detail::getDefaultABIAlignment().
|
static |
Definition at line 185 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::getDefaultIndexBitwidth(), mlir::detail::getDefaultPreferredAlignment(), and mlir::detail::getDefaultTypeSizeInBits().
|
static |
Definition at line 116 of file DataLayoutInterfaces.cpp.
References mlir::detail::divideCeil(), extractABIAlignment(), findEntryForIntegerType(), and kDefaultBitsInByte.
Referenced by mlir::detail::getDefaultABIAlignment().
|
static |
Definition at line 175 of file DataLayoutInterfaces.cpp.
References extractPreferredAlignment(), findEntryForIntegerType(), and mlir::DataLayout::getTypeSize().
Referenced by mlir::detail::getDefaultPreferredAlignment().
|
static |
Definition at line 325 of file DataLayoutInterfaces.cpp.
Referenced by getCombinedDataLayout(), and mlir::detail::verifyDataLayoutOp().
|
static |
Definition at line 335 of file DataLayoutInterfaces.cpp.
References mlir::Operation::getParentOfType().
|
static |
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().
|
staticconstexpr |
Definition at line 107 of file DataLayoutInterfaces.cpp.
Referenced by extractABIAlignment(), extractPreferredAlignment(), and getIntegerTypeABIAlignment().