#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"
usingnamespacemlir;
[[noreturn]] static void reportMissingDataLayout(Type type) { … }
static uint64_t getIndexBitwidth(DataLayoutEntryListRef params) { … }
llvm::TypeSize
mlir::detail::getDefaultTypeSize(Type type, const DataLayout &dataLayout,
ArrayRef<DataLayoutEntryInterface> params) { … }
llvm::TypeSize
mlir::detail::getDefaultTypeSizeInBits(Type type, const DataLayout &dataLayout,
DataLayoutEntryListRef params) { … }
static DataLayoutEntryInterface
findEntryForIntegerType(IntegerType intType,
ArrayRef<DataLayoutEntryInterface> params) { … }
constexpr const static uint64_t kDefaultBitsInByte = …;
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) { … }
uint64_t mlir::detail::getDefaultABIAlignment(
Type type, 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) { … }
uint64_t mlir::detail::getDefaultPreferredAlignment(
Type type, const DataLayout &dataLayout,
ArrayRef<DataLayoutEntryInterface> params) { … }
std::optional<uint64_t> mlir::detail::getDefaultIndexBitwidth(
Type type, const DataLayout &dataLayout,
ArrayRef<DataLayoutEntryInterface> params) { … }
Attribute mlir::detail::getDefaultEndianness(DataLayoutEntryInterface entry) { … }
Attribute
mlir::detail::getDefaultAllocaMemorySpace(DataLayoutEntryInterface entry) { … }
Attribute
mlir::detail::getDefaultProgramMemorySpace(DataLayoutEntryInterface entry) { … }
Attribute
mlir::detail::getDefaultGlobalMemorySpace(DataLayoutEntryInterface entry) { … }
uint64_t
mlir::detail::getDefaultStackAlignment(DataLayoutEntryInterface entry) { … }
std::optional<Attribute>
mlir::detail::getDevicePropertyValue(DataLayoutEntryInterface entry) { … }
DataLayoutEntryList
mlir::detail::filterEntriesForType(DataLayoutEntryListRef entries,
TypeID typeID) { … }
DataLayoutEntryInterface
mlir::detail::filterEntryForIdentifier(DataLayoutEntryListRef entries,
StringAttr id) { … }
static DataLayoutSpecInterface getSpec(Operation *operation) { … }
static TargetSystemSpecInterface getTargetSystemSpec(Operation *operation) { … }
static void
collectParentLayouts(Operation *leaf,
SmallVectorImpl<DataLayoutSpecInterface> &specs,
SmallVectorImpl<Location> *opLocations = nullptr) { … }
static DataLayoutSpecInterface getCombinedDataLayout(Operation *leaf) { … }
LogicalResult mlir::detail::verifyDataLayoutOp(Operation *op) { … }
llvm::TypeSize mlir::detail::divideCeil(llvm::TypeSize numerator,
uint64_t denominator) { … }
template <typename OpTy>
void checkMissingLayout(DataLayoutSpecInterface originalLayout, OpTy op) { … }
mlir::DataLayout::DataLayout() : … { … }
mlir::DataLayout::DataLayout(DataLayoutOpInterface op)
: … { … }
mlir::DataLayout::DataLayout(ModuleOp op)
: … { … }
mlir::DataLayout mlir::DataLayout::closest(Operation *op) { … }
void mlir::DataLayout::checkValid() const { … }
template <typename T>
static T cachedLookup(Type t, DenseMap<Type, T> &cache,
function_ref<T(Type)> compute) { … }
llvm::TypeSize mlir::DataLayout::getTypeSize(Type t) const { … }
llvm::TypeSize mlir::DataLayout::getTypeSizeInBits(Type t) const { … }
uint64_t mlir::DataLayout::getTypeABIAlignment(Type t) const { … }
uint64_t mlir::DataLayout::getTypePreferredAlignment(Type t) const { … }
std::optional<uint64_t> mlir::DataLayout::getTypeIndexBitwidth(Type t) const { … }
mlir::Attribute mlir::DataLayout::getEndianness() const { … }
mlir::Attribute mlir::DataLayout::getAllocaMemorySpace() const { … }
mlir::Attribute mlir::DataLayout::getProgramMemorySpace() const { … }
mlir::Attribute mlir::DataLayout::getGlobalMemorySpace() const { … }
uint64_t mlir::DataLayout::getStackAlignment() const { … }
std::optional<Attribute> mlir::DataLayout::getDevicePropertyValue(
TargetSystemSpecInterface::DeviceID deviceID,
StringAttr propertyName) const { … }
void DataLayoutSpecInterface::bucketEntriesByType(
DenseMap<TypeID, DataLayoutEntryList> &types,
DenseMap<StringAttr, DataLayoutEntryInterface> &ids) { … }
LogicalResult mlir::detail::verifyDataLayoutSpec(DataLayoutSpecInterface spec,
Location loc) { … }
LogicalResult
mlir::detail::verifyTargetSystemSpec(TargetSystemSpecInterface spec,
Location loc) { … }
#include "mlir/Interfaces/DataLayoutAttrInterface.cpp.inc"
#include "mlir/Interfaces/DataLayoutOpInterface.cpp.inc"
#include "mlir/Interfaces/DataLayoutTypeInterface.cpp.inc"