MLIR  16.0.0git
Namespaces | Classes | Typedefs | Functions | Variables
mlir::detail Namespace Reference

Namespaces

 analysis_impl
 
 pass_options
 
 pdl_function_builder
 
 storage_user_base_impl
 
 StorageUserTrait
 

Classes

struct  AffineBinaryOpExprStorage
 A binary operation appearing in an affine expression. More...
 
struct  AffineConstantExprStorage
 An integer constant appearing in affine expression. More...
 
struct  AffineDimExprStorage
 A dimensional or symbolic identifier appearing in an affine expression. More...
 
struct  AffineExprStorage
 Base storage class appearing in an affine expression. More...
 
struct  AffineMapAccessInterfaceInterfaceTraits
 
struct  AffineMapAccessInterfaceTrait
 
struct  AffineMapStorage
 
struct  AffineReadOpInterfaceInterfaceTraits
 
struct  AffineReadOpInterfaceTrait
 
struct  AffineWriteOpInterfaceInterfaceTraits
 
struct  AffineWriteOpInterfaceTrait
 
struct  AliasAnalysisTraits
 This class contains various internal trait classes used by the main AliasAnalysis class below. More...
 
struct  AnalysisConcept
 The abstract polymorphic base class representing an analysis. More...
 
class  AnalysisMap
 This class represents a cache of analyses for a single operation. More...
 
struct  AnalysisModel
 A derived analysis model used to hold a specific analysis object. More...
 
struct  AnyCapturedValueMatcher
 Terminal matcher, always returns true. More...
 
struct  AnyValueMatcher
 Terminal matcher, always returns true. More...
 
class  AsmParserImpl
 This class provides the implementation of the generic parser methods within AsmParser. More...
 
class  AsmStateImpl
 
struct  attr_value_binder
 The matcher that matches a certain kind of Attribute and binds the value inside the Attribute. More...
 
class  AttributeUniquer
 
class  BlockArgumentImpl
 The internal implementation of a BlockArgument. More...
 
class  CallbackOstream
 A simple raw ostream subclass that forwards write_impl calls to the user-supplied callback together with opaque user-supplied data. More...
 
struct  constant_float_op_binder
 The matcher that matches a constant scalar / vector splat / tensor splat float operation and binds the constant float value. More...
 
struct  constant_float_predicate_matcher
 The matcher that matches a given target constant scalar / vector splat / tensor splat float value that fulfills a predicate. More...
 
struct  constant_int_op_binder
 The matcher that matches a constant scalar / vector splat / tensor splat integer operation and binds the constant integer value. More...
 
struct  constant_int_predicate_matcher
 The matcher that matches a given target constant scalar / vector splat / tensor splat integer value that fulfills a predicate. More...
 
struct  constant_op_binder
 The matcher that matches operations that have the ConstantLike trait, and binds the folded attribute value. More...
 
struct  constant_op_matcher
 The matcher that matches operations that have the ConstantLike trait. More...
 
struct  ConversionPatternRewriterImpl
 
struct  count_if_t_impl
 Template utility that computes the number of elements within T that satisfy the given predicate. More...
 
struct  count_if_t_impl< Pred, N, T, Us... >
 
class  DefaultTimingManagerImpl
 Implementation details of the DefaultTimingManager. More...
 
class  DenseArrayAttrImpl
 Base class for DenseArrayAttr that is instantiated and specialized for each supported element type below. More...
 
class  DenseElementIndexedIteratorImpl
 Impl iterator for indexed DenseElementsAttr iterators that records a data pointer and data index that is adjusted for the case of a splat attribute. More...
 
struct  DenseElementsAttributeStorage
 An attribute representing a reference to a dense vector or tensor object. More...
 
struct  DenseIntOrFPElementsAttrStorage
 An attribute representing a reference to a dense vector or tensor object. More...
 
class  DenseResourceElementsAttrBase
 Base class for DenseResourceElementsAttr that is instantiated and specialized for each supported element type below. More...
 
struct  DenseStringElementsAttrStorage
 An attribute representing a reference to a dense vector or tensor object containing strings. More...
 
struct  DiagnosticEngineImpl
 
class  DialectInterfaceBase
 The base class used for all derived interface types. More...
 
class  DialectInterfaceCollectionBase
 This class is the base class for a collection of instances for a specific interface kind. More...
 
class  DominanceInfoBase
 
struct  DynamicAttrStorage
 Storage of DynamicAttr. More...
 
struct  DynamicTypeStorage
 Storage of DynamicType. More...
 
struct  ElementsAttrIndexer
 This class provides support for indexing into the element range of an ElementsAttr. More...
 
class  ElementsAttrIterator
 This class implements a generic iterator for ElementsAttr. More...
 
class  ElementsAttrRange
 This class provides iterator utilities for an ElementsAttr range. More...
 
struct  ExpectedDiag
 This class represents an expected output diagnostic. More...
 
class  FallbackTypeIDResolver
 This class provides a fallback for resolving TypeIDs. More...
 
struct  FunctionTypeStorage
 Function Type Storage and Uniquing. More...
 
struct  InlineOpResult
 This class provides the implementation for an operation result whose index can be represented "inline" in the underlying ValueImpl. More...
 
struct  InlineTypeIDResolver
 This class provides utilities for resolving the TypeID of a class that provides a static TypeID resolveTypeID() method. More...
 
struct  IntegerSetStorage
 
struct  IntegerTypeStorage
 Integer Type Storage and Uniquing. More...
 
class  Interface
 This class represents an abstract interface. More...
 
class  InterfaceMap
 This class provides an efficient mapping between a given Interface type, and a particular implementation of its concept. More...
 
class  IROperandBase
 This class is the base for IROperand, and provides all of the non-templated facilities for operand use management. More...
 
struct  is_complex_t
 Type trait detector that checks if a given type T is a complex type. More...
 
struct  is_complex_t< std::complex< T > >
 
struct  NestedAnalysisMap
 An analysis map that contains a map for the current operation, and a set of maps for any child operations. More...
 
class  op_filter_iterator
 A utility iterator that filters out operations that are not 'OpT'. More...
 
class  op_iterator
 This class provides iteration over the held operations of a block for a specific operation type. More...
 
struct  op_matcher
 The matcher that matches a certain kind of op. More...
 
class  OperandStorage
 This class handles the management of operation operands. More...
 
struct  OpOrInterfaceRewritePatternBase
 OpOrInterfaceRewritePatternBase is a wrapper around RewritePattern that allows for matching and rewriting against an instance of a derived operation class or Interface. More...
 
struct  OpPassManagerImpl
 
class  OpResultImpl
 This class provides the implementation for an operation result. More...
 
class  OpToOpPassAdaptor
 An adaptor pass used to run operation passes over nested operations. More...
 
class  OutOfLineOpResult
 This class provides the implementation for an operation result whose index cannot be represented "inline", and thus requires an additional index field. More...
 
struct  ParallelDiagnosticHandlerImpl
 
class  Parser
 This class implement support for parsing global entities like attributes and types. More...
 
struct  ParserState
 This class refers to all of the state maintained globally by the parser, such as the current lexer position etc. More...
 
class  PassCrashReproducerGenerator
 
struct  PassExecutionState
 The state for a single execution of a pass. More...
 
struct  PassInstrumentorImpl
 
class  PassOptions
 Base container class and manager for all pass options. More...
 
struct  PassPipelineCLParserImpl
 
struct  PatternMatcherValue
 Binds to a specific value and matches it. More...
 
class  PDLByteCode
 The bytecode class is also the interpreter. More...
 
class  PDLByteCodeMutableState
 This class contains the mutable state of a bytecode instance. More...
 
class  PDLByteCodePattern
 All of the data pertaining to a specific pattern within the bytecode. More...
 
class  PreservedAnalyses
 A utility class to represent the analyses that are known to be preserved. More...
 
struct  RecoveryReproducerContext
 This class contains all of the context for generating a recovery reproducer. More...
 
struct  RecursivePatternMatcher
 RecursivePatternMatcher that composes. More...
 
struct  SourceMgrDiagnosticHandlerImpl
 
struct  SourceMgrDiagnosticVerifierHandlerImpl
 
struct  StorageUniquerImpl
 This is the implementation of the StorageUniquer class. More...
 
class  StorageUserBase
 Utility class for implementing users of storage classes uniqued by a StorageUniquer. More...
 
class  StorageUserTraitBase
 Helper class for implementing traits for storage classes. More...
 
struct  StringAttrStorage
 
struct  SymbolState
 This class contains record of any parsed top-level symbols. More...
 
class  TimingManagerImpl
 Private implementation details of the TimingManager. More...
 
struct  TupleTypeStorage
 A type representing a collection of other types. More...
 
struct  TypedValue
 TypedValue is a Value with a statically know type. More...
 
class  TypeIDResolver
 This class provides a resolver for getting the ID for a given class T. More...
 
class  TypeIDResolver< T, std::enable_if_t< InlineTypeIDResolver::has_resolve_typeid< T >::value > >
 This class provides a resolver for getting the ID for a given class T, when the class provides a static TypeID resolveTypeID() method. More...
 
struct  TypeUniquer
 A utility class to get, or create, unique instances of types within an MLIRContext. More...
 
class  ValueImpl
 The base class for all derived Value classes. More...
 
struct  Vector1D
 
struct  Vector1D< T, Dim, false >
 
struct  Vector1D< T, Dim, true >
 

Typedefs

using DenseIterPtrAndSplat = std::pair< const char *, bool >
 Pair of raw pointer and a boolean flag of whether the pointer holds a splat,. More...
 
template<typename T , typename OperationOrValue >
using has_operation_or_value_matcher_t = decltype(std::declval< T >().match(std::declval< OperationOrValue >()))
 Trait to check whether T provides a 'match' method with type OperationOrValue. More...
 
template<typename T >
using first_argument = decltype(first_argument_type(std::declval< T >()))
 Type definition of the first argument to the given callable 'T'. More...
 
template<typename FnT >
using walkResultType = decltype(walk(nullptr, std::declval< FnT >()))
 Utility to provide the return type of a templated walk method. More...
 
template<template< class > class Pred, typename... Ts>
using count_if_t = count_if_t_impl< Pred, 0, Ts... >
 
template<typename T >
using is_interface_t = decltype(isInterfaceImpl(std::declval< T & >()))
 
template<typename T >
using IsInterface = llvm::is_detected< is_interface_t, T >
 
template<typename ImplTy , typename... Args>
using has_impltype_getkey_t = decltype(ImplTy::getKey(std::declval< Args >()...))
 Trait to check if ImplTy provides a 'getKey' method with types 'Args'. More...
 
template<typename ImplTy , typename T >
using has_impltype_hash_t = decltype(ImplTy::hashKey(std::declval< T >()))
 Trait to check if ImplTy provides a 'hashKey' method for 'T'. More...
 
using ByteCodeField = uint16_t
 Use generic bytecode types. More...
 
using ByteCodeAddr = uint32_t
 
using OwningOpRange = llvm::OwningArrayRef< Operation * >
 

Functions

constexpr bool isPowerOf2 (int n)
 
constexpr unsigned nextPowerOf2 (int n)
 
template<size_t N>
std::array< int64_t, N > makeStrides (ArrayRef< int64_t > shape)
 Given a shape with sizes greater than 0 along all dimensions, returns the distance, in number of elements, between a slice in a dimension and the next slice in the same dimension. More...
 
template<int N, typename T >
std::enable_if<(N >=1), StridedMemRefType< T, N > >::type makeStridedMemRefDescriptor (T *ptr, T *alignedPtr, ArrayRef< int64_t > shape, ArrayRef< int64_t > shapeAlloc)
 Build a StridedMemRefDescriptor<T, N> that matches the MLIR ABI. More...
 
template<int N, typename T >
std::enable_if<(N==0), StridedMemRefType< T, 0 > >::type makeStridedMemRefDescriptor (T *ptr, T *alignedPtr, ArrayRef< int64_t > shape={}, ArrayRef< int64_t > shapeAlloc={})
 Build a StridedMemRefDescriptor<T, 0> that matches the MLIR ABI. More...
 
template<typename T >
std::pair< T *, T * > allocAligned (size_t nElements, AllocFunType allocFun=&::malloc, llvm::Optional< uint64_t > alignment=llvm::Optional< uint64_t >())
 Align nElements of type T with an optional alignment. More...
 
Optional< BlockArgumentgetBranchSuccessorArgument (const SuccessorOperands &operands, unsigned operandIndex, Block *successor)
 Return the BlockArgument corresponding to operand operandIndex in some successor if operandIndex is within the range of operands, or None if operandIndex isn't a successor operand index. More...
 
LogicalResult verifyBranchSuccessorOperands (Operation *op, unsigned succNo, const SuccessorOperands &operands)
 Verify that the given operands match those of the given successor block. More...
 
LogicalResult verifyTypesAlongControlFlowEdges (Operation *op)
 Verify that types match along control flow edges described the given op. More...
 
unsigned getDefaultTypeSize (Type type, const DataLayout &dataLayout, DataLayoutEntryListRef params)
 Default handler for the type size request. More...
 
unsigned getDefaultTypeSizeInBits (Type type, const DataLayout &dataLayout, DataLayoutEntryListRef params)
 Default handler for the type size in bits request. More...
 
unsigned getDefaultABIAlignment (Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
 Default handler for the required alignemnt request. More...
 
unsigned getDefaultPreferredAlignment (Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
 Default handler for the preferred alignemnt request. More...
 
DataLayoutEntryList filterEntriesForType (DataLayoutEntryListRef entries, TypeID typeID)
 Given a list of data layout entries, returns a new list containing the entries with keys having the given type ID, i.e. More...
 
DataLayoutEntryInterface filterEntryForIdentifier (DataLayoutEntryListRef entries, StringAttr id)
 Given a list of data layout entries, returns the entry that has the given identifier as key, if such an entry exists in the list. More...
 
LogicalResult verifyDataLayoutOp (Operation *op)
 Verifies that the operation implementing the data layout interface, or a module operation, is valid. More...
 
LogicalResult verifyDataLayoutSpec (DataLayoutSpecInterface spec, Location loc)
 Verifies that a data layout spec is valid. More...
 
LogicalResult inferReturnTensorTypes (function_ref< LogicalResult(MLIRContext *, Optional< Location > location, ValueShapeRange operands, DictionaryAttr attributes, RegionRange regions, SmallVectorImpl< ShapedTypeComponents > &retComponents)> componentTypeFn, MLIRContext *context, Optional< Location > location, ValueRange operands, DictionaryAttr attributes, RegionRange regions, SmallVectorImpl< Type > &inferredReturnTypes)
 
LogicalResult verifyInferredResultTypes (Operation *op)
 Verifies that the inferred result types match the actual result types for the op. More...
 
LogicalResult verifyParallelCombiningOpInterface (Operation *op)
 
LogicalResult verifyShapedDimOpInterface (Operation *op)
 Verify invariants of ops that implement the ShapedDimOpInterface. More...
 
LogicalResult verifyOffsetSizeAndStrideOp (OffsetSizeAndStrideOpInterface op)
 
bool sameOffsetsSizesAndStrides (OffsetSizeAndStrideOpInterface a, OffsetSizeAndStrideOpInterface b, llvm::function_ref< bool(OpFoldResult, OpFoldResult)> cmp)
 
template<int N>
void bindDims (MLIRContext *ctx)
 
template<int N, typename AffineExprTy , typename... AffineExprTy2>
void bindDims (MLIRContext *ctx, AffineExprTy &e, AffineExprTy2 &...exprs)
 
template<int N>
void bindSymbols (MLIRContext *ctx)
 
template<int N, typename AffineExprTy , typename... AffineExprTy2>
void bindSymbols (MLIRContext *ctx, AffineExprTy &e, AffineExprTy2 &...exprs)
 
template<typename AffineExprTy >
void bindSymbolsList (MLIRContext *ctx, SmallVectorImpl< AffineExprTy > &exprs)
 
LogicalResult verifyAffineMapAsLayout (AffineMap m, ArrayRef< int64_t > shape, function_ref< InFlightDiagnostic()> emitError)
 
static bool isConstantLike (Operation *op)
 Check to see if the specified operation is ConstantLike. More...
 
template<typename MatcherClass >
std::enable_if_t< llvm::is_detected< detail::has_operation_or_value_matcher_t, MatcherClass, Value >::value, bool > matchOperandOrValueAtIndex (Operation *op, unsigned idx, MatcherClass &matcher)
 Statically switch to a Value matcher. More...
 
template<typename MatcherClass >
std::enable_if_t< llvm::is_detected< detail::has_operation_or_value_matcher_t, MatcherClass, Operation * >::value, bool > matchOperandOrValueAtIndex (Operation *op, unsigned idx, MatcherClass &matcher)
 Statically switch to an Operation matcher. More...
 
template<typename TupleT , class CallbackT , std::size_t... Is>
constexpr void enumerateImpl (TupleT &&tuple, CallbackT &&callback, std::index_sequence< Is... >)
 
template<typename... Tys, typename CallbackT >
constexpr void enumerate (std::tuple< Tys... > &tuple, CallbackT &&callback)
 
llvm::unique_function< InFlightDiagnostic()> getDefaultDiagnosticEmitFn (MLIRContext *ctx)
 Utility method to generate a callback that can be used to generate a diagnostic when checking the construction invariants of a storage object. More...
 
llvm::unique_function< InFlightDiagnostic()> getDefaultDiagnosticEmitFn (const Location &loc)
 
LogicalResult verifySymbolTable (Operation *op)
 
LogicalResult verifySymbol (Operation *op)
 
template<typename Ret , typename Arg , typename... Rest>
Arg first_argument_type (Ret(*)(Arg, Rest...))
 Helper templates to deduce the first argument of a callback parameter. More...
 
template<typename Ret , typename F , typename Arg , typename... Rest>
Arg first_argument_type (Ret(F::*)(Arg, Rest...))
 
void walk (Operation *op, function_ref< void(Region *)> callback, WalkOrder order)
 Walk all of the regions, blocks, or operations nested under (and including) the given operation. More...
 
void walk (Operation *op, function_ref< void(Block *)> callback, WalkOrder order)
 
void walk (Operation *op, function_ref< void(Operation *)> callback, WalkOrder order)
 
WalkResult walk (Operation *op, function_ref< WalkResult(Region *)> callback, WalkOrder order)
 Walk all of the regions, blocks, or operations nested under (and including) the given operation. More...
 
WalkResult walk (Operation *op, function_ref< WalkResult(Block *)> callback, WalkOrder order)
 
WalkResult walk (Operation *op, function_ref< WalkResult(Operation *)> callback, WalkOrder order)
 
template<WalkOrder Order = WalkOrder::PostOrder, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< llvm::is_one_of< ArgT, Operation *, Region *, Block * >::value, RetT > walk (Operation *op, FuncTy &&callback)
 Walk all of the regions, blocks, or operations nested under (and including) the given operation. More...
 
template<WalkOrder Order = WalkOrder::PostOrder, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< !llvm::is_one_of< ArgT, Operation *, Region *, Block * >::value &&std::is_same< RetT, void >::value, RetT > walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
template<WalkOrder Order = WalkOrder::PostOrder, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< !llvm::is_one_of< ArgT, Operation *, Region *, Block * >::value &&std::is_same< RetT, WalkResult >::value, RetT > walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
void walk (Operation *op, function_ref< void(Operation *, const WalkStage &stage)> callback)
 Generic walkers with stage aware callbacks. More...
 
WalkResult walk (Operation *op, function_ref< WalkResult(Operation *, const WalkStage &stage)> callback)
 Walk all the operations nested under (and including) the given operation, with the callback being invoked on each operation N+1 times, where N is the number of regions attached to the operation. More...
 
template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t< std::is_same< ArgT, Operation * >::value, RetT > walk (Operation *op, FuncTy &&callback)
 Walk all of the operations nested under and including the given operation. More...
 
template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<!std::is_same< ArgT, Operation * >::value &&std::is_same< RetT, void >::value, RetT > walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<!std::is_same< ArgT, Operation * >::value &&std::is_same< RetT, WalkResult >::value, RetT > walk (Operation *op, FuncTy &&callback)
 Walk all of the operations of type 'ArgT' nested under and including the given operation. More...
 
template<typename ContainerOpT >
OwningOpRef< ContainerOpT > constructContainerOpForParserIfNecessary (Block *parsedBlock, MLIRContext *context, Location sourceFileLoc)
 Given a block containing operations that have just been parsed, if the block contains a single operation of ContainerOpT type then remove it from the block and return it. More...
 
template<typename ContainerOpT , typename... ParserArgs>
OwningOpRef< ContainerOpT > parseSourceFile (const ParserConfig &config, ParserArgs &&...args)
 The internal implementation of the templated parseSourceFile methods below, that simply forwards to the non-templated version. More...
 
template<typename ConcreteType , typename ValueT , typename Traits , typename BaseType , template< typename, template< typename > class > class BaseTrait>
void isInterfaceImpl (Interface< ConcreteType, ValueT, Traits, BaseType, BaseTrait > &)
 
size_t getDenseElementBitWidth (Type eltType)
 Return the bit width which DenseElementsAttr should use for this type. More...
 
bool isSupportedMemorySpace (Attribute memorySpace)
 Checks if the memorySpace has supported Attribute type. More...
 
Attribute wrapIntegerMemorySpace (unsigned memorySpace, MLIRContext *ctx)
 Wraps deprecated integer memory space to the new Attribute form. More...
 
Attribute skipDefaultMemorySpace (Attribute memorySpace)
 Replaces default memorySpace (integer == 0) with empty Attribute. More...
 
unsigned getMemorySpaceAsInt (Attribute memorySpace)
 [deprecated] Returns the memory space in old raw integer representation. More...
 

Variables

template<typename F >
decltype(first_argument_type(&F::operator())) first_argument_type (F)
 

Typedef Documentation

◆ ByteCodeAddr

using mlir::detail::ByteCodeAddr = typedef uint32_t

Definition at line 30 of file ByteCode.h.

◆ ByteCodeField

using mlir::detail::ByteCodeField = typedef uint16_t

Use generic bytecode types.

ByteCodeField refers to the actual bytecode entries. ByteCodeAddr refers to size of indices into the bytecode.

Definition at line 29 of file ByteCode.h.

◆ count_if_t

template<template< class > class Pred, typename... Ts>
using mlir::detail::count_if_t = typedef count_if_t_impl<Pred, 0, Ts...>

Definition at line 143 of file InterfaceSupport.h.

◆ DenseIterPtrAndSplat

using mlir::detail::DenseIterPtrAndSplat = typedef std::pair<const char *, bool>

Pair of raw pointer and a boolean flag of whether the pointer holds a splat,.

Definition at line 40 of file BuiltinAttributes.h.

◆ first_argument

template<typename T >
using mlir::detail::first_argument = typedef decltype(first_argument_type(std::declval<T>()))

Type definition of the first argument to the given callable 'T'.

Definition at line 112 of file Visitors.h.

◆ has_impltype_getkey_t

template<typename ImplTy , typename... Args>
using mlir::detail::has_impltype_getkey_t = typedef decltype(ImplTy::getKey(std::declval<Args>()...))

Trait to check if ImplTy provides a 'getKey' method with types 'Args'.

Definition at line 26 of file StorageUniquer.h.

◆ has_impltype_hash_t

template<typename ImplTy , typename T >
using mlir::detail::has_impltype_hash_t = typedef decltype(ImplTy::hashKey(std::declval<T>()))

Trait to check if ImplTy provides a 'hashKey' method for 'T'.

Definition at line 30 of file StorageUniquer.h.

◆ has_operation_or_value_matcher_t

template<typename T , typename OperationOrValue >
using mlir::detail::has_operation_or_value_matcher_t = typedef decltype(std::declval<T>().match(std::declval<OperationOrValue>()))

Trait to check whether T provides a 'match' method with type OperationOrValue.

Definition at line 177 of file Matchers.h.

◆ is_interface_t

template<typename T >
using mlir::detail::is_interface_t = typedef decltype(isInterfaceImpl(std::declval<T &>()))

Definition at line 278 of file InterfaceSupport.h.

◆ IsInterface

template<typename T >
using mlir::detail::IsInterface = typedef llvm::is_detected<is_interface_t, T>

Definition at line 281 of file InterfaceSupport.h.

◆ OwningOpRange

using mlir::detail::OwningOpRange = typedef llvm::OwningArrayRef<Operation *>

Definition at line 31 of file ByteCode.h.

◆ walkResultType

template<typename FnT >
using mlir::detail::walkResultType = typedef decltype(walk(nullptr, std::declval<FnT>()))

Utility to provide the return type of a templated walk method.

Definition at line 319 of file Visitors.h.

Function Documentation

◆ allocAligned()

template<typename T >
std::pair<T *, T *> mlir::detail::allocAligned ( size_t  nElements,
AllocFunType  allocFun = &::malloc,
llvm::Optional< uint64_t >  alignment = llvm::Optional<uint64_t>() 
)

Align nElements of type T with an optional alignment.

This replaces a portable posix_memalign. alignment must be a power of 2 and greater than the size of T. By default the alignment is sizeof(T).

Definition at line 103 of file MemRefUtils.h.

References nextPowerOf2().

◆ bindDims() [1/2]

template<int N>
void mlir::detail::bindDims ( MLIRContext ctx)

Definition at line 307 of file AffineExpr.h.

Referenced by bindDims().

◆ bindDims() [2/2]

template<int N, typename AffineExprTy , typename... AffineExprTy2>
void mlir::detail::bindDims ( MLIRContext ctx,
AffineExprTy &  e,
AffineExprTy2 &...  exprs 
)

Definition at line 310 of file AffineExpr.h.

References bindDims(), and mlir::getAffineDimExpr().

◆ bindSymbols() [1/2]

template<int N>
void mlir::detail::bindSymbols ( MLIRContext ctx)

Definition at line 316 of file AffineExpr.h.

Referenced by bindSymbols().

◆ bindSymbols() [2/2]

template<int N, typename AffineExprTy , typename... AffineExprTy2>
void mlir::detail::bindSymbols ( MLIRContext ctx,
AffineExprTy &  e,
AffineExprTy2 &...  exprs 
)

Definition at line 319 of file AffineExpr.h.

References bindSymbols(), and mlir::getAffineSymbolExpr().

◆ bindSymbolsList()

template<typename AffineExprTy >
void mlir::detail::bindSymbolsList ( MLIRContext ctx,
SmallVectorImpl< AffineExprTy > &  exprs 
)

Definition at line 325 of file AffineExpr.h.

References mlir::getAffineSymbolExpr().

◆ constructContainerOpForParserIfNecessary()

template<typename ContainerOpT >
OwningOpRef<ContainerOpT> mlir::detail::constructContainerOpForParserIfNecessary ( Block parsedBlock,
MLIRContext context,
Location  sourceFileLoc 
)
inline

Given a block containing operations that have just been parsed, if the block contains a single operation of ContainerOpT type then remove it from the block and return it.

If the block does not contain just that operation, create a new operation instance of ContainerOpT and move all of the operations within parsedBlock into the first block of the first region. ContainerOpT is required to have a single region containing a single block, and must implement the SingleBlockImplicitTerminator trait.

Definition at line 38 of file Parser.h.

References mlir::Block::begin(), mlir::OpBuilder::create(), mlir::emitError(), mlir::failed(), mlir::Block::front(), mlir::Block::getOperations(), mlir::parseSourceFile(), mlir::parseSourceString(), and value.

◆ enumerate()

template<typename... Tys, typename CallbackT >
constexpr void mlir::detail::enumerate ( std::tuple< Tys... > &  tuple,
CallbackT &&  callback 
)

Definition at line 232 of file Matchers.h.

References enumerateImpl().

Referenced by ableToUpdatePredOperands(), adjustIter(), mlir::alignAffineMapWithValues(), mlir::bufferization::allocateTensorForShapedValue(), mlir::PatternApplicator::applyCostModel(), applyPatterns(), mlir::applyPermutationToVector(), areSameBitwidthScalarType(), mlir::bufferization::func_ext::CallOpInterface::bufferize(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), buildCostGraph(), mlir::python::PyOpView::buildGeneric(), mlir::scf::buildLoopNest(), buildPredicateList(), cloneAndFuseFirstUse(), collapseGenericOpIterationDims(), composeAffineMapAndOperands(), computeMemRefRankReductionMask(), mlir::LLVM::detail::connectPHINodes(), constructResultVector(), convertForOp(), mlir::LLVMTypeConverter::convertFunctionSignature(), convertIntrinsicResult(), convertOperationImpl(), convertYieldOp(), mlir::tensor::createDimValues(), mlir::tensor::createDynamicDimValues(), createFullTiles(), createI32Constant(), createLessThanFunc(), mlir::ConvertToLLVMPattern::createMemRefDescriptor(), mlir::tensor::createPadHighOp(), createReassociationMapsForCollapse(), mlir::ValueDecomposer::decomposeValue(), deduceCanonicalResource(), defaultAllocBufferCallBack(), diagnoseInvalidOperandDominance(), mlir::linalg::GenerateLoopNest< LoopTy >::doit(), doubleBuffer(), mlir::bufferization::dropEquivalentBufferResults(), dropSwitchCasesThatMatchDefault(), mlir::ComputationSliceState::dump(), elementwiseMatchAndRewriteHelper(), encodeKernelName(), findDuplicateElement(), foldSwitch(), foldTransferInBoundsAttribute(), forwardTerminatorOperands(), fuse(), generateCollapsedIndexingRegion(), generateTileLoopNest(), mlir::sparse_tensor::genReshapeDstShape(), getBackwardSliceImpl(), getBlockIt(), getCollapsableIterationSpaceDims(), getDimMap(), mlir::linalg::getDynOperands(), getExpandedDimToCollapsedDimMap(), getExpandedOutputDimFromInputShape(), getGenericEffectsImpl(), mlir::getLinearizedDimensions(), getLspDiagnoticFromDiag(), mlir::scf::getParallelForInductionVarOwner(), getPHISourceValue(), mlir::linalg::getReassociationMapForFoldingUnitDims(), getSemiAffineExprFromFlatForm(), getShapeDefiningLoopRange(), mlir::getSinglyExecutedRegionsToSink(), getTiledSliceDims(), getTreePredicates(), getTypeNumBytes(), getZero(), mlir::LLVM::detail::handleMultidimensionalVectors(), handleMultidimensionalVectors(), mlir::linalg::hoistRedundantVectorTransfersOnTensor(), injectGpuIndexOperations(), inlinePayload(), inlineRegionImpl(), insertCopyLoops(), mlir::scf::insideMutuallyExclusiveBranches(), mlir::inversePermutation(), invertPermutationVector(), mlir::bytecode::detail::IRNumberingState::IRNumberingState(), mlir::vector::isBroadcastableTo(), isConstantOne(), isDefinedByCallTo(), isDimSequencePreserved(), isFusableWithReshapeByDimExpansion(), isMemRefNormalizable(), mlir::AffineMap::isMinorIdentityWithBroadcasting(), mlir::isOpwiseShiftValid(), mlir::AffineMap::isPermutationOfMinorIdentityWithBroadcasting(), mlir::isReassociationValid(), isTrivialSubViewOp(), mlir::linalg::LinalgDependenceGraph::LinalgDependenceGraph(), mlir::spirv::linearizeIndex(), logFailure(), lowerAsEntryFunction(), lowerEntryPointABIAttr(), mlir::makeStridedLinearLayoutMap(), mlir::GPUFuncOpLowering::matchAndRewrite(), TransferReadPermutationLowering::matchAndRewrite(), ReduceMultiDimReductionRank::matchAndRewrite(), TransposeOpLowering::matchAndRewrite(), AllocaScopeHoister::matchAndRewrite(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), moveRegionToNewWarpOpAndAppendReturns(), outlineKernelFuncImpl(), packFunctionArguments(), padOperandToSmallestStaticBoundingBox(), parseGlobalMemrefOpTypeAndInitialValue(), parseInferType(), parseOptionalKeywordAlternative(), mlir::permuteLoops(), permuteValues(), poolingInferReturnTypes(), printDenseI64ArrayAttr(), mlir::AsmPrinter::Impl::printIntegerSet(), printResultsAsList(), printSwitchOpCases(), produceSliceErrorMsg(), mlir::linalg::promoteSubviewAsNewBuffer(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::replaceAllMemRefUsesWith(), replaceUnitDimIndexOps(), mlir::reshapeLikeShapesAreCompatible(), mlir::linalg::LinalgPaddingPattern::returningMatchAndRewrite(), mlir::linalg::rewriteAsPaddedOp(), simplifySwitchFromDefaultSwitchOnSameCondition(), sliceTransferIndices(), mlir::SPIRVTypeConverter::SPIRVTypeConverter(), splatZero(), mlir::linalg::splitReduction(), mlir::scf::tileConsumerAndFuseProducerGreedilyUsingSCFForOp(), tileLinalgOpImpl(), mlir::scf::tileParallelLoop(), mlir::linalg::TileLoopNest::tileRootOp(), mlir::scf::tileUsingSCFForOp(), mlir::linalg::transformIndexOps(), mlir::sparse_tensor::translateIndicesArray(), updateDestinationOperandsForTiledOp(), updateFuncOp(), vectorizeLinalgYield(), verifyAttributions(), verifyCollapsedShape(), mlir::verifyReshapeLikeTypes(), verifyResultTypesAreInferrable(), verifyTypesAlongAllEdges(), mlir::dataflow::AbstractSparseDataFlowAnalysis::visit(), walkReferenceCountedValues(), wrapExternalFunction(), wrapForExternalCallers(), and yieldTiledValues().

◆ enumerateImpl()

template<typename TupleT , class CallbackT , std::size_t... Is>
constexpr void mlir::detail::enumerateImpl ( TupleT &&  tuple,
CallbackT &&  callback,
std::index_sequence< Is... >   
)

Definition at line 224 of file Matchers.h.

Referenced by enumerate().

◆ filterEntriesForType()

DataLayoutEntryList mlir::detail::filterEntriesForType ( DataLayoutEntryListRef  entries,
TypeID  typeID 
)

Given a list of data layout entries, returns a new list containing the entries with keys having the given type ID, i.e.

belonging to the same type class.

Definition at line 217 of file DataLayoutInterfaces.cpp.

References mlir::Type::getTypeID().

◆ filterEntryForIdentifier()

DataLayoutEntryInterface mlir::detail::filterEntryForIdentifier ( DataLayoutEntryListRef  entries,
StringAttr  id 
)

Given a list of data layout entries, returns the entry that has the given identifier as key, if such an entry exists in the list.

Definition at line 227 of file DataLayoutInterfaces.cpp.

◆ first_argument_type() [1/2]

template<typename Ret , typename Arg , typename... Rest>
Arg mlir::detail::first_argument_type ( Ret(*)(Arg, Rest...)  )

Helper templates to deduce the first argument of a callback parameter.

◆ first_argument_type() [2/2]

template<typename Ret , typename F , typename Arg , typename... Rest>
Arg mlir::detail::first_argument_type ( Ret(F::*)(Arg, Rest...)  )

◆ getBranchSuccessorArgument()

Optional< BlockArgument > mlir::detail::getBranchSuccessorArgument ( const SuccessorOperands operands,
unsigned  operandIndex,
Block successor 
)

Return the BlockArgument corresponding to operand operandIndex in some successor if operandIndex is within the range of operands, or None if operandIndex isn't a successor operand index.

Returns the BlockArgument corresponding to operand operandIndex in some successor if 'operandIndex' is within the range of 'operands', or None if operandIndex isn't a successor operand index.

Definition at line 40 of file ControlFlowInterfaces.cpp.

References mlir::Block::getArgument(), mlir::OperandRange::getBeginOperandIndex(), mlir::SuccessorOperands::getForwardedOperands(), and mlir::SuccessorOperands::getProducedOperandCount().

Referenced by mlir::SuccessorOperands::getOperandIndex().

◆ getDefaultABIAlignment()

unsigned mlir::detail::getDefaultABIAlignment ( Type  type,
const DataLayout dataLayout,
ArrayRef< DataLayoutEntryInterface >  params 
)

Default handler for the required alignemnt request.

Computes results for built-in types and dispatches to the DataLayoutTypeInterface for other types.

Definition at line 133 of file DataLayoutInterfaces.cpp.

References mlir::Type::dyn_cast(), mlir::Type::getContext(), getFloatTypeABIAlignment(), getIndexBitwidth(), getIntegerTypeABIAlignment(), mlir::DataLayout::getTypeABIAlignment(), mlir::DataLayout::getTypeSize(), mlir::Type::isa(), and reportMissingDataLayout().

Referenced by mlir::DataLayout::getTypeABIAlignment().

◆ getDefaultDiagnosticEmitFn() [1/2]

llvm::unique_function< InFlightDiagnostic()> mlir::detail::getDefaultDiagnosticEmitFn ( MLIRContext ctx)

Utility method to generate a callback that can be used to generate a diagnostic when checking the construction invariants of a storage object.

This is defined out-of-line to avoid the need to include Location.h.

Definition at line 1069 of file MLIRContext.cpp.

References mlir::emitError().

Referenced by mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::get(), mlir::DynamicType::get(), and mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getChecked().

◆ getDefaultDiagnosticEmitFn() [2/2]

llvm::unique_function< InFlightDiagnostic()> mlir::detail::getDefaultDiagnosticEmitFn ( const Location loc)

Definition at line 1073 of file MLIRContext.cpp.

References mlir::emitError().

◆ getDefaultPreferredAlignment()

unsigned mlir::detail::getDefaultPreferredAlignment ( Type  type,
const DataLayout dataLayout,
ArrayRef< DataLayoutEntryInterface >  params 
)

Default handler for the preferred alignemnt request.

Computes results for built-in types and dispatches to the DataLayoutTypeInterface for other types.

Definition at line 186 of file DataLayoutInterfaces.cpp.

References mlir::Type::dyn_cast(), mlir::Type::getContext(), getFloatTypePreferredAlignment(), getIndexBitwidth(), getIntegerTypePreferredAlignment(), mlir::DataLayout::getTypeABIAlignment(), mlir::DataLayout::getTypePreferredAlignment(), mlir::Type::isa(), and reportMissingDataLayout().

Referenced by getDefaultTypeSizeInBits(), and mlir::DataLayout::getTypePreferredAlignment().

◆ getDefaultTypeSize()

unsigned mlir::detail::getDefaultTypeSize ( Type  type,
const DataLayout dataLayout,
DataLayoutEntryListRef  params 
)

Default handler for the type size request.

Computes results for built-in types and dispatches to the DataLayoutTypeInterface for other types.

Definition at line 45 of file DataLayoutInterfaces.cpp.

References getDefaultTypeSizeInBits().

Referenced by mlir::DataLayout::getTypeSize().

◆ getDefaultTypeSizeInBits()

unsigned mlir::detail::getDefaultTypeSizeInBits ( Type  type,
const DataLayout dataLayout,
DataLayoutEntryListRef  params 
)

Default handler for the type size in bits request.

Computes results for built-in types and dispatches to the DataLayoutTypeInterface for other types.

Definition at line 51 of file DataLayoutInterfaces.cpp.

References mlir::Type::dyn_cast(), mlir::Type::getContext(), getDefaultPreferredAlignment(), getIndexBitwidth(), mlir::Type::getIntOrFloatBitWidth(), mlir::DataLayout::getTypeSize(), mlir::DataLayout::getTypeSizeInBits(), mlir::Type::isa(), and reportMissingDataLayout().

Referenced by getDefaultTypeSize(), and mlir::DataLayout::getTypeSizeInBits().

◆ getDenseElementBitWidth()

size_t mlir::detail::getDenseElementBitWidth ( Type  eltType)
inline

◆ getMemorySpaceAsInt()

unsigned mlir::detail::getMemorySpaceAsInt ( Attribute  memorySpace)

◆ inferReturnTensorTypes()

LogicalResult mlir::detail::inferReturnTensorTypes ( function_ref< LogicalResult(MLIRContext *, Optional< Location > location, ValueShapeRange operands, DictionaryAttr attributes, RegionRange regions, SmallVectorImpl< ShapedTypeComponents > &retComponents)>  componentTypeFn,
MLIRContext context,
Optional< Location location,
ValueRange  operands,
DictionaryAttr  attributes,
RegionRange  regions,
SmallVectorImpl< Type > &  inferredReturnTypes 
)

◆ isConstantLike()

static bool mlir::detail::isConstantLike ( Operation op)
static

Check to see if the specified operation is ConstantLike.

This includes some quick filters to avoid a semi-expensive test in the common case.

Definition at line 52 of file Matchers.h.

References mlir::Operation::getNumOperands(), mlir::Operation::getNumResults(), and mlir::Operation::hasTrait().

Referenced by mlir::detail::constant_op_matcher::match(), and mlir::detail::constant_op_binder< AttrT >::match().

◆ isInterfaceImpl()

template<typename ConcreteType , typename ValueT , typename Traits , typename BaseType , template< typename, template< typename > class > class BaseTrait>
void mlir::detail::isInterfaceImpl ( Interface< ConcreteType, ValueT, Traits, BaseType, BaseTrait > &  )

◆ isPowerOf2()

constexpr bool mlir::detail::isPowerOf2 ( int  n)

Definition at line 47 of file CRunnerUtils.h.

Referenced by nextPowerOf2().

◆ isSupportedMemorySpace()

bool mlir::detail::isSupportedMemorySpace ( Attribute  memorySpace)

Checks if the memorySpace has supported Attribute type.

Definition at line 497 of file BuiltinTypes.cpp.

References mlir::Attribute::getDialect(), and mlir::Attribute::isa().

Referenced by getMemorySpaceAsInt().

◆ makeStridedMemRefDescriptor() [1/2]

template<int N, typename T >
std::enable_if<(N >= 1), StridedMemRefType<T, N> >::type mlir::detail::makeStridedMemRefDescriptor ( T *  ptr,
T *  alignedPtr,
ArrayRef< int64_t >  shape,
ArrayRef< int64_t >  shapeAlloc 
)

Build a StridedMemRefDescriptor<T, N> that matches the MLIR ABI.

This is an implementation detail that is kept in sync with MLIR codegen conventions. Additionally takes a shapeAlloc array which is used instead of shape to allocate "more aligned" data and compute the corresponding strides.

Definition at line 65 of file MemRefUtils.h.

References StridedMemRefType< T, N >::basePtr, and copy().

◆ makeStridedMemRefDescriptor() [2/2]

template<int N, typename T >
std::enable_if<(N == 0), StridedMemRefType<T, 0> >::type mlir::detail::makeStridedMemRefDescriptor ( T *  ptr,
T *  alignedPtr,
ArrayRef< int64_t >  shape = {},
ArrayRef< int64_t >  shapeAlloc = {} 
)

Build a StridedMemRefDescriptor<T, 0> that matches the MLIR ABI.

This is an implementation detail that is kept in sync with MLIR codegen conventions. Additionally takes a shapeAlloc array which is used instead of shape to allocate "more aligned" data and compute the corresponding strides.

Definition at line 86 of file MemRefUtils.h.

References StridedMemRefType< T, 0 >::basePtr.

◆ makeStrides()

template<size_t N>
std::array<int64_t, N> mlir::detail::makeStrides ( ArrayRef< int64_t >  shape)
inline

Given a shape with sizes greater than 0 along all dimensions, returns the distance, in number of elements, between a slice in a dimension and the next slice in the same dimension.

e.g. shape[3, 4, 5] -> strides[20, 5, 1]

Definition at line 46 of file MemRefUtils.h.

◆ matchOperandOrValueAtIndex() [1/2]

template<typename MatcherClass >
std::enable_if_t< llvm::is_detected<detail::has_operation_or_value_matcher_t, MatcherClass, Value>::value, bool> mlir::detail::matchOperandOrValueAtIndex ( Operation op,
unsigned  idx,
MatcherClass &  matcher 
)

Statically switch to a Value matcher.

Definition at line 185 of file Matchers.h.

References mlir::Operation::getOperand(), and value.

◆ matchOperandOrValueAtIndex() [2/2]

template<typename MatcherClass >
std::enable_if_t< llvm::is_detected<detail::has_operation_or_value_matcher_t, MatcherClass, Operation *>::value, bool> mlir::detail::matchOperandOrValueAtIndex ( Operation op,
unsigned  idx,
MatcherClass &  matcher 
)

Statically switch to an Operation matcher.

Definition at line 195 of file Matchers.h.

References mlir::Value::getDefiningOp(), and mlir::Operation::getOperand().

◆ nextPowerOf2()

constexpr unsigned mlir::detail::nextPowerOf2 ( int  n)

◆ parseSourceFile()

template<typename ContainerOpT , typename... ParserArgs>
OwningOpRef<ContainerOpT> mlir::detail::parseSourceFile ( const ParserConfig config,
ParserArgs &&...  args 
)
inline

The internal implementation of the templated parseSourceFile methods below, that simply forwards to the non-templated version.

Definition at line 134 of file Parser.h.

References mlir::failed(), mlir::ParserConfig::getContext(), and mlir::parseSourceFile().

◆ sameOffsetsSizesAndStrides()

bool mlir::detail::sameOffsetsSizesAndStrides ( OffsetSizeAndStrideOpInterface  a,
OffsetSizeAndStrideOpInterface  b,
llvm::function_ref< bool(OpFoldResult, OpFoldResult)>  cmp 
)

Definition at line 129 of file ViewLikeInterface.cpp.

◆ skipDefaultMemorySpace()

Attribute mlir::detail::skipDefaultMemorySpace ( Attribute  memorySpace)

Replaces default memorySpace (integer == 0) with empty Attribute.

Definition at line 521 of file BuiltinTypes.cpp.

References mlir::Attribute::dyn_cast_or_null().

Referenced by getMemorySpaceAsInt().

◆ verifyAffineMapAsLayout()

LogicalResult mlir::detail::verifyAffineMapAsLayout ( AffineMap  m,
ArrayRef< int64_t >  shape,
function_ref< InFlightDiagnostic()>  emitError 
)

◆ verifyBranchSuccessorOperands()

LogicalResult mlir::detail::verifyBranchSuccessorOperands ( Operation op,
unsigned  succNo,
const SuccessorOperands operands 
)

◆ verifyDataLayoutOp()

LogicalResult mlir::detail::verifyDataLayoutOp ( Operation op)

Verifies that the operation implementing the data layout interface, or a module operation, is valid.

This calls the verifier of the spec attribute and checks if the layout is compatible with specs attached to the enclosing operations.

Definition at line 311 of file DataLayoutInterfaces.cpp.

References mlir::InFlightDiagnostic::attachNote(), collectParentLayouts(), diag(), mlir::Operation::emitError(), mlir::failed(), mlir::failure(), getCombinedDataLayout(), mlir::Operation::getLoc(), getSpec(), and mlir::success().

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

◆ verifyDataLayoutSpec()

LogicalResult mlir::detail::verifyDataLayoutSpec ( DataLayoutSpecInterface  spec,
Location  loc 
)

Verifies that a data layout spec is valid.

This dispatches to individual entry verifiers, and then to the verifiers implemented by the relevant type and dialect interfaces for type and identifier keys respectively.

Definition at line 474 of file DataLayoutInterfaces.cpp.

References mlir::emitError(), mlir::failed(), mlir::failure(), mlir::success(), and value.

◆ verifyInferredResultTypes()

LogicalResult mlir::detail::verifyInferredResultTypes ( Operation op)

Verifies that the inferred result types match the actual result types for the op.

Precondition: op implements InferTypeOpInterface.

Definition at line 203 of file InferTypeOpInterface.cpp.

References mlir::Operation::getAttrDictionary(), mlir::Operation::getContext(), mlir::Operation::getLoc(), mlir::Operation::getOperands(), mlir::Operation::getRegions(), and mlir::Operation::getResultTypes().

Referenced by mlir::ValueShapeRange::getValues().

◆ verifyOffsetSizeAndStrideOp()

LogicalResult mlir::detail::verifyOffsetSizeAndStrideOp ( OffsetSizeAndStrideOpInterface  op)

◆ verifyParallelCombiningOpInterface()

LogicalResult mlir::detail::verifyParallelCombiningOpInterface ( Operation op)

◆ verifyShapedDimOpInterface()

LogicalResult mlir::detail::verifyShapedDimOpInterface ( Operation op)

Verify invariants of ops that implement the ShapedDimOpInterface.

Definition at line 17 of file ShapedOpInterfaces.cpp.

References mlir::Operation::emitError(), mlir::Operation::getNumResults(), mlir::Operation::getResult(), mlir::Value::getType(), mlir::Type::isIndex(), and mlir::success().

◆ verifySymbol()

LogicalResult mlir::detail::verifySymbol ( Operation op)

◆ verifySymbolTable()

LogicalResult mlir::detail::verifySymbolTable ( Operation op)

◆ verifyTypesAlongControlFlowEdges()

LogicalResult mlir::detail::verifyTypesAlongControlFlowEdges ( Operation op)

Verify that types match along control flow edges described the given op.

Definition at line 151 of file ControlFlowInterfaces.cpp.

References mlir::failed(), mlir::failure(), mlir::Operation::getNumRegions(), and verifyTypesAlongAllEdges().

Referenced by mlir::SuccessorOperands::getOperandIndex().

◆ walk() [1/14]

void mlir::detail::walk ( Operation op,
function_ref< void(Region *)>  callback,
WalkOrder  order 
)

Walk all of the regions, blocks, or operations nested under (and including) the given operation.

Walk all of the regions/blocks/operations nested under and including the given operation.

Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'order'. These methods are invoked for void-returning callbacks. A callback on a block or operation is allowed to erase that block or operation only if the walk is in post-order. See non-void method for pre-order erasure.

Definition at line 24 of file Visitors.cpp.

References mlir::Operation::getRegions(), mlir::PostOrder, and mlir::PreOrder.

Referenced by mlir::PatternApplicator::applyDefaultCostModel(), mlir::pdll::ast::Node::getLoc(), isMemRefNormalizable(), mlir::AffineExpr::operator!(), GpuAsyncRegionPass::SingleTokenUseCallback::operator()(), verifyConstantType(), mlir::pdll::ast::Node::walk(), walk(), mlir::Operation::walk(), JamBlockGatherer::walk(), mlir::PatternApplicator::walkAllPatterns(), and walkSymbolUses().

◆ walk() [2/14]

void mlir::detail::walk ( Operation op,
function_ref< void(Block *)>  callback,
WalkOrder  order 
)

Definition at line 40 of file Visitors.cpp.

References mlir::Operation::getRegions(), mlir::PostOrder, mlir::PreOrder, and walk().

◆ walk() [3/14]

void mlir::detail::walk ( Operation op,
function_ref< void(Operation *)>  callback,
WalkOrder  order 
)

◆ walk() [4/14]

WalkResult mlir::detail::walk ( Operation op,
function_ref< WalkResult(Region *)>  callback,
WalkOrder  order 
)

Walk all of the regions, blocks, or operations nested under (and including) the given operation.

Walk all of the regions/blocks/operations nested under and including the given operation.

Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'order'. This method is invoked for skippable or interruptible callbacks. A callback on a block or operation is allowed to erase that block or operation if either:

  • the walk is in post-order, or
  • the walk is in pre-order and the walk is skipped after the erasure.

These functions walk operations until an interrupt result is returned by the callback. Walks on regions, blocks and operations may also be skipped if the callback returns a skip result. Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'order'. A callback on a block or operation is allowed to erase that block or operation if either:

  • the walk is in post-order, or
  • the walk is in pre-order and the walk is skipped after the erasure.

Definition at line 102 of file Visitors.cpp.

References mlir::WalkResult::advance(), mlir::Operation::getRegions(), mlir::WalkResult::interrupt(), mlir::PostOrder, mlir::PreOrder, walk(), mlir::WalkResult::wasInterrupted(), and mlir::WalkResult::wasSkipped().

◆ walk() [5/14]

WalkResult mlir::detail::walk ( Operation op,
function_ref< WalkResult(Block *)>  callback,
WalkOrder  order 
)

◆ walk() [6/14]

WalkResult mlir::detail::walk ( Operation op,
function_ref< WalkResult(Operation *)>  callback,
WalkOrder  order 
)

◆ walk() [7/14]

template<WalkOrder Order = WalkOrder::PostOrder, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t<llvm::is_one_of<ArgT, Operation *, Region *, Block *>::value, RetT> mlir::detail::walk ( Operation op,
FuncTy &&  callback 
)

Walk all of the regions, blocks, or operations nested under (and including) the given operation.

Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'Order' (post-order by default). A callback on a block or operation is allowed to erase that block or operation if either:

  • the walk is in post-order, or
  • the walk is in pre-order and the walk is skipped after the erasure. This method is selected for callbacks that operate on Region*, Block*, and Operation*.

Example: op->walk([](Region *r) { ... }); op->walk([](Block *b) { ... }); op->walk([](Operation *op) { ... });

Definition at line 169 of file Visitors.h.

References mlir::PostOrder, value, and walk().

◆ walk() [8/14]

template<WalkOrder Order = WalkOrder::PostOrder, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< !llvm::is_one_of<ArgT, Operation *, Region *, Block *>::value && std::is_same<RetT, void>::value, RetT> mlir::detail::walk ( Operation op,
FuncTy &&  callback 
)

Walk all of the operations of type 'ArgT' nested under and including the given operation.

Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'order' (post-order by default). This method is selected for void-returning callbacks that operate on a specific derived operation type. A callback on an operation is allowed to erase that operation only if the walk is in post-order. See non-void method for pre-order erasure.

Example: op->walk([](ReturnOp op) { ... });

Definition at line 192 of file Visitors.h.

References mlir::PostOrder, value, and walk().

◆ walk() [9/14]

template<WalkOrder Order = WalkOrder::PostOrder, typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()(std::declval<ArgT>()))>
std::enable_if_t< !llvm::is_one_of<ArgT, Operation *, Region *, Block *>::value && std::is_same<RetT, WalkResult>::value, RetT> mlir::detail::walk ( Operation op,
FuncTy &&  callback 
)

Walk all of the operations of type 'ArgT' nested under and including the given operation.

Regions, blocks and operations at the same nesting level are visited in lexicographical order. The walk order for enclosing regions, blocks and operations with respect to their nested ones is specified by 'Order' (post-order by default). This method is selected for WalkReturn returning skippable or interruptible callbacks that operate on a specific derived operation type. A callback on an operation is allowed to erase that operation if either:

  • the walk is in post-order, or
  • the walk is in pre-order and the walk is skipped after the erasure.

Example: op->walk([](ReturnOp op) { if (some_invariant) return WalkResult::skip(); if (another_invariant) return WalkResult::interrupt(); return WalkResult::advance(); });

Definition at line 227 of file Visitors.h.

References mlir::WalkResult::advance(), value, walk(), and mlir::WalkResult::WalkResult().

◆ walk() [10/14]

void mlir::detail::walk ( Operation op,
function_ref< void(Operation *, const WalkStage &stage)>  callback 
)

Generic walkers with stage aware callbacks.

Walk all the operations nested under (and including) the given operation, with the callback being invoked on each operation N+1 times, where N is the number of regions attached to the operation. The stage input to the callback indicates the current walk stage. This method is invoked for void returning callbacks.

◆ walk() [11/14]

WalkResult mlir::detail::walk ( Operation op,
function_ref< WalkResult(Operation *, const WalkStage &stage)>  callback 
)

Walk all the operations nested under (and including) the given operation, with the callback being invoked on each operation N+1 times, where N is the number of regions attached to the operation.

The stage input to the callback indicates the current walk stage. This method is invoked for skippable or interruptible callbacks.

◆ walk() [12/14]

template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<std::is_same<ArgT, Operation *>::value, RetT> mlir::detail::walk ( Operation op,
FuncTy &&  callback 
)

Walk all of the operations nested under and including the given operation.

This method is selected for stage-aware callbacks that operate on Operation*.

Example: op->walk([](Operation *op, const WalkStage &stage) { ... });

Definition at line 265 of file Visitors.h.

References value, and walk().

◆ walk() [13/14]

template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<!std::is_same<ArgT, Operation *>::value && std::is_same<RetT, void>::value, RetT> mlir::detail::walk ( Operation op,
FuncTy &&  callback 
)

Walk all of the operations of type 'ArgT' nested under and including the given operation.

This method is selected for void returning callbacks that operate on a specific derived operation type.

Example: op->walk([](ReturnOp op, const WalkStage &stage) { ... });

Definition at line 282 of file Visitors.h.

References value, and walk().

◆ walk() [14/14]

template<typename FuncTy , typename ArgT = detail::first_argument<FuncTy>, typename RetT = decltype(std::declval<FuncTy>()( std::declval<ArgT>(), std::declval<const WalkStage &>()))>
std::enable_if_t<!std::is_same<ArgT, Operation *>::value && std::is_same<RetT, WalkResult>::value, RetT> mlir::detail::walk ( Operation op,
FuncTy &&  callback 
)

Walk all of the operations of type 'ArgT' nested under and including the given operation.

This method is selected for WalkReturn returning interruptible callbacks that operate on a specific derived operation type.

Example: op->walk(op, [](ReturnOp op, const WalkStage &stage) { if (some_invariant) return WalkResult::interrupt(); return WalkResult::advance(); });

Definition at line 307 of file Visitors.h.

References mlir::WalkResult::advance(), and walk().

Referenced by walk().

◆ wrapIntegerMemorySpace()

Attribute mlir::detail::wrapIntegerMemorySpace ( unsigned  memorySpace,
MLIRContext ctx 
)

Wraps deprecated integer memory space to the new Attribute form.

Definition at line 513 of file BuiltinTypes.cpp.

Referenced by getMemorySpaceAsInt().

Variable Documentation

◆ first_argument_type

template<typename F >
decltype(first_argument_type(&F::operator())) mlir::detail::first_argument_type(F)

Definition at line 108 of file Visitors.h.