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

AttrTypeReplacer. More...

Namespaces

 analysis_impl
 
 pass_options
 
 storage_user_base_impl
 
 StorageUserTrait
 

Classes

struct  AliasAnalysisTraits
 This class contains various internal trait classes used by the main AliasAnalysis class below. 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...
 
class  TileOffsetRangeImpl
 Encapsulates the set of parameters that are used to make tile offset calculations in the TileOffsetRangeIterator. More...
 
class  TileOffsetRangeIterator
 The STL-style iterator implementation for StaticTileOffsetRange. More...
 
struct  Vector1D
 
struct  Vector1D< T, Dim, true >
 
struct  Vector1D< T, Dim, false >
 
class  AttributeUniquer
 
class  AttrTypeReplacerBase
 This class provides a base utility for replacing attributes/types, and their sub elements. More...
 
struct  is_tuple
 
struct  is_tuple< std::tuple< Ts... > >
 
struct  is_pair
 
struct  is_pair< std::pair< Ts... > >
 
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  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...
 
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  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 > >
 
class  DenseArrayAttrImpl
 Base class for DenseArrayAttr that is instantiated and specialized for each supported element type below. More...
 
class  DenseResourceElementsAttrBase
 Base class for DenseResourceElementsAttr that is instantiated and specialized for each supported element type below. More...
 
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  attr_value_binder
 The matcher that matches a certain kind of Attribute and binds the value inside the Attribute. More...
 
struct  constant_op_matcher
 The matcher that matches operations that have the ConstantLike trait. More...
 
struct  NameOpMatcher
 The matcher that matches operations that have the specified op name. More...
 
struct  AttrOpMatcher
 The matcher that matches operations that have the specified attribute name. More...
 
struct  constant_op_binder
 The matcher that matches operations that have the ConstantLike trait, and binds the folded attribute value. More...
 
struct  infer_int_range_op_binder
 A matcher that matches operations that implement the InferIntRangeInterface interface, and binds the inferred range. More...
 
struct  AttrOpBinder
 The matcher that matches operations that have the specified attribute name, and binds the attribute value. More...
 
struct  constant_float_value_binder
 The matcher that matches a constant scalar / vector splat / tensor splat float Attribute or 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_value_binder
 The matcher that matches a constant scalar / vector splat / tensor splat integer Attribute or 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_int_range_predicate_matcher
 A matcher that matches a given a constant scalar / vector splat / tensor splat integer value or a constant integer range that fulfills a predicate. More...
 
struct  op_matcher
 The matcher that matches a certain kind of op. More...
 
struct  AnyValueMatcher
 Terminal matcher, always returns true. More...
 
struct  AnyCapturedValueMatcher
 Terminal matcher, always returns true. More...
 
struct  PatternMatcherValue
 Binds to a specific value and matches it. More...
 
struct  RecursivePatternMatcher
 RecursivePatternMatcher that composes. 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...
 
class  StorageUserTraitBase
 Helper class for implementing traits for storage classes. More...
 
class  StorageUserBase
 Utility class for implementing users of storage classes uniqued by a StorageUniquer. More...
 
struct  TypeUniquer
 A utility class to get, or create, unique instances of types within an MLIRContext. More...
 
class  IROperandBase
 This class is the base for IROperand, and provides all of the non-templated facilities for operand use management. More...
 
class  ValueImpl
 The base class for all derived Value classes. More...
 
class  BlockArgumentImpl
 The internal implementation of a BlockArgument. More...
 
class  OpResultImpl
 This class provides the implementation for an operation result. More...
 
struct  InlineOpResult
 This class provides the implementation for an operation result whose index can be represented "inline" in the underlying ValueImpl. 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  TypedValue
 TypedValue is a Value with a statically know type. More...
 
class  PreservedAnalyses
 A utility class to represent the analyses that are known to be preserved. More...
 
struct  AnalysisConcept
 The abstract polymorphic base class representing an analysis. More...
 
struct  AnalysisModel
 A derived analysis model used to hold a specific analysis object. More...
 
class  AnalysisMap
 This class represents a cache of analyses for a single operation. More...
 
struct  NestedAnalysisMap
 An analysis map that contains a map for the current operation, and a set of maps for any child operations. More...
 
struct  PassExecutionState
 The state for a single execution of a pass. More...
 
class  PassOptions
 Base container class and manager for all pass options. More...
 
class  Interface
 This class represents an abstract interface. More...
 
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  InterfaceMap
 This class provides an efficient mapping between a given Interface type, and a particular implementation of its concept. More...
 
class  FallbackTypeIDResolver
 This class provides a fallback for resolving TypeIDs. More...
 
class  TypeIDResolver
 This class provides a resolver for getting the ID for a given class T. More...
 
struct  InlineTypeIDResolver
 This class provides utilities for resolving the TypeID of a class that provides a static TypeID resolveTypeID() method. 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  CreateAlgebraicOpForEndomorphismSimplification
 
class  AsmParserImpl
 This class provides the implementation of the generic parser methods within AsmParser. More...
 
class  Parser
 This class implement support for parsing global entities like attributes and types. More...
 
struct  SymbolState
 This class contains record of any parsed top-level symbols. 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  DataLayoutEntryAttrStorage
 
struct  AffineExprStorage
 Base storage class appearing in an affine expression. More...
 
struct  AffineBinaryOpExprStorage
 A binary operation appearing in an affine expression. More...
 
struct  AffineDimExprStorage
 A dimensional or symbolic identifier appearing in an affine expression. More...
 
struct  AffineConstantExprStorage
 An integer constant appearing in affine expression. More...
 
struct  AffineMapStorage
 
class  AsmStateImpl
 
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...
 
struct  DenseStringElementsAttrStorage
 An attribute representing a reference to a dense vector or tensor object containing strings. More...
 
struct  StringAttrStorage
 
struct  DistinctAttrStorage
 An attribute to store a distinct reference to another attribute. More...
 
class  DistinctAttributeUniquer
 A specialized attribute uniquer for distinct attributes that always allocates since the distinct attribute instances use the address of their storage as unique identifier. More...
 
class  DistinctAttributeAllocator
 An allocator for distinct attribute storage instances. More...
 
struct  DiagnosticEngineImpl
 
struct  SourceMgrDiagnosticHandlerImpl
 
struct  ExpectedDiag
 This class represents an expected output diagnostic. More...
 
struct  SourceMgrDiagnosticVerifierHandlerImpl
 
struct  ParallelDiagnosticHandlerImpl
 
struct  DynamicTypeStorage
 Storage of DynamicType. More...
 
struct  DynamicAttrStorage
 Storage of DynamicAttr. More...
 
struct  IntegerSetStorage
 
struct  IntegerTypeStorage
 Integer Type Storage and Uniquing. More...
 
struct  FunctionTypeStorage
 Function Type Storage and Uniquing. More...
 
struct  TupleTypeStorage
 A type representing a collection of other types. More...
 
struct  OpPassManagerImpl
 
struct  PassInstrumentorImpl
 
struct  RecoveryReproducerContext
 This class contains all of the context for generating a recovery reproducer. More...
 
class  OpToOpPassAdaptor
 An adaptor pass used to run operation passes over nested operations. More...
 
class  PassCrashReproducerGenerator
 
struct  PassPipelineCLParserImpl
 
class  PDLByteCodeMutableState
 
class  PDLByteCodePattern
 
class  PDLByteCode
 
struct  StorageUniquerImpl
 This is the implementation of the StorageUniquer class. More...
 
class  TimingManagerImpl
 Private implementation details of the TimingManager. More...
 
class  DefaultTimingManagerImpl
 Implementation details of the DefaultTimingManager. More...
 
struct  ConversionPatternRewriterImpl
 

Typedefs

template<typename T >
using has_default_sub_element_handler_t = decltype(T::DefaultHandlerTag)
 
template<typename T , typename... Ts>
using has_get_method = decltype(T::get(std::declval< Ts >()...))
 
template<typename T , typename... Ts>
using has_get_as_key = decltype(std::declval< T >().getAsKey())
 
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 >
using has_push_back_t = decltype(std::declval< T >().push_back(std::declval< typename T::value_type && >()))
 
template<typename T , typename MatchTarget >
using has_compatible_matcher_t = decltype(std::declval< T >().match(std::declval< MatchTarget >()))
 Trait to check whether T provides a 'match' method with type MatchTarget (Value, Operation, or Attribute). 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...
 

Enumerations

enum class  OpProperties : char
 This is a "tag" used for mapping the properties storage in llvm::TrailingObjects. More...
 

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, std::optional< uint64_t > alignment=std::optional< uint64_t >())
 Align nElements of type T with an optional alignment. More...
 
std::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 std::nullopt 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...
 
llvm::TypeSize getDefaultTypeSize (Type type, const DataLayout &dataLayout, DataLayoutEntryListRef params)
 Default handler for the type size request. More...
 
llvm::TypeSize getDefaultTypeSizeInBits (Type type, const DataLayout &dataLayout, DataLayoutEntryListRef params)
 Default handler for the type size in bits request. More...
 
uint64_t getDefaultABIAlignment (Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
 Default handler for the required alignment request. More...
 
uint64_t getDefaultPreferredAlignment (Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
 Default handler for the preferred alignment request. More...
 
std::optional< uint64_t > getDefaultIndexBitwidth (Type type, const DataLayout &dataLayout, ArrayRef< DataLayoutEntryInterface > params)
 Default handler for the index bitwidth request. More...
 
Attribute getDefaultEndianness (DataLayoutEntryInterface entry)
 Default handler for endianness request. More...
 
Attribute getDefaultAllocaMemorySpace (DataLayoutEntryInterface entry)
 Default handler for alloca memory space request. More...
 
Attribute getDefaultProgramMemorySpace (DataLayoutEntryInterface entry)
 Default handler for program memory space request. More...
 
Attribute getDefaultGlobalMemorySpace (DataLayoutEntryInterface entry)
 Default handler for global memory space request. More...
 
uint64_t getDefaultStackAlignment (DataLayoutEntryInterface entry)
 Default handler for the stack alignment request. More...
 
std::optional< AttributegetDevicePropertyValue (DataLayoutEntryInterface entry)
 Returns the value of the property from the specified DataLayoutEntry. 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...
 
TargetDeviceSpecInterface filterEntryForIdentifier (TargetDeviceSpecListRef entries, StringAttr id)
 Given a list of target device 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 verifyTargetSystemSpec (TargetSystemSpecInterface spec, Location loc)
 Verifies that a target system desc spec is valid. More...
 
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 integer. More...
 
LogicalResult verifyDestinationStyleOpInterface (Operation *op)
 Verify that op conforms to the invariants of DestinationStyleOpInterface. More...
 
LogicalResult inferReturnTensorTypes (ArrayRef< ShapedTypeComponents > retComponents, SmallVectorImpl< Type > &inferredReturnTypes)
 
LogicalResult verifyInferredResultTypes (Operation *op)
 Verifies that the inferred result types match the actual result types for the op. More...
 
void reportFatalInferReturnTypesError (OperationState &state)
 Report a fatal error indicating that the result types could not be inferred. More...
 
LogicalResult verifyLoopLikeOpInterface (Operation *op)
 Verify invariants of the LoopLikeOpInterface. More...
 
LogicalResult verifyParallelCombiningOpInterface (Operation *op)
 
LogicalResult verifyShapedDimOpInterface (Operation *op)
 Verify invariants of ops that implement the ShapedDimOpInterface. More...
 
OpOperanddefaultGetDestinationOperand (Operation *op)
 Return the destination/"init" operand of the op if it implements the DestinationStyleOpInterface and has exactly one "init" operand. More...
 
OpResult defaultGetUpdatedDestination (Operation *op)
 Return the updated destination result of the op if it implements the DestinationStyleOpInterface. More...
 
bool defaultIsEquivalentSubset (Operation *op, Value candidate, function_ref< bool(Value, Value)> equivalenceFn)
 Default implementation of SubsetInsertionOpInterface::isEquivalentSubset. More...
 
bool defaultOperatesOnEquivalentSubset (Operation *op, SubsetOpInterface candidate, function_ref< bool(Value, Value)> equivalenceFn)
 Default implementation of SubsetOpInterface::operatesOnEquivalentSubset. More...
 
bool defaultOperatesOnDisjointSubset (Operation *op, SubsetOpInterface candidate, function_ref< bool(Value, Value)> equivalenceFn)
 Default implementation of SubsetOpInterface::operatesOnDisjointSubset. More...
 
Value getTensorContainer (Operation *op)
 Return the container that the given subset op is operating on. More...
 
LogicalResult verifySubsetOpInterface (SubsetOpInterface op)
 Verify SubsetOpInterface. More...
 
LogicalResult verifySubsetExtractionOpInterface (SubsetExtractionOpInterface op)
 Verify SubsetExtractionOpInterface. More...
 
LogicalResult verifyOffsetSizeAndStrideOp (OffsetSizeAndStrideOpInterface op)
 
bool sameOffsetsSizesAndStrides (OffsetSizeAndStrideOpInterface a, OffsetSizeAndStrideOpInterface b, llvm::function_ref< bool(OpFoldResult, OpFoldResult)> cmp)
 
unsigned getNumDynamicEntriesUpToIdx (ArrayRef< int64_t > staticVals, unsigned idx)
 Helper method to compute the number of dynamic entries of staticVals, up to idx. More...
 
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<class T >
decltype(auto) unwrapForCustomParse (FailureOr< T > &failureOr)
 
template<typename T >
void walkImmediateSubElementsImpl (T derived, function_ref< void(Attribute)> walkAttrsFn, function_ref< void(Type)> walkTypesFn)
 This function provides the underlying implementation for the SubElementInterface walk method, using the key type of the derived attribute/type to interact with the individual parameters. More...
 
template<typename T , typename... Ts>
auto constructSubElementReplacement (MLIRContext *ctx, Ts &&...params)
 This function invokes the proper get method for a type T with the given values. More...
 
template<typename T >
auto replaceImmediateSubElementsImpl (T derived, ArrayRef< Attribute > &replAttrs, ArrayRef< Type > &replTypes)
 This function provides the underlying implementation for the SubElementInterface replace method, using the key type of the derived attribute/type to interact with the individual parameters. More...
 
LogicalResult verifyAffineMapAsLayout (AffineMap m, ArrayRef< int64_t > shape, function_ref< InFlightDiagnostic()> emitError)
 
template<typename MatcherClass >
std::enable_if_t< llvm::is_detected< detail::has_compatible_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_compatible_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...))
 
template<typename Iterator >
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...
 
template<typename Iterator >
void walk (Operation *op, function_ref< void(Block *)> callback, WalkOrder order)
 
template<typename Iterator >
void walk (Operation *op, function_ref< void(Operation *)> callback, WalkOrder order)
 
template<typename Iterator >
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...
 
template<typename Iterator >
WalkResult walk (Operation *op, function_ref< WalkResult(Block *)> callback, WalkOrder order)
 
template<typename Iterator >
WalkResult walk (Operation *op, function_ref< WalkResult(Operation *)> callback, WalkOrder order)
 
template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, 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 Iterator = ForwardIterator, 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 Iterator = ForwardIterator, 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 > &)
 
template<typename Range >
void printDimensionList (raw_ostream &stream, Range &&shape)
 
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)
 

Detailed Description

AttrTypeReplacer.

Detect if any of the given parameter types has a sub-element handler.

Typedef Documentation

◆ 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 153 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 46 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 124 of file Visitors.h.

◆ has_compatible_matcher_t

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

Trait to check whether T provides a 'match' method with type MatchTarget (Value, Operation, or Attribute).

Definition at line 290 of file Matchers.h.

◆ has_default_sub_element_handler_t

template<typename T >
using mlir::detail::has_default_sub_element_handler_t = typedef decltype(T::DefaultHandlerTag)

Definition at line 414 of file AttrTypeSubElements.h.

◆ has_get_as_key

template<typename T , typename... Ts>
using mlir::detail::has_get_as_key = typedef decltype(std::declval<T>().getAsKey())

Definition at line 512 of file AttrTypeSubElements.h.

◆ has_get_method

template<typename T , typename... Ts>
using mlir::detail::has_get_method = typedef decltype(T::get(std::declval<Ts>()...))

Definition at line 510 of file AttrTypeSubElements.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_push_back_t

template<typename T >
using mlir::detail::has_push_back_t = typedef decltype(std::declval<T>().push_back( std::declval<typename T::value_type &&>()))

Definition at line 167 of file DialectImplementation.h.

◆ is_interface_t

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

Definition at line 274 of file InterfaceSupport.h.

◆ IsInterface

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

Definition at line 277 of file InterfaceSupport.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 465 of file Visitors.h.

Enumeration Type Documentation

◆ OpProperties

enum mlir::detail::OpProperties : char
strong

This is a "tag" used for mapping the properties storage in llvm::TrailingObjects.

Definition at line 28 of file Operation.h.

Function Documentation

◆ allocAligned()

template<typename T >
std::pair<T *, T *> mlir::detail::allocAligned ( size_t  nElements,
AllocFunType  allocFun = &::malloc,
std::optional< uint64_t >  alignment = std::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 326 of file AffineExpr.h.

Referenced by bindDims(), and buildLoopIterationCount().

◆ bindDims() [2/2]

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

Definition at line 329 of file AffineExpr.h.

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

◆ bindSymbols() [1/2]

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

Definition at line 335 of file AffineExpr.h.

Referenced by bindSymbols(), and buildLoopIterationCount().

◆ bindSymbols() [2/2]

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

Definition at line 338 of file AffineExpr.h.

References bindSymbols(), and 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::Block::front(), and mlir::Block::getOperations().

◆ constructSubElementReplacement()

template<typename T , typename... Ts>
auto mlir::detail::constructSubElementReplacement ( MLIRContext ctx,
Ts &&...  params 
)

This function invokes the proper get method for a type T with the given values.

Definition at line 539 of file AttrTypeSubElements.h.

References mlir::get().

◆ defaultGetDestinationOperand()

OpOperand & mlir::detail::defaultGetDestinationOperand ( Operation op)

Return the destination/"init" operand of the op if it implements the DestinationStyleOpInterface and has exactly one "init" operand.

Asserts otherwise.

Definition at line 17 of file SubsetOpInterface.cpp.

◆ defaultGetUpdatedDestination()

OpResult mlir::detail::defaultGetUpdatedDestination ( Operation op)

Return the updated destination result of the op if it implements the DestinationStyleOpInterface.

Definition at line 26 of file SubsetOpInterface.cpp.

◆ defaultIsEquivalentSubset()

bool mlir::detail::defaultIsEquivalentSubset ( Operation op,
Value  candidate,
function_ref< bool(Value, Value)>  equivalenceFn 
)

Default implementation of SubsetInsertionOpInterface::isEquivalentSubset.

Definition at line 33 of file SubsetOpInterface.cpp.

References mlir::Value::getDefiningOp().

◆ defaultOperatesOnDisjointSubset()

bool mlir::detail::defaultOperatesOnDisjointSubset ( Operation op,
SubsetOpInterface  candidate,
function_ref< bool(Value, Value)>  equivalenceFn 
)

Default implementation of SubsetOpInterface::operatesOnDisjointSubset.

Definition at line 65 of file SubsetOpInterface.cpp.

References mlir::ValueBoundsConstraintSet::areOverlappingSlices(), and mlir::Operation::getContext().

◆ defaultOperatesOnEquivalentSubset()

bool mlir::detail::defaultOperatesOnEquivalentSubset ( Operation op,
SubsetOpInterface  candidate,
function_ref< bool(Value, Value)>  equivalenceFn 
)

Default implementation of SubsetOpInterface::operatesOnEquivalentSubset.

Definition at line 44 of file SubsetOpInterface.cpp.

References mlir::ValueBoundsConstraintSet::areEquivalentSlices(), and mlir::Operation::getContext().

◆ divideCeil()

llvm::TypeSize mlir::detail::divideCeil ( llvm::TypeSize  numerator,
uint64_t  denominator 
)

◆ enumerate()

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

Definition at line 344 of file Matchers.h.

References enumerateImpl().

Referenced by adjustIter(), mlir::alignAffineMapWithValues(), mlir::bufferization::allocateTensorForShapedValue(), mlir::PatternApplicator::applyCostModel(), applyPatterns(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), buildCostGraph(), mlir::python::PyOpView::buildGeneric(), buildPredicateList(), buildUnrealizedBackwardsCasts(), buildUnrealizedForwardCasts(), calculateCycleEdges(), mlir::vector::castAwayContractionLeadingOneDim(), mlir::transform::detail::checkNestedConsumption(), checkOperandAffineExpr(), checkSafeToTileToForall(), mlir::linalg::collapseOpIterationDims(), composeAffineMapAndOperands(), computeMemRefRankReductionMask(), computePaddedShape(), constifyIndexValues(), constructResultVector(), convertForOp(), convertIntrinsicResult(), mlir::OneToNTypeMapping::convertLocations(), convertOperationImpl(), convertYieldOp(), mlir::tensor::createDynamicDimValues(), createFullTiles(), mlir::ConvertToLLVMPattern::createMemRefDescriptor(), mlir::tensor::createPadHighOp(), createSplitPart(), mlir::irdl::createVerifier(), deduceCanonicalResource(), defaultAllocBufferCallBack(), mlir::mesh::detail::defaultGetShardingOption(), mlir::linalg::GenerateLoopNest< LoopTy >::doit(), doubleBuffer(), mlir::bufferization::dropEquivalentBufferResults(), dropRedundantArguments(), dropSwitchCasesThatMatchDefault(), mlir::linalg::dropUnitDims(), mlir::affine::ComputationSliceState::dump(), mlir::ValueBoundsConstraintSet::dump(), emitElementwiseComputation(), mlir::sparse_tensor::LoopEmitter::enterCurrentCoIterationCase(), mlir::query::extractFunction(), mlir::findPositionsOfType(), foldSwitch(), forEachIJPairInAllBuffers(), mlir::sparse_tensor::SparseIterationSpace::fromValues(), fuse(), mlir::linalg::fuseElementwiseOps(), fuseIfLegal(), genCoIterationCase(), generateCollapsedIndexingRegion(), generateFusedElementwiseOpRegion(), mlir::sparse_tensor::genReshapeDstShape(), mlir::mesh::MeshSharding::get(), getAttrOrTypeVerifier(), mlir::AffineMap::getBroadcastDims(), getCollapsableIterationSpaceDims(), getConstraintIndicesForArgs(), getConstraintPredicates(), getDimMap(), getDroppedDims(), getDynamicSizes(), getExpandedDimToCollapsedDimMap(), getExpandedOutputDimFromInputShape(), mlir::AffineMap::getFilteredIdentityMap(), getGenericEffectsImpl(), mlir::getLinearizedDimensions(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), getOrCreateBlockIndices(), getPackOpResultTypeShape(), getPackUnpackNormalizedPerm(), getPHISourceValue(), mlir::linalg::getPreservedProducerResults(), mlir::linalg::getReassociationMapForFoldingUnitDims(), getSegmentSizesFromAttr(), getSemiAffineExprFromFlatForm(), getShapeDefiningLoopRange(), getSharding(), mlir::getSinglyExecutedRegionsToSink(), mlir::LLVM::LLVMStructType::getSubelementIndexMap(), getSubslotAccessInfo(), getTensorExtractMemoryAccessPattern(), getTreePredicates(), getUserTileSizesAndNumThreads(), gpuMmaUnrollOrder(), groupByDialectPerByte(), handleArgumentImpl(), handleMultidimensionalVectors(), mlir::LLVM::detail::handleMultidimensionalVectors(), handleResultImpl(), mlir::OneToNTypeMapping::hasNonIdentityConversion(), mlir::inferExpandShapeOutputShape(), injectGpuIndexOperations(), inlineOmpRegionCleanup(), inlinePayload(), insertCopyLoops(), mlir::NVVM::PtxBuilder::insertValue(), mlir::inversePermutation(), mlir::invertPermutationVector(), irdlAttrOrTypeVerifier(), irdlOpVerifier(), mlir::bytecode::detail::IRNumberingState::IRNumberingState(), mlir::linalg::isDimSequencePreserved(), isIntegerArrayAttrConfinedToShape(), mlir::AffineMap::isMinorIdentityWithBroadcasting(), mlir::affine::isOpwiseShiftValid(), mlir::AffineMap::isPermutationOfMinorIdentityWithBroadcasting(), mlir::isReassociationValid(), isSumOfIntegerArrayAttrConfinedToShape(), mlir::vector::isTranspose2DSlice(), isTrivialSubViewOp(), mlir::spirv::linearizeIndex(), lowerAsEntryFunction(), mlir::makeStridedLinearLayoutMap(), VectorizationState::maskOperation(), mlir::detail::RecursivePatternMatcher< OpType, OperandMatchers >::match(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), mlir::GPUReturnOpLowering::matchAndRewrite(), moveRegionToNewWarpOpAndAppendReturns(), mlir::transform::ErrorCheckingTrackingListener::notifyPayloadReplacementNotFound(), operator<<(), outlineKernelFuncImpl(), packFunctionArguments(), mlir::linalg::padAndHoistLinalgOp(), parseOptionalKeywordAlternative(), mlir::affine::permuteLoops(), permuteValues(), populateResultTypes(), printAttributions(), printDeviceTypeOperandsWithSegment(), printGangClause(), printNumGangs(), printResultsAsList(), printSwitchOpCases(), printWaitClause(), mlir::LLVM::ModuleImport::processFunction(), mlir::linalg::promoteSubviewAsNewBuffer(), pruneRedundantArguments(), mlir::dlti::query(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::affine::replaceAllMemRefUsesWith(), replaceAndPropagateMemRefType(), replaceForAllWithNewSignature(), mlir::sparse_tensor::reshapeCvs(), mlir::reshapeLikeShapesAreCompatible(), mlir::linalg::rewriteAsPaddedOp(), mlir::transform::detail::setApplyToOneResults(), simplifyMinOrMaxExprWithOperands(), simplifySwitchFromDefaultSwitchOnSameCondition(), sizesForTensor(), sliceTransferIndices(), mlir::linalg::splitReduction(), mlir::sparse_tensor::storeAll(), mlir::scf::tileAndFuseConsumerOfSlice(), mlir::scf::tileConsumerAndFuseProducersUsingSCF(), tileLinalgOpImpl(), mlir::scf::tileReductionUsingScf(), mlir::scf::tileUsingSCF(), mlir::linalg::transformIndexOps(), trimNonScalableUnitDims(), updateFuncOp(), validateFullTilesOnDims(), mlir::ValueBoundsConstraintSet::Variable::Variable(), vectorizeAsTensorPackOp(), vectorizeAsTensorUnpackOp(), verifyCollapsedShape(), verifyLoopLikeOpInterface(), mlir::verifyReshapeLikeTypes(), verifyResultTypesAreInferrable(), verifyTypesAlongAllEdges(), wrapForExternalCallers(), and mlir::scf::yieldReplacementForFusedProducer().

◆ enumerateImpl()

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

Definition at line 336 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 305 of file DataLayoutInterfaces.cpp.

◆ filterEntryForIdentifier() [1/2]

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 315 of file DataLayoutInterfaces.cpp.

◆ filterEntryForIdentifier() [2/2]

TargetDeviceSpecInterface mlir::detail::filterEntryForIdentifier ( TargetDeviceSpecListRef  entries,
StringAttr  id 
)

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

◆ 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()

std::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 std::nullopt 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 std::nullopt 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().

◆ getDefaultABIAlignment()

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

Default handler for the required alignment request.

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

Definition at line 140 of file DataLayoutInterfaces.cpp.

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

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

◆ getDefaultAllocaMemorySpace()

Attribute mlir::detail::getDefaultAllocaMemorySpace ( DataLayoutEntryInterface  entry)

Default handler for alloca memory space request.

Dispatches to the DataLayoutInterface if specified, otherwise returns the default.

Definition at line 253 of file DataLayoutInterfaces.cpp.

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

◆ getDefaultDiagnosticEmitFn() [1/2]

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

Definition at line 1315 of file MLIRContext.cpp.

References mlir::emitError().

◆ getDefaultDiagnosticEmitFn() [2/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 1311 of file MLIRContext.cpp.

References mlir::emitError(), and mlir::get().

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

◆ getDefaultEndianness()

Attribute mlir::detail::getDefaultEndianness ( DataLayoutEntryInterface  entry)

Default handler for endianness request.

Dispatches to the DataLayoutInterface if specified, otherwise returns the default.

Definition at line 242 of file DataLayoutInterfaces.cpp.

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

◆ getDefaultGlobalMemorySpace()

Attribute mlir::detail::getDefaultGlobalMemorySpace ( DataLayoutEntryInterface  entry)

Default handler for global memory space request.

Dispatches to the DataLayoutInterface if specified, otherwise returns the default.

Definition at line 277 of file DataLayoutInterfaces.cpp.

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

◆ getDefaultIndexBitwidth()

std::optional< uint64_t > mlir::detail::getDefaultIndexBitwidth ( Type  type,
const DataLayout dataLayout,
ArrayRef< DataLayoutEntryInterface >  params 
)

Default handler for the index bitwidth request.

Computes the result for the built-in index type and dispatches to the DataLayoutTypeInterface for other types.

Definition at line 224 of file DataLayoutInterfaces.cpp.

References getIndexBitwidth().

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

◆ getDefaultPreferredAlignment()

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

Default handler for the preferred alignment request.

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

Definition at line 194 of file DataLayoutInterfaces.cpp.

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

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

◆ getDefaultProgramMemorySpace()

Attribute mlir::detail::getDefaultProgramMemorySpace ( DataLayoutEntryInterface  entry)

Default handler for program memory space request.

Dispatches to the DataLayoutInterface if specified, otherwise returns the default.

Definition at line 265 of file DataLayoutInterfaces.cpp.

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

◆ getDefaultStackAlignment()

uint64_t mlir::detail::getDefaultStackAlignment ( DataLayoutEntryInterface  entry)

Default handler for the stack alignment request.

Dispatches to the DataLayoutInterface if specified, otherwise returns the default.

Definition at line 288 of file DataLayoutInterfaces.cpp.

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

◆ getDefaultTypeSize()

llvm::TypeSize 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 divideCeil(), and getDefaultTypeSizeInBits().

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

◆ getDefaultTypeSizeInBits()

llvm::TypeSize 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 52 of file DataLayoutInterfaces.cpp.

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

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

◆ getDenseElementBitWidth()

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

◆ getDevicePropertyValue()

std::optional< Attribute > mlir::detail::getDevicePropertyValue ( DataLayoutEntryInterface  entry)

Returns the value of the property from the specified DataLayoutEntry.

If the property is missing from the entry, returns std::nullopt.

Definition at line 297 of file DataLayoutInterfaces.cpp.

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

◆ getMemorySpaceAsInt()

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

[deprecated] Returns the memory space in old raw integer representation.

New Attribute getMemorySpace() method should be used instead.

Definition at line 526 of file BuiltinTypes.cpp.

◆ getNumDynamicEntriesUpToIdx()

unsigned mlir::detail::getNumDynamicEntriesUpToIdx ( ArrayRef< int64_t >  staticVals,
unsigned  idx 
)

Helper method to compute the number of dynamic entries of staticVals, up to idx.

Definition at line 211 of file ViewLikeInterface.cpp.

◆ getTensorContainer()

Value mlir::detail::getTensorContainer ( Operation op)

Return the container that the given subset op is operating on.

Definition at line 86 of file SubsetOpInterface.cpp.

◆ inferReturnTensorTypes()

LogicalResult mlir::detail::inferReturnTensorTypes ( ArrayRef< ShapedTypeComponents retComponents,
SmallVectorImpl< Type > &  inferredReturnTypes 
)

Definition at line 219 of file InferTypeOpInterface.cpp.

References mlir::get().

◆ 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)
constexpr

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 494 of file BuiltinTypes.cpp.

References mlir::Attribute::getDialect().

◆ 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, copy(), StridedMemRefType< T, N >::data, StridedMemRefType< T, N >::offset, StridedMemRefType< T, N >::sizes, and StridedMemRefType< T, N >::strides.

◆ 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.

◆ 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_compatible_matcher_t, MatcherClass, Value>::value, bool> mlir::detail::matchOperandOrValueAtIndex ( Operation op,
unsigned  idx,
MatcherClass &  matcher 
)

Statically switch to a Value matcher.

Definition at line 298 of file Matchers.h.

References mlir::Operation::getOperand().

Referenced by mlir::detail::RecursivePatternMatcher< OpType, OperandMatchers >::match().

◆ matchOperandOrValueAtIndex() [2/2]

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

Statically switch to an Operation matcher.

Definition at line 307 of file Matchers.h.

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

◆ nextPowerOf2()

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

◆ 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 155 of file Parser.h.

References mlir::ParserConfig::getContext().

◆ printDimensionList()

template<typename Range >
void mlir::detail::printDimensionList ( raw_ostream &  stream,
Range &&  shape 
)

◆ replaceImmediateSubElementsImpl()

template<typename T >
auto mlir::detail::replaceImmediateSubElementsImpl ( derived,
ArrayRef< Attribute > &  replAttrs,
ArrayRef< Type > &  replTypes 
)

This function provides the underlying implementation for the SubElementInterface replace method, using the key type of the derived attribute/type to interact with the individual parameters.

Definition at line 557 of file AttrTypeSubElements.h.

References mlir::has_sub_attr_or_type_v.

Referenced by mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getReplaceImmediateSubElementsFn().

◆ reportFatalInferReturnTypesError()

void mlir::detail::reportFatalInferReturnTypesError ( OperationState state)

Report a fatal error indicating that the result types could not be inferred.

Definition at line 251 of file InferTypeOpInterface.cpp.

◆ sameOffsetsSizesAndStrides()

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

Definition at line 190 of file ViewLikeInterface.cpp.

◆ skipDefaultMemorySpace()

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

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

Definition at line 518 of file BuiltinTypes.cpp.

◆ unwrapForCustomParse()

template<class T >
decltype(auto) mlir::detail::unwrapForCustomParse ( FailureOr< T > &  failureOr)

Definition at line 316 of file AttributeSupport.h.

◆ verifyAffineMapAsLayout()

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

Definition at line 77 of file BuiltinAttributeInterfaces.cpp.

◆ 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 409 of file DataLayoutInterfaces.cpp.

References collectParentLayouts(), diag(), mlir::Operation::emitError(), getCombinedDataLayout(), mlir::Operation::getLoc(), and getSpec().

◆ 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 698 of file DataLayoutInterfaces.cpp.

References mlir::emitError().

◆ verifyDestinationStyleOpInterface()

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

Verify that op conforms to the invariants of DestinationStyleOpInterface.

Definition at line 29 of file DestinationStyleOpInterface.cpp.

References mlir::Operation::emitOpError(), and mlir::Value::getType().

◆ 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 238 of file InferTypeOpInterface.cpp.

References mlir::Operation::emitOpError(), mlir::Operation::getContext(), mlir::Operation::getLoc(), mlir::Operation::getOperands(), mlir::Operation::getPropertiesStorage(), mlir::Operation::getRawDictionaryAttrs(), mlir::Operation::getRegions(), and mlir::Operation::getResultTypes().

◆ verifyLoopLikeOpInterface()

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

Verify invariants of the LoopLikeOpInterface.

Definition at line 56 of file LoopLikeInterface.cpp.

References mlir::Operation::emitOpError(), enumerate(), and mlir::getType().

◆ verifyOffsetSizeAndStrideOp()

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

Definition at line 40 of file ViewLikeInterface.cpp.

References mlir::verifyListOfOperandsOrIntegers().

◆ 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(), and mlir::Type::isIndex().

◆ verifySubsetExtractionOpInterface()

LogicalResult mlir::detail::verifySubsetExtractionOpInterface ( SubsetExtractionOpInterface  op)

Verify SubsetExtractionOpInterface.

Definition at line 102 of file SubsetOpInterface.cpp.

◆ verifySubsetOpInterface()

LogicalResult mlir::detail::verifySubsetOpInterface ( SubsetOpInterface  op)

Verify SubsetOpInterface.

Definition at line 92 of file SubsetOpInterface.cpp.

◆ verifySymbol()

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

◆ verifySymbolTable()

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

◆ verifyTargetSystemSpec()

LogicalResult mlir::detail::verifyTargetSystemSpec ( TargetSystemSpecInterface  spec,
Location  loc 
)

Verifies that a target system desc spec is valid.

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

Definition at line 788 of file DataLayoutInterfaces.cpp.

References mlir::emitError(), and mlir::Dialect::getNamespace().

◆ verifyTypesAlongControlFlowEdges()

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

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

Definition at line 147 of file ControlFlowInterfaces.cpp.

References diag(), mlir::Operation::emitOpError(), mlir::Operation::getRegions(), mlir::RegionBranchPoint::parent(), printRegionEdgeName(), and verifyTypesAlongAllEdges().

◆ walk() [1/14]

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

Definition at line 153 of file Visitors.h.

References mlir::PostOrder, and mlir::PreOrder.

◆ walk() [2/14]

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

Definition at line 170 of file Visitors.h.

References mlir::PostOrder, and mlir::PreOrder.

◆ walk() [3/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() [4/14]

template<typename Iterator >
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.

The order in which regions, blocks and operations at the same nesting level are visited (e.g., lexicographical or reverse lexicographical order) is determined by 'Iterator'. 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 136 of file Visitors.h.

References mlir::PostOrder, and mlir::PreOrder.

Referenced by mlir::AttrTypeSubElementHandler< ArrayRef< T >, std::enable_if_t< has_sub_attr_or_type_v< T > > >::walk(), mlir::Operation::walk(), walk(), mlir::PatternApplicator::walkAllPatterns(), and walkImmediateSubElementsImpl().

◆ walk() [5/14]

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

◆ walk() [6/14]

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

◆ walk() [7/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() [8/14]

template<typename Iterator >
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.

The order in which regions, blocks and operations at the same nesting level are visited (e.g., lexicographical or reverse lexicographical order) is determined by 'Iterator'. 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.

Definition at line 200 of file Visitors.h.

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

◆ walk() [9/14]

template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, 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.

The order in which regions, blocks and operations at the same nesting level are visited (e.g., lexicographical or reverse lexicographical order) is determined by 'Iterator'. 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 311 of file Visitors.h.

◆ walk() [10/14]

template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, 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.

The order in which regions, blocks and operations at the same nesting are visited (e.g., lexicographical or reverse lexicographical order) is determined by 'Iterator'. 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 335 of file Visitors.h.

◆ walk() [11/14]

template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, 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.

The order in which regions, blocks and operations at the same nesting are visited (e.g., lexicographical or reverse lexicographical order) is determined by 'Iterator'. 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 372 of file Visitors.h.

References mlir::WalkResult::advance().

◆ 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 411 of file Visitors.h.

References 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 428 of file Visitors.h.

References 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 453 of file Visitors.h.

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

◆ walkImmediateSubElementsImpl()

template<typename T >
void mlir::detail::walkImmediateSubElementsImpl ( derived,
function_ref< void(Attribute)>  walkAttrsFn,
function_ref< void(Type)>  walkTypesFn 
)

This function provides the underlying implementation for the SubElementInterface walk method, using the key type of the derived attribute/type to interact with the individual parameters.

Definition at line 518 of file AttrTypeSubElements.h.

References mlir::has_sub_attr_or_type_v, and walk().

Referenced by mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getWalkImmediateSubElementsFn().

◆ wrapIntegerMemorySpace()

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

Wraps deprecated integer memory space to the new Attribute form.

Definition at line 510 of file BuiltinTypes.cpp.

References mlir::get().

Variable Documentation

◆ first_argument_type

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

Definition at line 120 of file Visitors.h.