15#include "llvm/ADT/TypeSwitch.h"
16#include "llvm/Support/MathExtras.h"
28 llvm::raw_string_ostream os(message);
29 os <<
"neither the scoping op nor the type class provide data layout "
32 llvm::report_fatal_error(Twine(message));
40 auto attr = cast<IntegerAttr>(params.front().getValue());
41 return attr.getValue().getZExtValue();
57 if (
auto ctype = dyn_cast<ComplexType>(type)) {
58 Type et = ctype.getElementType();
59 uint64_t innerAlignment =
65 return llvm::alignTo(innerSize, innerAlignment) + innerSize;
69 if (isa<IndexType>(type))
76 if (
auto vecType = dyn_cast<VectorType>(type)) {
77 uint64_t baseSize = vecType.getNumElements() / vecType.getShape().back() *
78 llvm::PowerOf2Ceil(vecType.getShape().back()) *
80 return llvm::TypeSize::get(baseSize, vecType.isScalable());
83 if (
auto typeInterface = dyn_cast<DataLayoutTypeInterface>(type))
84 return typeInterface.getTypeSizeInBits(dataLayout, params);
89static DataLayoutEntryInterface
92 assert(!params.empty() &&
"expected non-empty parameter list");
93 std::map<unsigned, DataLayoutEntryInterface> sortedParams;
94 for (DataLayoutEntryInterface entry : params) {
95 sortedParams.insert(std::make_pair(
96 cast<Type>(entry.getKey()).getIntOrFloatBitWidth(), entry));
98 auto iter = sortedParams.lower_bound(intType.getWidth());
99 if (iter == sortedParams.end())
100 iter = std::prev(iter);
109 cast<DenseIntElementsAttr>(entry.getValue()).getValues<uint64_t>();
116 constexpr uint64_t kDefaultSmallIntAlignment = 4u;
117 constexpr unsigned kSmallIntSize = 64;
118 if (params.empty()) {
119 return intType.getWidth() < kSmallIntSize
120 ? llvm::PowerOf2Ceil(
122 : kDefaultSmallIntAlignment;
131 assert(params.size() <= 1 &&
"at most one data layout entry is expected for "
132 "the singleton floating-point type");
134 return llvm::PowerOf2Ceil(dataLayout.
getTypeSize(fltType).getFixedValue());
143 if (isa<VectorType>(type))
144 return llvm::PowerOf2Ceil(dataLayout.
getTypeSize(type).getKnownMinValue());
146 if (
auto fltType = dyn_cast<FloatType>(type))
150 if (isa<IndexType>(type))
154 if (
auto intType = dyn_cast<IntegerType>(type))
157 if (
auto ctype = dyn_cast<ComplexType>(type))
160 if (
auto typeInterface = dyn_cast<DataLayoutTypeInterface>(type))
161 return typeInterface.getABIAlignment(dataLayout, params);
168 cast<DenseIntElementsAttr>(entry.getValue()).getValues<uint64_t>();
177 return llvm::PowerOf2Ceil(dataLayout.
getTypeSize(intType).getFixedValue());
185 assert(params.size() <= 1 &&
"at most one data layout entry is expected for "
186 "the singleton floating-point type");
196 if (isa<VectorType>(type))
199 if (
auto fltType = dyn_cast<FloatType>(type))
204 if (
auto intType = dyn_cast<IntegerType>(type))
207 if (isa<IndexType>(type)) {
212 if (
auto ctype = dyn_cast<ComplexType>(type))
216 if (
auto typeInterface = dyn_cast<DataLayoutTypeInterface>(type))
217 return typeInterface.getPreferredAlignment(dataLayout, params);
225 if (isa<IndexType>(type))
228 if (
auto typeInterface = dyn_cast<DataLayoutTypeInterface>(type))
229 if (std::optional<uint64_t> indexBitwidth =
230 typeInterface.getIndexBitwidth(dataLayout, params))
231 return *indexBitwidth;
241 if (entry == DataLayoutEntryInterface())
244 return entry.getValue();
254 return entry.getValue();
262 if (entry == DataLayoutEntryInterface()) {
266 return entry.getValue();
272 if (entry == DataLayoutEntryInterface())
275 return entry.getValue();
283 if (entry == DataLayoutEntryInterface()) {
287 return entry.getValue();
295 if (entry == DataLayoutEntryInterface()) {
299 return entry.getValue();
306 if (entry == DataLayoutEntryInterface())
309 auto value = cast<IntegerAttr>(entry.getValue());
310 return value.getValue().getZExtValue();
316 DataLayoutEntryInterface entry) {
317 if (entry == DataLayoutEntryInterface())
319 return entry.getValue();
327 if (entry == DataLayoutEntryInterface())
329 return entry.getValue();
332std::optional<Attribute>
334 if (entry == DataLayoutEntryInterface())
337 return entry.getValue();
343 return llvm::filter_to_vector<4>(
344 entries, [typeID](DataLayoutEntryInterface entry) {
345 auto type = llvm::dyn_cast_if_present<Type>(entry.getKey());
346 return type && type.getTypeID() == typeID;
350DataLayoutEntryInterface
353 const auto *it = llvm::find_if(entries, [
id](DataLayoutEntryInterface entry) {
354 if (
auto attr = dyn_cast<StringAttr>(entry.getKey()))
358 return it == entries.end() ? DataLayoutEntryInterface() : *it;
363 .Case<ModuleOp, DataLayoutOpInterface>(
364 [&](
auto op) {
return op.getDataLayoutSpec(); })
365 .DefaultUnreachable(
"expected an op with data layout spec");
370 ModuleOp moduleOp = dyn_cast<ModuleOp>(operation);
373 return moduleOp.getTargetSystemSpec();
375 return TargetSystemSpecInterface();
390 .Case([&](ModuleOp op) {
396 if (!op->getParentOp() && !op.getDataLayoutSpec())
398 specs.push_back(op.getDataLayoutSpec());
400 opLocations->push_back(op.getLoc());
402 .Case([&](DataLayoutOpInterface op) {
403 specs.push_back(op.getDataLayoutSpec());
405 opLocations->push_back(op.getLoc());
416 assert((isa<ModuleOp, DataLayoutOpInterface>(leaf)) &&
417 "expected an op with data layout spec");
428 auto nonNullSpecs = llvm::filter_to_vector<2>(
429 llvm::reverse(specs),
430 [](DataLayoutSpecInterface iface) {
return iface !=
nullptr; });
433 if (DataLayoutSpecInterface current =
getSpec(leaf))
434 return current.combineWith(nonNullSpecs);
435 if (nonNullSpecs.empty())
437 return nonNullSpecs.back().combineWith(
442 DataLayoutSpecInterface spec =
getSpec(op);
447 if (failed(spec.verifySpec(op->
getLoc())))
452 <<
"data layout does not combine with layouts of enclosing ops";
457 diag.attachNote(loc) <<
"enclosing op with data layout";
464 uint64_t denominator) {
466 llvm::divideCeil(numerator.getKnownMinValue(), denominator);
467 return llvm::TypeSize::get(divided, numerator.isScalable());
474template <
typename OpTy>
476 if (!originalLayout) {
477 assert((!op || !op.getDataLayoutSpec()) &&
478 "could not compute layout information for an op (failed to "
479 "combine attributes?)");
488 allocaMemorySpace(std::nullopt), programMemorySpace(std::nullopt),
489 globalMemorySpace(std::nullopt), stackAlignment(std::nullopt) {
490#if LLVM_ENABLE_ABI_BREAKING_CHECKS
499 allocaMemorySpace(std::nullopt), programMemorySpace(std::nullopt),
500 globalMemorySpace(std::nullopt), stackAlignment(std::nullopt) {
501#if LLVM_ENABLE_ABI_BREAKING_CHECKS
511 if (
auto module = dyn_cast<ModuleOp>(op))
513 if (
auto iface = dyn_cast<DataLayoutOpInterface>(op))
520void mlir::DataLayout::checkValid()
const {
521#if LLVM_ENABLE_ABI_BREAKING_CHECKS
524 assert(specs.size() == layoutStack.size() &&
525 "data layout object used, but no longer valid due to the change in "
526 "number of nested layouts");
527 for (
auto pair : llvm::zip(specs, layoutStack)) {
529 Attribute origLayout = std::get<1>(pair);
530 assert(newLayout == origLayout &&
531 "data layout object used, but no longer valid "
532 "due to the change in layout attributes");
535 assert(((!scope && !this->originalLayout) ||
537 "data layout object used, but no longer valid due to the change in "
547 auto it = cache.find(t);
548 if (it != cache.end())
551 auto result = cache.try_emplace(t, compute(t));
552 return result.first->second;
560 list = originalLayout.getSpecForType(ty.
getTypeID());
561 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
562 return iface.getTypeSize(ty, *
this, list);
572 list = originalLayout.getSpecForType(ty.
getTypeID());
573 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
574 return iface.getTypeSizeInBits(ty, *
this, list);
584 list = originalLayout.getSpecForType(ty.
getTypeID());
585 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
586 return iface.getTypeABIAlignment(ty, *
this, list);
596 list = originalLayout.getSpecForType(ty.
getTypeID());
597 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
598 return iface.getTypePreferredAlignment(ty, *
this, list);
608 list = originalLayout.getSpecForType(ty.getTypeID());
609 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
610 return iface.getIndexBitwidth(ty, *
this, list);
619 DataLayoutEntryInterface entry;
621 entry = originalLayout.getSpecForIdentifier(
622 originalLayout.getEndiannessIdentifier(originalLayout.getContext()));
624 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
625 endianness = iface.getEndianness(entry);
633 if (defaultMemorySpace)
634 return *defaultMemorySpace;
635 DataLayoutEntryInterface entry;
637 entry = originalLayout.getSpecForIdentifier(
638 originalLayout.getDefaultMemorySpaceIdentifier(
639 originalLayout.getContext()));
640 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
641 defaultMemorySpace = iface.getDefaultMemorySpace(entry);
644 return *defaultMemorySpace;
649 if (allocaMemorySpace)
650 return *allocaMemorySpace;
651 DataLayoutEntryInterface entry;
653 entry = originalLayout.getSpecForIdentifier(
654 originalLayout.getAllocaMemorySpaceIdentifier(
655 originalLayout.getContext()));
656 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
657 allocaMemorySpace = iface.getAllocaMemorySpace(entry);
660 return *allocaMemorySpace;
666 return *manglingMode;
667 DataLayoutEntryInterface entry;
669 entry = originalLayout.getSpecForIdentifier(
670 originalLayout.getManglingModeIdentifier(originalLayout.getContext()));
672 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
673 manglingMode = iface.getManglingMode(entry);
676 return *manglingMode;
681 if (programMemorySpace)
682 return *programMemorySpace;
683 DataLayoutEntryInterface entry;
685 entry = originalLayout.getSpecForIdentifier(
686 originalLayout.getProgramMemorySpaceIdentifier(
687 originalLayout.getContext()));
688 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
689 programMemorySpace = iface.getProgramMemorySpace(entry);
692 return *programMemorySpace;
697 if (globalMemorySpace)
698 return *globalMemorySpace;
699 DataLayoutEntryInterface entry;
701 entry = originalLayout.getSpecForIdentifier(
702 originalLayout.getGlobalMemorySpaceIdentifier(
703 originalLayout.getContext()));
704 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
705 globalMemorySpace = iface.getGlobalMemorySpace(entry);
708 return *globalMemorySpace;
714 return *stackAlignment;
715 DataLayoutEntryInterface entry;
717 entry = originalLayout.getSpecForIdentifier(
718 originalLayout.getStackAlignmentIdentifier(
719 originalLayout.getContext()));
720 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
721 stackAlignment = iface.getStackAlignment(entry);
724 return *stackAlignment;
729 if (functionPointerAlignment)
730 return *functionPointerAlignment;
731 DataLayoutEntryInterface entry;
733 entry = originalLayout.getSpecForIdentifier(
734 originalLayout.getFunctionPointerAlignmentIdentifier(
735 originalLayout.getContext()));
736 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
737 functionPointerAlignment = iface.getFunctionPointerAlignment(entry);
739 functionPointerAlignment =
741 return *functionPointerAlignment;
747 return *legalIntWidths;
748 DataLayoutEntryInterface entry;
750 entry = originalLayout.getSpecForIdentifier(
751 originalLayout.getLegalIntWidthsIdentifier(
752 originalLayout.getContext()));
753 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
754 legalIntWidths = iface.getLegalIntWidths(entry);
757 return *legalIntWidths;
761 TargetSystemSpecInterface::DeviceID deviceID,
762 StringAttr propertyName)
const {
764 DataLayoutEntryInterface entry;
765 if (originalTargetSystemDesc) {
766 if (std::optional<TargetDeviceSpecInterface> device =
767 originalTargetSystemDesc.getDeviceSpecForDeviceID(deviceID))
768 entry = device->getSpecForIdentifier(propertyName);
774 if (
auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
775 return iface.getDevicePropertyValue(entry);
784void DataLayoutSpecInterface::bucketEntriesByType(
785 llvm::MapVector<TypeID, DataLayoutEntryList> &types,
786 llvm::MapVector<StringAttr, DataLayoutEntryInterface> &ids) {
787 for (DataLayoutEntryInterface entry : getEntries()) {
788 if (
auto type = llvm::dyn_cast_if_present<Type>(entry.getKey()))
789 types[type.getTypeID()].push_back(entry);
791 ids[llvm::cast<StringAttr>(entry.getKey())] = entry;
798 for (DataLayoutEntryInterface entry : spec.getEntries())
799 if (failed(entry.verifyEntry(loc)))
804 llvm::MapVector<TypeID, DataLayoutEntryList> types;
805 llvm::MapVector<StringAttr, DataLayoutEntryInterface> ids;
806 spec.bucketEntriesByType(types, ids);
808 for (
const auto &kvp : types) {
809 auto sampleType = cast<Type>(kvp.second.front().getKey());
810 if (isa<IndexType>(sampleType)) {
811 assert(kvp.second.size() == 1 &&
812 "expected one data layout entry for non-parametric 'index' type");
813 if (!isa<IntegerAttr>(kvp.second.front().getValue()))
815 <<
"expected integer attribute in the data layout entry for "
820 if (sampleType.isIntOrFloat()) {
821 for (DataLayoutEntryInterface entry : kvp.second) {
822 auto value = dyn_cast<DenseIntElementsAttr>(entry.getValue());
823 if (!value || !value.getElementType().isSignlessInteger(64)) {
824 emitError(loc) <<
"expected a dense i64 elements attribute in the "
830 auto elements = llvm::to_vector<2>(value.getValues<uint64_t>());
831 unsigned numElements = elements.size();
832 if (numElements < 1 || numElements > 2) {
833 emitError(loc) <<
"expected 1 or 2 elements in the data layout entry "
838 uint64_t abi = elements[0];
839 uint64_t preferred = numElements == 2 ? elements[1] : abi;
840 if (preferred < abi) {
842 <<
"preferred alignment is expected to be greater than or equal "
843 "to the abi alignment in data layout entry "
851 if (isa<BuiltinDialect>(&sampleType.getDialect()))
852 return emitError(loc) <<
"unexpected data layout for a built-in type";
854 auto dlType = dyn_cast<DataLayoutTypeInterface>(sampleType);
857 <<
"data layout specified for a type that does not support it";
858 if (failed(dlType.verifyEntries(kvp.second, loc)))
862 for (
const auto &kvp : ids) {
863 StringAttr identifier = cast<StringAttr>(kvp.second.getKey());
864 Dialect *dialect = identifier.getReferencedDialect();
871 const auto *iface = dyn_cast<DataLayoutDialectInterface>(dialect);
875 <<
"' dialect does not support identifier data layout entries";
877 if (failed(iface->verifyEntry(kvp.second, loc)))
889 for (
const auto &entry : spec.getEntries()) {
890 auto targetDeviceSpec =
891 dyn_cast<TargetDeviceSpecInterface>(entry.getValue());
893 if (!targetDeviceSpec)
897 if (failed(targetDeviceSpec.verifyEntry(loc)))
902 llvm::dyn_cast<TargetSystemSpecInterface::DeviceID>(entry.getKey());
906 if (!deviceIDs.insert(deviceID).second) {
911 for (DataLayoutEntryInterface entry : targetDeviceSpec.getEntries()) {
912 if (
auto type = llvm::dyn_cast_if_present<Type>(entry.getKey())) {
916 deviceDescKeys[cast<StringAttr>(entry.getKey())] = entry;
921 for (
const auto &[keyName, keyVal] : deviceDescKeys) {
922 Dialect *dialect = keyName.getReferencedDialect();
929 const auto *iface = dyn_cast<DataLayoutDialectInterface>(dialect);
933 <<
"' dialect does not support identifier data layout entries";
935 if (failed(iface->verifyEntry(keyVal, loc)))
942#include "mlir/Interfaces/DataLayoutAttrInterface.cpp.inc"
943#include "mlir/Interfaces/DataLayoutOpInterface.cpp.inc"
944#include "mlir/Interfaces/DataLayoutTypeInterface.cpp.inc"
static uint64_t getIntegerTypePreferredAlignment(IntegerType intType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
static DataLayoutSpecInterface getCombinedDataLayout(Operation *leaf)
Returns a layout spec that is a combination of the layout specs attached to the given operation and a...
static TargetSystemSpecInterface getTargetSystemSpec(Operation *operation)
constexpr static const uint64_t kDefaultBitsInByte
static uint64_t getIntegerTypeABIAlignment(IntegerType intType, ArrayRef< DataLayoutEntryInterface > params)
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.
static uint64_t extractPreferredAlignment(DataLayoutEntryInterface entry)
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 implemen...
static uint64_t getFloatTypePreferredAlignment(FloatType fltType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
static uint64_t getFloatTypeABIAlignment(FloatType fltType, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
static DataLayoutSpecInterface getSpec(Operation *operation)
static uint64_t getIndexBitwidth(DataLayoutEntryListRef params)
Returns the bitwidth of the index type if specified in the param list.
static uint64_t extractABIAlignment(DataLayoutEntryInterface entry)
static DataLayoutEntryInterface findEntryForIntegerType(IntegerType intType, ArrayRef< DataLayoutEntryInterface > params)
void checkMissingLayout(DataLayoutSpecInterface originalLayout, OpTy op)
static void reportMissingDataLayout(Type type)
Reports that the given type is missing the data layout information and exits.
static std::string diag(const llvm::Value &value)
Attributes are known-constant values of operations.
The main mechanism for performing data layout queries.
Attribute getAllocaMemorySpace() const
Returns the memory space used for AllocaOps.
static DataLayout closest(Operation *op)
Returns the layout of the closest parent operation carrying layout info.
std::optional< uint64_t > getTypeIndexBitwidth(Type t) const
Returns the bitwidth that should be used when performing index computations for the given pointer-lik...
llvm::TypeSize getTypeSize(Type t) const
Returns the size of the given type in the current scope.
Attribute getManglingMode() const
Returns the mangling mode.
uint64_t getStackAlignment() const
Returns the natural alignment of the stack in bits.
Attribute getProgramMemorySpace() const
Returns the memory space used for program memory operations.
uint64_t getTypePreferredAlignment(Type t) const
Returns the preferred of the given type in the current scope.
Attribute getFunctionPointerAlignment() const
Returns function pointer alignment.
Attribute getGlobalMemorySpace() const
Returns the memory space used for global operations.
uint64_t getTypeABIAlignment(Type t) const
Returns the required alignment of the given type in the current scope.
llvm::TypeSize getTypeSizeInBits(Type t) const
Returns the size in bits of the given type in the current scope.
Attribute getDefaultMemorySpace() const
Returns the default memory space used for memory operations.
Attribute getEndianness() const
Returns the specified endianness.
Attribute getLegalIntWidths() const
Returns the legal int widths.
std::optional< Attribute > getDevicePropertyValue(TargetSystemSpecInterface::DeviceID, StringAttr propertyName) const
Returns the value of the specified property if the property is defined for the given device ID,...
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
StringRef getNamespace() const
This class represents a diagnostic that is inflight and set to be reported.
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Operation is the basic unit of execution within MLIR.
Location getLoc()
The source location the operation was defined or derived from.
Operation * getParentOp()
Returns the closest surrounding operation that contains this operation or nullptr if this is a top-le...
InFlightDiagnostic emitError(const Twine &message={})
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers tha...
OpTy getParentOfType()
Return the closest surrounding parent operation that is of type 'OpTy'.
This class provides an efficient unique identifier for a specific C++ type.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
MLIRContext * getContext() const
Return the MLIRContext in which this type was uniqued.
bool isIntOrFloat() const
Return true if this is an integer (of any signedness) or a float type.
TypeID getTypeID()
Return a unique identifier for the concrete type.
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
Attribute getDefaultAllocaMemorySpace(DataLayoutEntryInterface entry)
Default handler for alloca memory space request.
Attribute getDefaultProgramMemorySpace(DataLayoutEntryInterface entry)
Default handler for program memory space request.
Attribute getDefaultEndianness(DataLayoutEntryInterface entry)
Default handler for endianness request.
std::optional< uint64_t > getDefaultIndexBitwidth(Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
Default handler for the index bitwidth request.
DataLayoutEntryList filterEntriesForType(DataLayoutEntryListRef entries, TypeID typeID)
Given a list of data layout entries, returns a new list containing the entries with keys having the g...
LogicalResult verifyTargetSystemSpec(TargetSystemSpecInterface spec, Location loc)
Verifies that a target system desc spec is valid.
std::optional< Attribute > getDevicePropertyValue(DataLayoutEntryInterface entry)
Returns the value of the property from the specified DataLayoutEntry.
Attribute getDefaultManglingMode(DataLayoutEntryInterface entry)
Default handler for mangling mode request.
uint64_t getDefaultABIAlignment(Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
Default handler for the required alignment request.
Attribute getDefaultLegalIntWidths(DataLayoutEntryInterface entry)
Default handler for the legal int widths request.
llvm::TypeSize getDefaultTypeSize(Type type, const DataLayout &dataLayout, DataLayoutEntryListRef params)
Default handler for the type size request.
llvm::TypeSize getDefaultTypeSizeInBits(Type type, const DataLayout &dataLayout, DataLayoutEntryListRef params)
Default handler for the type size in bits request.
uint64_t getDefaultPreferredAlignment(Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
Default handler for the preferred alignment request.
llvm::TypeSize divideCeil(llvm::TypeSize numerator, uint64_t denominator)
Divides the known min value of the numerator by the denominator and rounds the result up to the next ...
uint64_t getDefaultStackAlignment(DataLayoutEntryInterface entry)
Default handler for the stack alignment request.
Attribute getDefaultGlobalMemorySpace(DataLayoutEntryInterface entry)
Default handler for global memory space request.
Attribute getDefaultMemorySpace(DataLayoutEntryInterface entry)
Default handler for the default memory space request.
LogicalResult verifyDataLayoutOp(Operation *op)
Verifies that the operation implementing the data layout interface, or a module operation,...
LogicalResult verifyDataLayoutSpec(DataLayoutSpecInterface spec, Location loc)
Verifies that a data layout spec is valid.
Attribute getDefaultFunctionPointerAlignment(DataLayoutEntryInterface entry)
Default handler for the function pointer alignment request.
DataLayoutEntryInterface filterEntryForIdentifier(DataLayoutEntryListRef entries, StringAttr id)
Given a list of data layout entries, returns the entry that has the given identifier as key,...
Include the generated interface declarations.
llvm::SmallVector< DataLayoutEntryInterface, 4 > DataLayoutEntryList
llvm::DenseSet< ValueT, ValueInfoT > DenseSet
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT > DenseMap
llvm::ArrayRef< DataLayoutEntryInterface > DataLayoutEntryListRef
llvm::function_ref< Fn > function_ref