MLIR  16.0.0git
Classes | Namespaces | Functions
DLTI.cpp File Reference
#include "mlir/Dialect/DLTI/DLTI.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectImplementation.h"
#include "llvm/ADT/TypeSwitch.h"
#include "mlir/Dialect/DLTI/DLTIDialect.cpp.inc"
+ Include dependency graph for DLTI.cpp:

Go to the source code of this file.

Classes

class  mlir::impl::DataLayoutEntryStorage
 
class  mlir::impl::DataLayoutSpecStorage
 

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::impl
 Attribute collections provide a dictionary-like interface.
 

Functions

static void overwriteDuplicateEntries (SmallVectorImpl< DataLayoutEntryInterface > &oldEntries, ArrayRef< DataLayoutEntryInterface > newEntries)
 Given a list of old and a list of new entries, overwrites old entries with new ones if they have matching keys, appends new entries to the old entry list otherwise. More...
 
static LogicalResult combineOneSpec (DataLayoutSpecInterface spec, DenseMap< TypeID, DataLayoutEntryList > &entriesForType, DenseMap< StringAttr, DataLayoutEntryInterface > &entriesForID)
 Combines a data layout spec into the given lists of entries organized by type class and identifier, overwriting them if necessary. More...
 

Function Documentation

◆ combineOneSpec()

static LogicalResult combineOneSpec ( DataLayoutSpecInterface  spec,
DenseMap< TypeID, DataLayoutEntryList > &  entriesForType,
DenseMap< StringAttr, DataLayoutEntryInterface > &  entriesForID 
)
static

Combines a data layout spec into the given lists of entries organized by type class and identifier, overwriting them if necessary.

Fails to combine if the two entries with identical keys are not compatible.

Definition at line 192 of file DLTI.cpp.

References mlir::spirv::combine(), mlir::DataLayoutDialectInterface::defaultCombine(), mlir::failure(), mlir::Type::getContext(), mlir::Type::getDialect(), mlir::MLIRContext::getLoadedDialect(), overwriteDuplicateEntries(), and mlir::success().

Referenced by mlir::DataLayoutSpecAttr::combineWith().

◆ overwriteDuplicateEntries()

static void overwriteDuplicateEntries ( SmallVectorImpl< DataLayoutEntryInterface > &  oldEntries,
ArrayRef< DataLayoutEntryInterface >  newEntries 
)
static

Given a list of old and a list of new entries, overwrites old entries with new ones if they have matching keys, appends new entries to the old entry list otherwise.

Definition at line 167 of file DLTI.cpp.

Referenced by combineOneSpec().