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

Include the generated interface declarations. More...

Namespaces

 acc
 
 affine
 
 amdgpu
 
 arith
 
 arm_neon
 
 arm_sme
 
 arm_sve
 
 async
 
 AttributeTrait
 This trait is used to determine if an attribute is a dynamic attribute or not; it should only be implemented by dynamic attributes.
 
 bufferization
 
 builtin
 
 builtin_dialect_detail
 
 bytecode
 
 call_interface_impl
 
 cf
 
 dataflow
 
 detail
 AttrTypeReplacer.
 
 dialect_extension_detail
 
 dlti
 
 emitc
 
 func
 
 function_interface_impl
 
 gpu
 
 impl
 Attribute collections provide a dictionary-like interface.
 
 index
 
 intrange
 
 irdl
 
 khr
 
 linalg
 
 LLVM
 
 lsp
 
 matchers
 
 math
 
 MemoryEffects
 
 memref
 
 mesh
 
 ml_program
 
 nvgpu
 
 NVVM
 
 omp
 
 op_definition_impl
 
 OpTrait
 
 pdl
 
 pdl_to_pdl_interp
 
 pdll
 
 polynomial
 
 presburger
 
 python
 
 quant
 
 query
 
 ROCDL
 
 runtime
 
 scf
 
 shape
 
 SideEffects
 
 sparse_tensor
 
 Speculation
 
 spirv
 
 tblgen
 
 tensor
 
 tosa
 
 tracing
 
 transform
 
 TypeTrait
 This trait is used to determine if a type is a dynamic type or not; it should only be implemented by dynamic types.
 
 ub
 
 utils
 
 vector
 
 x86vector
 
 xegpu
 

Classes

class  LocalAliasAnalysis
 This class implements a local form of alias analysis that tries to identify the underlying values addressed by each value and performs a few basic checks to see if they alias. More...
 
class  AliasResult
 The possible results of an alias query. More...
 
class  ModRefResult
 The possible results of whether a memory access modifies or references a memory location. More...
 
class  AliasAnalysis
 This class represents the main alias analysis interface in MLIR. More...
 
class  CallGraphNode
 This class represents a single callable in the callgraph. More...
 
class  CallGraph
 
class  CFGLoop
 Representation of a single loop formed by blocks. More...
 
class  CFGLoopInfo
 An LLVM LoopInfo instantiation for MLIR that provides access to CFG loops found in the dominator tree. More...
 
struct  ProgramPoint
 Program point represents a specific location in the execution of a program. More...
 
class  GenericLatticeAnchor
 Abstract class for generic lattice anchor. More...
 
class  GenericLatticeAnchorBase
 Base class for generic lattice anchor based on a concrete lattice anchor type and a content key. More...
 
struct  LatticeAnchor
 Fundamental IR components are supported as first-class lattice anchor. More...
 
class  DataFlowConfig
 Configuration class for data flow solver and child analyses. More...
 
class  DataFlowSolver
 The general data-flow analysis solver. More...
 
class  AnalysisState
 Base class for generic analysis states. More...
 
class  DataFlowAnalysis
 Base class for all data-flow analyses. More...
 
class  DataLayoutAnalysis
 Stores data layout objects for each operation that specifies the data layout above and below the given operation. More...
 
class  FlatLinearConstraints
 FlatLinearConstraints is an extension of IntegerPolyhedron. More...
 
class  FlatLinearValueConstraints
 FlatLinearValueConstraints represents an extension of FlatLinearConstraints where each non-local variable can have an SSA Value attached to it. More...
 
class  Liveness
 Represents an analysis for computing liveness information from a given top-level operation. More...
 
class  LivenessBlockInfo
 This class represents liveness information on block level. More...
 
struct  SliceOptions
 
struct  BackwardSliceOptions
 
class  WalkContinuation
 A class to signal how to proceed with the walk of the backward slice: More...
 
class  SymbolTableAnalysis
 This is a simple analysis that contains a symbol table collection and, for simplicity, a reference to the top-level symbol table. More...
 
class  AsmParserState
 This class represents state from a parsed MLIR textual format string. More...
 
class  AsmParserCodeCompleteContext
 This class provides an abstract interface into the parser for hooking in code completion events. More...
 
class  PyShapedType
 Shaped Type Interface - ShapedType. More...
 
class  DialectVersion
 This class is used to represent the version of a dialect, for the purpose of polymorphic destruction. More...
 
class  DialectBytecodeReader
 This class defines a virtual interface for reading a bytecode stream, providing hooks into the bytecode reader. More...
 
class  DialectBytecodeWriter
 This class defines a virtual interface for writing to a bytecode stream, providing hooks into the bytecode writer. More...
 
class  BytecodeDialectInterface
 
class  BytecodeReader
 The BytecodeReader allows to load MLIR bytecode files, while keeping the state explicitly available in order to support lazy loading. More...
 
class  AttrTypeBytecodeReader
 A class to interact with the attributes and types parser when parsing MLIR bytecode. More...
 
class  BytecodeReaderConfig
 A class containing bytecode-specific configurations of the ParserConfig. More...
 
class  AttrTypeBytecodeWriter
 A class to interact with the attributes and types printer when emitting MLIR bytecode. More...
 
class  BytecodeWriterConfig
 This class contains the configuration used for the bytecode writer. More...
 
class  OperationPass
 Pass to transform an operation of a specific type. More...
 
class  ComplexStructBuilder
 
class  ControlFlowToSCFTransformation
 Implementation of CFGToSCFInterface used to lift Control Flow Dialect operations to SCF Dialect operations. More...
 
class  ConvertToLLVMPatternInterface
 Base class for dialect interfaces providing translation to LLVM IR. More...
 
struct  FunctionCallBuilder
 
class  LLVMConversionTarget
 Derived class that automatically populates legalization information for different LLVM ops. More...
 
class  LowerToLLVMOptions
 Options to control the LLVM lowering. More...
 
class  MemRefDescriptor
 Helper class to produce LLVM dialect operations extracting or inserting elements of a MemRef descriptor. More...
 
class  MemRefDescriptorView
 Helper class allowing the user to access a range of Values that correspond to an unpacked memref descriptor using named accessors. More...
 
class  UnrankedMemRefDescriptor
 
class  ConvertToLLVMPattern
 Base class for operation conversions targeting the LLVM IR dialect. More...
 
class  ConvertOpToLLVMPattern
 Utility class for operation conversions targeting the LLVM dialect that match exactly one source operation. More...
 
class  OneToOneConvertToLLVMPattern
 Generic implementation of one-to-one conversion from "SourceOp" to "TargetOp" where the latter belongs to the LLVM dialect or an equivalent. More...
 
class  StructBuilder
 Helper class to produce LLVM dialect operations extracting or inserting values to a struct. More...
 
class  LLVMTypeConverter
 Conversion from types to the LLVM IR dialect. More...
 
class  AttrConvertPassThrough
 
class  VectorConvertToLLVMPattern
 Basic lowering implementation to rewrite Ops with just one result to the LLVM Dialect. More...
 
struct  AllocationOpLLVMLowering
 Lowering for memory allocation ops. More...
 
struct  AllocLikeOpLLVMLowering
 Lowering for AllocOp and AllocaOp. More...
 
class  InterfacePass
 Pass to transform an operation that implements the given interface. More...
 
struct  ScfToSPIRVContext
 
class  SPIRVToLLVMConversion
 
struct  VectorTransferToSCFOptions
 When lowering an N-d vector transfer op to an (N-1)-d vector transfer op, a temporary buffer is created through which individual (N-1)-d vector are staged. More...
 
struct  ArithBuilder
 Helper struct to build simple arithmetic quantities with minimal type inference support. More...
 
class  BufferViewFlowAnalysis
 A straight-forward alias analysis which ensures that all dependencies of all values will be determined. More...
 
class  BufferOriginAnalysis
 An is-same-buffer analysis that checks if two SSA values belong to the same buffer allocation or not. More...
 
class  HasDefaultDLTIDataLayout
 Trait to be used by operations willing to use the implementation of the data layout interfaces provided by the Target dialect. More...
 
struct  MathPolynomialApproximationOptions
 
struct  UnrolledLoopInfo
 
struct  SparsificationOptions
 Options for the Sparsification pass. More...
 
struct  SparseIterationTypeConverter
 Type converter for iter_space and iterator. More...
 
class  SparseTensorTypeToPtrConverter
 Sparse tensor type converter into an opaque pointer. More...
 
class  SparseTensorTypeToBufferConverter
 Sparse tensor type converter into an actual buffer. More...
 
class  StorageSpecifierToLLVMTypeConverter
 
struct  SPIRVConversionOptions
 
class  SPIRVTypeConverter
 Type conversion from builtin types to SPIR-V types for shader interface. More...
 
class  SPIRVConversionTarget
 
class  VulkanLayoutUtils
 According to the Vulkan spec "15.6.4. Offset and Stride Assignment": "There are different alignment requirements depending on the specific resources and on the features enabled on the device. More...
 
class  OwningOpRef
 This class acts as an owning reference to an op, and will automatically destroy the held op on destruction if the held op is valid. More...
 
class  DiagnosedSilenceableFailure
 The result of a transform IR operation application. More...
 
class  DiagnosedDefiniteFailure
 A compatibility class connecting InFlightDiagnostic to DiagnosedSilenceableFailure while providing an interface similar to the former. More...
 
class  RaggedArray
 A 2D array where each row may have different length. More...
 
class  StaticTileOffsetRange
 A range-style iterator that allows for iterating over the offsets of all potential tiles of size tileShape within the larger shape shape, using an ordering specified by loopOrder. More...
 
struct  ComposeReassociativeReshapeOps
 Pattern to collapse producer/consumer reshape ops that are both collapsing dimensions or are both expanding dimensions. More...
 
struct  ComposeCollapseOfExpandOp
 Pattern to compose collapse_shape(expand_shape(src, reassociation_1), reassociation_2). More...
 
struct  ComposeExpandOfCollapseOp
 
struct  Range
 Represents a range (offset, size, and stride) where each element of the triple may be dynamic or static. More...
 
struct  SaturatedInteger
 Idiomatic saturated operations on values like offsets, sizes, and strides. More...
 
class  StructuredGenerator
 Helper StructuredGenerator class to manipulate and rewrite ops with StructuredOpInterface. More...
 
class  SimpleObjectCache
 A simple object cache following Lang's LLJITWithObjectCache example. More...
 
struct  ExecutionEngineOptions
 
class  ExecutionEngine
 JIT-backed execution engine for MLIR. More...
 
struct  JitRunnerOptions
 JitRunner command line options used by JitRunnerConfig methods. More...
 
struct  JitRunnerConfig
 Configuration to override functionality of the JitRunner. More...
 
class  OwningMemRef
 Owning MemRef type that abstracts over the runtime type for ranked strided memref. More...
 
struct  CallInterfaceCallable
 A callable is either a symbol, or an SSA value, that is referenced by a call-like operation. More...
 
class  SuccessorOperands
 This class models how operands are forwarded to block arguments in control flow. More...
 
class  RegionSuccessor
 This class represents a successor of a region. More...
 
class  RegionBranchPoint
 This class represents a point being branched from in the methods of the RegionBranchOpInterface. More...
 
class  InvocationBounds
 This class represents upper and lower bounds on the number of times a region of a RegionBranchOpInterface can be invoked. More...
 
class  DataLayoutDialectInterface
 An interface to be implemented by dialects that can have identifiers in the data layout specification entries. More...
 
class  DataLayout
 The main mechanism for performing data layout queries. More...
 
class  DialectFoldInterface
 Define a fold interface to allow for dialects to control specific aspects of the folding behavior for operations they define. More...
 
class  ConstantIntRanges
 A set of arbitrary-precision integers representing bounds on a given integer value. More...
 
class  IntegerValueRange
 This lattice value represents the integer range of an SSA value. More...
 
class  ShapeAdaptor
 Adaptor class to abstract the differences between whether value is from a ShapedType or ShapedTypeComponents or DenseIntElementsAttribute. More...
 
class  ShapedTypeComponents
 ShapedTypeComponents that represents the components of a ShapedType. More...
 
class  ValueShapeRange
 Range of values and shapes (corresponding effectively to Shapes dialect's ValueShape type concept). More...
 
struct  JamBlockGatherer
 
struct  MemorySlot
 Represents a slot in memory. More...
 
struct  DestructurableMemorySlot
 Memory slot attached with information about its destructuring procedure. More...
 
struct  TilingResult
 Container for result values of tiling. More...
 
struct  MergeResult
 Container for the result of merge operation of tiling. More...
 
class  HyperrectangularSlice
 A hyperrectangular slice, represented as a list of offsets, sizes and strides. More...
 
class  ValueBoundsConstraintSet
 A helper class to be used with ValueBoundsOpInterface. More...
 
class  OpWithOffsetSizesAndStridesConstantArgumentFolder
 Pattern to rewrite dynamic offsets/sizes/strides of view/slice-like ops as constant arguments. More...
 
class  AffineExpr
 Base type for affine expression. More...
 
class  AffineBinaryOpExpr
 Affine binary operation expression. More...
 
class  AffineDimExpr
 A dimensional identifier appearing in an affine expression. More...
 
class  AffineSymbolExpr
 A symbolic identifier appearing in an affine expression. More...
 
class  AffineConstantExpr
 An integer constant appearing in affine expression. More...
 
class  AffineExprVisitorBase
 Base class for AffineExpr visitors/walkers. More...
 
class  AffineExprVisitor
 See documentation for AffineExprVisitorBase. More...
 
class  AffineExprVisitor< SubClass, LogicalResult >
 
class  SimpleAffineExprFlattener
 
class  AffineMap
 A multi-dimensional affine map Affine map's are immutable like Type's, and they are uniqued. More...
 
struct  MutableAffineMap
 A mutable affine map. Its affine expressions are however unique. More...
 
class  AsmResourceBlob
 This class represents a processed binary blob of data. More...
 
class  HeapAsmResourceBlob
 This class provides a simple utility wrapper for creating heap allocated AsmResourceBlobs. More...
 
class  UnmanagedAsmResourceBlob
 This class provides a simple utility wrapper for creating "unmanaged" AsmResourceBlobs. More...
 
class  AsmResourceBuilder
 This class is used to build resource entries for use by the printer. More...
 
class  AsmParsedResourceEntry
 This class represents a single parsed resource entry. More...
 
class  AsmResourceParser
 This class represents an instance of a resource parser. More...
 
class  AsmResourcePrinter
 This class represents an instance of a resource printer. More...
 
class  FallbackAsmResourceMap
 A fallback map containing external resources not explicitly handled by another parser/printer. More...
 
class  ParserConfig
 This class represents a configuration for the MLIR assembly parser. More...
 
class  AsmState
 This class provides management for the lifetime of the state used when printing the IR. More...
 
class  Attribute
 Attributes are known-constant values of operations. More...
 
class  NamedAttribute
 NamedAttribute represents a combination of a name and an Attribute value. More...
 
struct  AttrTypeSubElementHandler< NamedAttribute >
 Allow walking and replacing the subelements of a NamedAttribute. More...
 
class  AttributeInterface
 This class represents the base of an attribute interface. More...
 
class  AbstractAttribute
 This class contains all of the static information common to all instances of a registered Attribute. More...
 
class  AttributeStorage
 Base storage class appearing in an attribute. More...
 
class  AttrTypeWalker
 AttrTypeWalker. More...
 
class  AttrTypeReplacer
 This is an attribute/type replacer that is naively cached. More...
 
class  CyclicAttrTypeReplacer
 This is an attribute/type replacer that supports custom handling of cycles in the replacer logic. More...
 
class  AttrTypeImmediateSubElementWalker
 AttrTypeSubElementHandler. More...
 
class  AttrTypeSubElementReplacements
 This class is used by AttrTypeSubElementHandler instances to process sub element replacements. More...
 
struct  AttrTypeSubElementHandler
 This class provides support for interacting with the SubElementInterfaces for different types of parameters. More...
 
struct  AttrTypeSubElementHandler< T, std::enable_if_t< std::is_base_of_v< Attribute, T >||std::is_base_of_v< Type, T > > >
 Implementation for derived Attributes and Types. More...
 
struct  AttrTypeSubElementHandler< ArrayRef< T >, std::enable_if_t< has_sub_attr_or_type_v< T > > >
 Implementation for derived ArrayRef. More...
 
struct  AttrTypeSubElementHandler< std::tuple< Ts... >, std::enable_if_t< has_sub_attr_or_type_v< Ts... > > >
 Implementation for Tuple. More...
 
class  ValueTypeRange
 This class implements iteration on the types of a given range of values. More...
 
class  Block
 Block represents an ordered list of Operations. More...
 
class  BlockOperand
 A block operand represents an operand that holds a reference to a Block, e.g. More...
 
class  PredecessorIterator
 Implement a predecessor iterator for blocks. More...
 
class  SuccessorRange
 This class implements the successor iterators for Block. More...
 
class  BlockRange
 This class provides an abstraction over the different types of ranges over Blocks. More...
 
class  Builder
 This class is a general helper class for creating context-global objects like types, attributes, and affine expressions. More...
 
class  OpBuilder
 This class helps build Operations. More...
 
struct  DialectResourceBlobHandle
 This class defines a dialect specific handle to a resource blob. More...
 
class  DenseElementsAttr
 An attribute that represents a reference to a dense vector or tensor object. More...
 
class  SplatElementsAttr
 An attribute that represents a reference to a splat vector or tensor constant, meaning all of the elements have the same value. More...
 
class  BoolAttr
 Special case of IntegerAttr to represent boolean integers, i.e., signless i1 integers. More...
 
class  FlatSymbolRefAttr
 A symbol reference with a reference path containing a single element. More...
 
class  DenseFPElementsAttr
 An attribute that represents a reference to a dense float vector or tensor object. More...
 
class  DenseIntElementsAttr
 An attribute that represents a reference to a dense integer vector or tensor object. More...
 
class  DistinctAttr
 An attribute that associates a referenced attribute with a unique identifier. More...
 
class  ValueSemantics
 Type trait indicating that the type has value semantics. More...
 
class  FloatType
 
class  TensorType
 Tensor types represent multi-dimensional arrays, and have two variants: RankedTensorType and UnrankedTensorType. More...
 
class  BaseMemRefType
 This class provides a shared interface for ranked and unranked memref types. More...
 
class  ScalableVectorType
 A vector type containing at least one scalable dimension. More...
 
class  FixedVectorType
 A vector type with no scalable dimensions. More...
 
class  DiagnosticArgument
 A variant type that holds a single argument for a diagnostic. More...
 
class  Diagnostic
 This class contains all of the information necessary to report a diagnostic to the DiagnosticEngine. More...
 
class  InFlightDiagnostic
 This class represents a diagnostic that is inflight and set to be reported. More...
 
class  DiagnosticEngine
 This class is the main interface for diagnostics. More...
 
class  ScopedDiagnosticHandler
 This diagnostic handler is a simple RAII class that registers and erases a diagnostic handler on a given context. More...
 
class  SourceMgrDiagnosticHandler
 This class is a utility diagnostic handler for use with llvm::SourceMgr. More...
 
class  SourceMgrDiagnosticVerifierHandler
 This class is a utility diagnostic handler for use with llvm::SourceMgr that verifies that emitted diagnostics match 'expected-*' lines on the corresponding line of the source file. More...
 
class  ParallelDiagnosticHandler
 This class is a utility diagnostic handler for use when multi-threading some part of the compiler where diagnostics may be emitted. More...
 
class  Dialect
 Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the entire group. More...
 
class  DialectAsmPrinter
 This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom printAttribute/printType() method on a dialect. More...
 
class  DialectAsmParser
 The DialectAsmParser has methods for interacting with the asm parser when parsing attributes and types. More...
 
struct  FieldParser
 Provide a template class that can be specialized by users to dispatch to parsers. More...
 
struct  FieldParser< AttributeT, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, AttributeT > >
 Parse an attribute. More...
 
struct  FieldParser< TypeT, std::enable_if_t< std::is_base_of< Type, TypeT >::value, TypeT > >
 Parse a type. More...
 
struct  FieldParser< IntT, std::enable_if_t< std::is_integral< IntT >::value, IntT > >
 Parse any integer. More...
 
struct  FieldParser< std::string >
 Parse a string. More...
 
struct  FieldParser< std::optional< AttributeT >, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, std::optional< AttributeT > > >
 Parse an Optional attribute. More...
 
struct  FieldParser< std::optional< IntT >, std::enable_if_t< std::is_integral< IntT >::value, std::optional< IntT > > >
 Parse an Optional integer. More...
 
struct  FieldParser< ContainerT, std::enable_if_t< llvm::is_detected< detail::has_push_back_t, ContainerT >::value, ContainerT > >
 Parse any container that supports back insertion as a list. More...
 
struct  FieldParser< AffineMap >
 Parse an affine map. More...
 
class  DialectInterface
 This class represents an interface overridden for a single dialect. More...
 
class  DialectInterfaceCollection
 A collection of dialect interfaces within a context, for a given concrete interface type. More...
 
class  DialectExtensionBase
 This class represents an opaque dialect extension. More...
 
class  DialectExtension
 This class represents a dialect extension anchored on the given set of dialects. More...
 
class  DialectRegistry
 The DialectRegistry maps a dialect namespace to a constructor for the matching dialect. More...
 
class  DialectResourceBlobManager
 This class defines a manager for dialect resource blobs. More...
 
class  ResourceBlobManagerDialectInterface
 This class implements a dialect interface that provides common functionality for interacting with a resource blob manager. More...
 
class  ResourceBlobManagerDialectInterfaceBase
 This class provides a base class for dialects implementing the resource blob interface. More...
 
class  DominanceInfo
 A class for computing basic dominance information. More...
 
class  PostDominanceInfo
 A class for computing basic postdominance information. More...
 
class  DynamicAttrDefinition
 The definition of a dynamic attribute. More...
 
class  DynamicAttr
 A dynamic attribute instance. More...
 
class  DynamicTypeDefinition
 The definition of a dynamic type. More...
 
class  DynamicType
 A dynamic type instance. More...
 
class  DynamicOpDefinition
 The definition of a dynamic op. More...
 
class  ExtensibleDialect
 A dialect that can be extended with new operations/types/attributes at runtime. More...
 
class  DynamicDialect
 A dialect that can be defined at runtime. More...
 
class  ImplicitLocOpBuilder
 ImplicitLocOpBuilder maintains a 'current location', allowing use of the create<> method without specifying the location. More...
 
class  IntegerSet
 An integer set representing a conjunction of one or more affine equalities and inequalities. More...
 
class  IRMapping
 This is a utility class for mapping one set of IR entities to another. More...
 
struct  ReverseIterator
 This iterator enumerates elements in "reverse" order. More...
 
struct  ForwardDominanceIterator
 This iterator enumerates elements according to their dominance relationship. More...
 
struct  ReverseDominanceIterator
 This iterator enumerates elements according to their reverse dominance relationship. More...
 
class  LocationAttr
 Location objects represent source locations information in MLIR. More...
 
class  Location
 This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around a LocationAttr. More...
 
class  FusedLocWith
 This class represents a fused location whose metadata is known to be an instance of the given type. More...
 
class  FileLineColLoc
 An instance of this location represents a tuple of file, line number, and column number. More...
 
struct  AttrTypeSubElementHandler< Location >
 Enable locations to be introspected as sub-elements. More...
 
class  MLIRContext
 MLIRContext is the top-level object for a collection of MLIR operations. More...
 
class  OptionalParseResult
 This class implements Optional functionality for ParseResult. More...
 
struct  EmptyProperties
 Structure used by default as a "marker" when no "Properties" are set on an Operation. More...
 
struct  PropertiesSelector
 Traits to detect whether an Operation defined a Properties type, otherwise it'll default to EmptyProperties. More...
 
struct  PropertiesSelector< Op, std::void_t< typename Op::Properties > >
 
class  OpState
 This is the concrete base class that holds the operation pointer and has non-generic methods that only depend on State (to avoid having them instantiated on template types that don't affect them. More...
 
class  OpFoldResult
 This class represents a single result from folding an operation. More...
 
class  Op
 This provides public APIs that all operations should have. More...
 
class  OpInterface
 This class represents the base of an operation interface. More...
 
class  Operation
 Operation is the basic unit of execution within MLIR. More...
 
class  OpaqueProperties
 Simple wrapper around a void* in order to express generically how to pass in op properties through APIs. More...
 
class  OperationName
 
class  RegisteredOperationName
 This is a "type erased" representation of a registered operation. More...
 
class  NamedAttrList
 NamedAttrList is array of NamedAttributes that tracks whether it is sorted and does some basic work to remain sorted. More...
 
struct  OperationState
 This represents an operation in an abstracted form, suitable for use with the builder APIs. More...
 
class  OpPrintingFlags
 Set of flags used to control the behavior of the various IR print methods (e.g. More...
 
struct  OperationEquivalence
 This class provides utilities for computing if two operations are equivalent. More...
 
class  OperationFingerPrint
 A unique fingerprint for a specific operation, and all of it's internal operations (if includeNested is set). More...
 
class  AsmDialectResourceHandle
 This class represents an opaque handle to a dialect resource entry. More...
 
class  AsmDialectResourceHandleBase
 This class represents a CRTP base class for dialect resource handles. More...
 
class  AsmPrinter
 This base class exposes generic asm printer hooks, usable across the various derived printers. More...
 
class  OpAsmPrinter
 This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom print() method. More...
 
class  AsmParser
 This base class exposes generic asm parser hooks, usable across the various derived parsers. More...
 
class  OpAsmParser
 The OpAsmParser has methods for interacting with the asm parser: parsing things from it, emitting errors etc. More...
 
class  OpAsmDialectInterface
 
class  PatternBenefit
 This class represents the benefit of a pattern match in a unitless scheme that ranges from 0 (very little benefit) to 65K. More...
 
class  Pattern
 This class contains all of the data related to a pattern, but does not contain any methods or logic for the actual matching. More...
 
class  RewritePattern
 RewritePattern is the common base class for all DAG to DAG replacements. More...
 
struct  OpRewritePattern
 OpRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against an instance of a derived operation class as opposed to a raw Operation. More...
 
struct  OpInterfaceRewritePattern
 OpInterfaceRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against an instance of an operation interface instead of a raw Operation. More...
 
class  OpTraitRewritePattern
 OpTraitRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against instances of an operation that possess a given trait. More...
 
class  RewriterBase
 This class coordinates the application of a rewrite on a set of IR, providing a way for clients to track mutations and create new operations. More...
 
class  IRRewriter
 This class coordinates rewriting a piece of IR outside of a pattern rewrite, providing a way to keep track of the mutations made to the IR. More...
 
class  PatternRewriter
 A special type of RewriterBase that coordinates the application of a rewrite pattern on the current IR being matched, providing a way to keep track of any mutations made. More...
 
class  RewritePatternSet
 
class  Region
 This class contains a list of basic blocks and a link to the parent operation it is attached to. More...
 
class  RegionRange
 This class provides an abstraction over the different types of ranges over Regions. More...
 
class  SymbolTable
 This class allows for representing and managing the symbol table used by operations with the 'SymbolTable' trait. More...
 
class  SymbolTableCollection
 This class represents a collection of SymbolTables. More...
 
class  LockedSymbolTableCollection
 This class implements a lock-based shared wrapper around a symbol table collection that allows shared access to the collection of symbol tables. More...
 
class  SymbolUserMap
 This class represents a map of symbols to users, and provides efficient implementations of symbol queries related to users; such as collecting the users of a symbol, replacing all uses, etc. More...
 
class  TypeRange
 This class provides an abstraction over the various different ranges of value types. More...
 
class  TypeRangeRange
 This class provides an abstraction for a range of TypeRange. More...
 
class  ValueTypeIterator
 This class implements iteration on the types of a given range of values. More...
 
struct  AttrTypeSubElementHandler< TypeRange >
 Enable TypeRange to be introspected for sub-elements. More...
 
class  Type
 Instances of the Type class are uniqued, have an immutable identifier and an optional mutable component. More...
 
class  TypeInterface
 This class represents the base of a type interface. More...
 
class  AbstractType
 This class contains all of the static information common to all instances of a registered Type. More...
 
class  TypeStorage
 Base storage class appearing in a Type. More...
 
class  OperandElementTypeIterator
 
class  ResultElementTypeIterator
 
class  IRUnit
 IRUnit is a union of the different types of IR objects that consistute the IR structure (other than Type and Attribute), that is Operation, Region, and Block. More...
 
class  ValueUseIterator
 An iterator class that allows for iterating over the uses of an IR operand type. More...
 
class  ValueUserIterator
 An iterator over the users of an IRObject. More...
 
class  IROperand
 A reference to a value, suitable for use as an operand of an operation. More...
 
class  IRObjectWithUseList
 This class represents a single IR object that contains a use list. More...
 
class  Value
 This class represents an instance of an SSA value in the MLIR system, representing a computable value that has a type and a set of users. More...
 
class  OpOperand
 This class represents an operand of an operation. More...
 
class  BlockArgument
 This class represents an argument of a Block. More...
 
class  OpResult
 This is a value defined by a result of an operation. More...
 
class  OperandRange
 This class implements the operand iterators for the Operation class. More...
 
class  OperandRangeRange
 This class represents a contiguous range of operand ranges, e.g. More...
 
class  MutableOperandRange
 This class provides a mutable adaptor for a range of operands. More...
 
class  MutableOperandRangeRange
 This class represents a contiguous range of mutable operand ranges, e.g. More...
 
class  ResultRange
 This class implements the result iterators for the Operation class. More...
 
class  ValueRange
 This class provides an abstraction over the different types of ranges over Values. More...
 
class  WalkResult
 A utility result that is used to signal how to proceed with an ongoing walk: More...
 
struct  ForwardIterator
 This iterator enumerates the elements in "forward" order. More...
 
class  WalkStage
 A utility class to encode the current walk stage for "generic" walkers. More...
 
class  AnalysisManager
 This class represents an analysis manager for a particular operation instance. More...
 
class  ModuleAnalysisManager
 An analysis manager class specifically for the top-level operation. More...
 
class  Pass
 The abstract base pass class. More...
 
class  OperationPass< void >
 Pass to transform an operation. More...
 
class  PassWrapper
 This class provides a CRTP wrapper around a base pass class to define several necessary utility methods. More...
 
class  PassExecutionAction
 This class encapsulates the "action" of executing a single pass. More...
 
class  PassInstrumentation
 PassInstrumentation provides several entry points into the pass manager infrastructure. More...
 
class  PassInstrumentor
 This class holds a collection of PassInstrumentation objects, and invokes their respective call backs. More...
 
class  OpPassManager
 This class represents a pass manager that runs passes on either a specific operation type, or any isolated operation. More...
 
struct  ReproducerStream
 Streams on which to output crash reproducer. More...
 
class  PassManager
 The main pass manager and pipeline builder. More...
 
class  PassPipelineOptions
 Subclasses of PassPipelineOptions provide a set of options that can be used to initialize a pass pipeline. More...
 
struct  EmptyPipelineOptions
 A default empty option struct to be used for passes that do not need to take any options. More...
 
class  PassRegistryEntry
 Structure to group information about a passes and pass pipelines (argument to invoke via mlir-opt, description, pass pipeline builder). More...
 
class  PassPipelineInfo
 A structure to represent the information of a registered pass pipeline. More...
 
class  PassInfo
 A structure to represent the information for a derived pass class. More...
 
struct  PassRegistration
 PassRegistration provides a global initializer that registers a Pass allocation routine for a concrete pass instance. More...
 
struct  PassPipelineRegistration
 PassPipelineRegistration provides a global initializer that registers a Pass pipeline builder routine. More...
 
struct  PassPipelineRegistration< EmptyPipelineOptions >
 Convenience specialization of PassPipelineRegistration for EmptyPassOptions that does not pass an empty options struct to the pass builder function. More...
 
class  PassPipelineCLParser
 This class implements a command-line parser for MLIR passes. More...
 
class  PassNameCLParser
 This class implements a command-line parser specifically for MLIR pass names. More...
 
struct  PassReproducerOptions
 
class  ReductionNode
 ReductionTreePass will build a reduction tree during module reduction and the ReductionNode represents the vertex of the tree. More...
 
class  DialectReductionPatternInterface
 This is used to report the reduction patterns for a Dialect. More...
 
class  Tester
 This class is used to keep track of the testing environment of the tool. More...
 
class  FrozenRewritePatternSet
 This class represents a frozen set of patterns that can be processed by a pattern applicator. More...
 
class  ApplyPatternAction
 This is the type of Action that is dispatched when a pattern is applied. More...
 
class  PatternApplicator
 This class manages the application of a group of rewrite patterns, with a user-provided cost model. More...
 
class  CopyOnWriteArrayRef
 
class  CyclicReplacerCache
 A cache for replacer-like functions that map values between two domains. More...
 
class  CachedCyclicReplacer
 A helper class for cases where the input/output types of the replacer function is identical to the types stored in the cache. More...
 
class  raw_indented_ostream
 raw_ostream subclass that simplifies indention a sequence of code. More...
 
class  StorageUniquer
 A utility class to get or create instances of "storage classes". More...
 
class  ThreadLocalCache
 This class provides support for defining a thread local object with non static storage duration. More...
 
class  TimingIdentifier
 This class represesents a uniqued string owned by a TimingManager. More...
 
class  TimingManager
 This class represents facilities to measure execution time. More...
 
class  Timer
 A handle for a timer in a TimingManager. More...
 
class  TimingScope
 An RAII-style wrapper around a timer that ensures the timer is properly started and stopped. More...
 
struct  TimeRecord
 Simple record class to record timing information. More...
 
class  OutputStrategy
 Facilities for printing timing reports to various output formats. More...
 
class  DefaultTimingManager
 Facilities for time measurement and report printing to an output stream. More...
 
class  TypeID
 This class provides an efficient unique identifier for a specific C++ type. More...
 
class  TypeIDAllocator
 This class provides a way to define new TypeIDs at runtime. More...
 
class  SelfOwningTypeID
 Defines a TypeID for each instance of this class by using a pointer to the instance. More...
 
class  GenInfo
 Structure to group information about a generator (argument to invoke via mlir-tblgen, description, and generator function). More...
 
struct  GenRegistration
 GenRegistration provides a global initializer that registers a generator function. More...
 
struct  GenNameParser
 Adds command line option for each registered generator. More...
 
class  LLVMImportDialectInterface
 Base class for dialect interfaces used to import LLVM IR. More...
 
class  LLVMImportInterface
 Interface collection for the import of LLVM IR that dispatches to a concrete dialect interface implementation. More...
 
class  LLVMTranslationDialectInterface
 Base class for dialect interfaces providing translation to LLVM IR. More...
 
class  LLVMTranslationInterface
 Interface collection for translation to LLVM IR, dispatches to a concrete interface implementation based on the dialect to which the given op belongs. More...
 
class  MlirOptMainConfig
 Configuration options for the mlir-opt tool. More...
 
class  Translation
 This class contains all of the components necessary for performing a translation. More...
 
struct  TranslateToMLIRRegistration
 Use Translate[ToMLIR|FromMLIR]Registration as an initializer that registers a function and associates it with name. More...
 
struct  TranslateFromMLIRRegistration
 
struct  TranslateRegistration
 
struct  TranslationParser
 A command line parser for translation functions. More...
 
struct  DialectPluginLibraryInfo
 Information about the plugin required to load its dialects & passes. More...
 
class  DialectPlugin
 A loaded dialect plugin. More...
 
struct  PassPluginLibraryInfo
 Information about the plugin required to load its passes. More...
 
class  PassPlugin
 A loaded pass plugin. More...
 
class  CFGToSCFInterface
 Interface that should be implemented by any caller of transformCFGToSCF. More...
 
class  TypeConverter
 Type conversion class. More...
 
class  ConversionPattern
 Base class for the conversion patterns. More...
 
class  OpConversionPattern
 OpConversionPattern is a wrapper around ConversionPattern that allows for matching and rewriting against an instance of a derived operation class as opposed to a raw Operation. More...
 
class  OpInterfaceConversionPattern
 OpInterfaceConversionPattern is a wrapper around ConversionPattern that allows for matching and rewriting against an instance of an OpInterface class as opposed to a raw Operation. More...
 
class  OpTraitConversionPattern
 OpTraitConversionPattern is a wrapper around ConversionPattern that allows for matching and rewriting against instances of an operation that possess a given trait. More...
 
class  ConversionPatternRewriter
 This class implements a pattern rewriter for use with ConversionPatterns. More...
 
class  ConversionTarget
 This class describes a specific conversion target. More...
 
class  PDLConversionConfig
 A PDL configuration that is used to supported dialect conversion functionality. More...
 
struct  ConversionConfig
 Dialect conversion configuration. More...
 
struct  EndomorphismSimplification
 
class  OperationFolder
 A utility class for folding operations, and unifying duplicated constants generated along the way. More...
 
class  GreedyRewriteConfig
 This class allows control over how the GreedyPatternRewriteDriver works. More...
 
struct  HomomorphismSimplification
 
class  InlinerConfig
 
class  Inliner
 This is an implementation of the inliner that operates bottom up over the Strongly Connected Components(SCCs) of the CallGraph. More...
 
class  DialectInlinerInterface
 This is the interface that must be implemented by the dialects of operations to be inlined. More...
 
class  InlinerInterface
 This interface provides the hooks into the inlining interface. More...
 
struct  Mem2RegStatistics
 Statistics collected while applying mem2reg. More...
 
class  OneToNTypeMapping
 Stores a 1:N mapping of types and provides several useful accessors. More...
 
class  RewritePatternWithConverter
 Extends the basic RewritePattern class with a type converter member and some accessors to it. More...
 
class  OneToNPatternRewriter
 Specialization of PatternRewriter that OneToNConversionPatterns use. More...
 
class  OneToNConversionPattern
 Base class for patterns with 1:N type conversions. More...
 
class  OneToNOpConversionPattern
 This class is a wrapper around OneToNConversionPattern for matching against instances of a particular op class. More...
 
struct  SROAStatistics
 Statistics collected while applying SROA. More...
 
class  Lexer
 This class breaks up the current file into a token stream. More...
 
class  Token
 This represents a token in the MLIR syntax. More...
 
struct  PyPrintAccumulator
 Accumulates into a python string from a method that accepts an MlirStringCallback. More...
 
class  PyFileAccumulator
 Accumulates int a python file-like object, either writing text (default) or binary. More...
 
struct  PySinglePartStringAccumulator
 Accumulates into a python string from a method that is expected to make one (no more, no less) call to the callback (asserts internally on violation). More...
 
class  Sliceable
 A CRTP base class for pseudo-containers willing to support Python-type slicing access on top of indexed access. More...
 
class  ExternalPass
 This pass class wraps external passes defined in other languages using the MLIR C-interface. More...
 
struct  GPUDynamicSharedMemoryOpLowering
 Lowering for gpu.dynamic.shared.memory to LLVM dialect. More...
 
struct  GPUFuncOpLoweringOptions
 
struct  GPUFuncOpLowering
 
struct  GPUPrintfOpToHIPLowering
 The lowering of gpu.printf to a call to HIP hostcalls. More...
 
struct  GPUPrintfOpToLLVMCallLowering
 The lowering of gpu.printf to a call to an external printf() function. More...
 
struct  GPUPrintfOpToVPrintfLowering
 Lowering of gpu.printf to a vprintf standard library. More...
 
struct  GPUReturnOpLowering
 
struct  ScalarizeVectorOpLowering
 Rewriting that unrolls SourceOp to scalars if it's operating on vectors. More...
 
struct  OpToFuncCallLowering
 Rewriting that replace SourceOp with a CallOp to f32Func or f64Func or f32ApproxFunc or f16Func depending on the element type and the fastMathFlag of that Op. More...
 
struct  ScfToSPIRVContextImpl
 
struct  AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >
 Allow walking and replacing the subelements of a LLVMStructTypeStorage key. More...
 
class  MLIRContextImpl
 This is the implementation of the MLIRContext class, using the pImpl idiom. More...
 
struct  OperationConverter
 

Typedefs

using TransitiveFilter = SliceOptions::TransitiveFilter
 
using ForwardSliceOptions = SliceOptions
 
using WalkCallback = mlir::function_ref< WalkContinuation(mlir::Value)>
 A callback that is invoked for each value encountered during the walk of the slice. More...
 
using LoweringCallback = std::function< std::unique_ptr< llvm::Module >(Operation *, llvm::LLVMContext &, StringRef)>
 
using MemorySpaceMapping = std::function< unsigned(gpu::AddressSpace)>
 A function that maps a MemorySpace enum to a target-specific integer value. More...
 
using ReassociationIndices = SmallVector< int64_t, 2 >
 
using MemrefValue = TypedValue< BaseMemRefType >
 A value with a memref type. More...
 
using Loops = SmallVector< scf::ForOp, 8 >
 Tile a nest of standard for loops rooted at rootForOp by finding such parametric tile sizes that the outer loops have a fixed number of iterations as defined in sizes. More...
 
using TileLoops = std::pair< Loops, Loops >
 
using ReassociationIndicesRef = ArrayRef< int64_t >
 
using ReassociationExprs = SmallVector< AffineExpr, 2 >
 
using AllocFunType = llvm::function_ref< void *(size_t)>
 
template<typename T >
using ElementWiseVisitor = llvm::function_ref< void(T &ptr, ArrayRef< int64_t >)>
 Convenient callback to "visit" a memref element by element. More...
 
using DataLayoutEntryKey = llvm::PointerUnion< Type, StringAttr >
 
using DataLayoutEntryList = llvm::SmallVector< DataLayoutEntryInterface, 4 >
 
using DataLayoutEntryListRef = llvm::ArrayRef< DataLayoutEntryInterface >
 
using TargetDeviceSpecListRef = llvm::ArrayRef< TargetDeviceSpecInterface >
 
using TargetDeviceSpecEntry = std::pair< StringAttr, TargetDeviceSpecInterface >
 
using SetIntRangeFn = llvm::function_ref< void(Value, const ConstantIntRanges &)>
 The type of the setResultRanges callback provided to ops implementing InferIntRangeInterface. More...
 
using SetIntLatticeFn = llvm::function_ref< void(Value, const IntegerValueRange &)>
 Similar to SetIntRangeFn, but operating on IntegerValueRange lattice values. More...
 
using ReifiedRankedShapedTypeDims = SmallVector< SmallVector< OpFoldResult > >
 
using NewYieldValuesFn = std::function< SmallVector< Value >(OpBuilder &b, Location loc, ArrayRef< BlockArgument > newBbArgs)>
 A function that returns the additional yielded values during replaceWithAdditionalYields. More...
 
using ValueDimList = SmallVector< std::pair< Value, std::optional< int64_t > >>
 
using DefaultAttributeStorage = AttributeStorage
 Default storage type for attributes that require no additional initialization or storage. More...
 
using AttributeStorageAllocator = StorageUniquer::StorageAllocator
 
using AttrSubElementReplacements = AttrTypeSubElementReplacements< Attribute >
 
using TypeSubElementReplacements = AttrTypeSubElementReplacements< Type >
 
using DenseResourceElementsHandle = DialectResourceBlobHandle< BuiltinDialect >
 
using DenseBoolArrayAttr = detail::DenseArrayAttrImpl< bool >
 
using DenseI8ArrayAttr = detail::DenseArrayAttrImpl< int8_t >
 
using DenseI16ArrayAttr = detail::DenseArrayAttrImpl< int16_t >
 
using DenseI32ArrayAttr = detail::DenseArrayAttrImpl< int32_t >
 
using DenseI64ArrayAttr = detail::DenseArrayAttrImpl< int64_t >
 
using DenseF32ArrayAttr = detail::DenseArrayAttrImpl< float >
 
using DenseF64ArrayAttr = detail::DenseArrayAttrImpl< double >
 
using DenseBoolResourceElementsAttr = detail::DenseResourceElementsAttrBase< bool >
 
using DenseI8ResourceElementsAttr = detail::DenseResourceElementsAttrBase< int8_t >
 
using DenseI16ResourceElementsAttr = detail::DenseResourceElementsAttrBase< int16_t >
 
using DenseI32ResourceElementsAttr = detail::DenseResourceElementsAttrBase< int32_t >
 
using DenseI64ResourceElementsAttr = detail::DenseResourceElementsAttrBase< int64_t >
 
using DenseUI8ResourceElementsAttr = detail::DenseResourceElementsAttrBase< uint8_t >
 
using DenseUI16ResourceElementsAttr = detail::DenseResourceElementsAttrBase< uint16_t >
 
using DenseUI32ResourceElementsAttr = detail::DenseResourceElementsAttrBase< uint32_t >
 
using DenseUI64ResourceElementsAttr = detail::DenseResourceElementsAttrBase< uint64_t >
 
using DenseF32ResourceElementsAttr = detail::DenseResourceElementsAttrBase< float >
 
using DenseF64ResourceElementsAttr = detail::DenseResourceElementsAttrBase< double >
 
using DialectAllocatorFunction = std::function< Dialect *(MLIRContext *)>
 
using DialectAllocatorFunctionRef = function_ref< Dialect *(MLIRContext *)>
 
using DynamicDialectPopulationFunction = std::function< void(MLIRContext *, DynamicDialect *)>
 
using DominanceInfoNode = llvm::DomTreeNodeBase< Block >
 
using OpAsmSetValueNameFn = function_ref< void(Value, StringRef)>
 A functor used to set the name of the start of a result group of an operation. More...
 
using OpAsmSetBlockNameFn = function_ref< void(Block *, StringRef)>
 A functor used to set the name of blocks in regions directly nested under an operation. More...
 
using TypeRangeRangeIterator = llvm::mapped_iterator< llvm::iota_range< unsigned >::iterator, std::function< TypeRange(unsigned)> >
 
using DefaultTypeStorage = TypeStorage
 Default storage type for types that require no additional initialization or storage. More...
 
using TypeStorageAllocator = StorageUniquer::StorageAllocator
 This is a utility allocator used to allocate memory for instances of derived Types. More...
 
using OperandElementTypeRange = iterator_range< OperandElementTypeIterator >
 
using ResultElementTypeRange = iterator_range< ResultElementTypeIterator >
 
template<typename Ty , typename Value = mlir::Value>
using TypedValue = std::conditional_t< std::is_same_v< Ty, mlir::Type >, mlir::Value, detail::TypedValue< Ty > >
 If Ty is mlir::Type this will select Value instead of having a wrapper around it. More...
 
using ReproducerStreamFactory = std::function< std::unique_ptr< ReproducerStream >(std::string &error)>
 Method type for constructing ReproducerStream. More...
 
using PassRegistryFunction = std::function< LogicalResult(OpPassManager &, StringRef options, function_ref< LogicalResult(const Twine &)> errorHandler)>
 A registry function that adds passes to the given pass manager. More...
 
using PassAllocatorFunction = std::function< std::unique_ptr< Pass >()>
 
template<typename T , typename Enable = void>
using DenseMapInfo = llvm::DenseMapInfo< T, Enable >
 
template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
using DenseMap = llvm::DenseMap< KeyT, ValueT, KeyInfoT, BucketT >
 
template<typename ValueT , typename ValueInfoT = DenseMapInfo<ValueT>>
using DenseSet = llvm::DenseSet< ValueT, ValueInfoT >
 
template<typename T , typename Vector = llvm::SmallVector<T, 0>, typename Set = DenseSet<T>, unsigned N = 0>
using SetVector = llvm::SetVector< T, Vector, Set, N >
 
template<typename AllocatorTy = llvm::MallocAllocator>
using StringSet = llvm::StringSet< AllocatorTy >
 
template<typename T , typename R = T>
using StringSwitch = llvm::StringSwitch< T, R >
 
template<typename T , typename ResultT = void>
using TypeSwitch = llvm::TypeSwitch< T, ResultT >
 
template<typename Fn >
using function_ref = llvm::function_ref< Fn >
 
using ChunkBufferHandler = function_ref< LogicalResult(std::unique_ptr< llvm::MemoryBuffer > chunkBuffer, raw_ostream &os)>
 
using GenFunction = std::function< bool(const llvm::RecordKeeper &records, raw_ostream &os)>
 Generator function to invoke. More...
 
using PassPipelineFn = llvm::function_ref< LogicalResult(PassManager &pm)>
 This defines the function type used to setup the pass manager. More...
 
using TranslateSourceMgrToMLIRFunction = std::function< OwningOpRef< Operation * >(const std::shared_ptr< llvm::SourceMgr > &sourceMgr, MLIRContext *)>
 Interface of the function that translates the sources managed by sourceMgr to MLIR. More...
 
using TranslateRawSourceMgrToMLIRFunction = std::function< OwningOpRef< Operation * >(llvm::SourceMgr &sourceMgr, MLIRContext *)>
 
using TranslateStringRefToMLIRFunction = std::function< OwningOpRef< Operation * >(llvm::StringRef, MLIRContext *)>
 Interface of the function that translates the given string to MLIR. More...
 
using TranslateFromMLIRFunction = std::function< LogicalResult(Operation *, llvm::raw_ostream &output)>
 Interface of the function that translates MLIR to a different format and outputs the result to a stream. More...
 
using TranslateFunction = std::function< LogicalResult(const std::shared_ptr< llvm::SourceMgr > &sourceMgr, llvm::raw_ostream &output, MLIRContext *)>
 Interface of the function that performs file-to-file translation involving MLIR. More...
 
using DialectRegistrationFunction = std::function< void(DialectRegistry &)>
 Interface of the function that adds all dialects and dialect extensions used for the translation to the given DialectRegistry. More...
 

Enumerations

enum class  ChangeResult { NoChange , Change }
 A result type used to indicate if a change happened. More...
 
enum class  HoistingKind : uint8_t { None = 0 , Loop = 1 << 0 , Block = 1 << 1 }
 
enum class  SparseParallelizationStrategy {
  kNone , kDenseOuterLoop , kAnyStorageOuterLoop , kDenseAnyLoop ,
  kAnyStorageAnyLoop
}
 Defines a parallelization strategy. More...
 
enum class  ReinterpretMapScope { kAll , kGenericOnly , kExceptGeneric }
 Defines a scope for reinterpret map pass. More...
 
enum class  SparseEmitStrategy { kFunctional , kSparseIterator , kDebugInterface }
 Defines a scope for reinterpret map pass. More...
 
enum class  SPIRVSubByteTypeStorage { Packed }
 How sub-byte values are storaged in memory. More...
 
enum class  ReshapeOpKind { kExpand , kCollapse }
 
enum class  DeletionKind { Keep , Delete }
 Returned by operation promotion logic requesting the deletion of an operation. More...
 
enum class  AffineExprKind {
  Add , Mul , Mod , FloorDiv ,
  CeilDiv , LAST_AFFINE_BINARY_OP = CeilDiv , Constant , DimId ,
  SymbolId
}
 
enum class  AsmResourceEntryKind { Blob , Bool , String }
 This enum represents the different kinds of resource values. More...
 
enum class  SliceVerificationResult {
  Success , RankTooLarge , SizeMismatch , ElemTypeMismatch ,
  MemSpaceMismatch , LayoutMismatch
}
 Enum that captures information related to verifier error conditions on slice insert/extract type of ops. More...
 
enum class  DiagnosticSeverity { Note , Warning , Error , Remark }
 Defines the different supported severity of a diagnostic. More...
 
enum class  RegionKind { SSACFG , Graph }
 The kinds of regions contained in an operation. More...
 
enum class  WalkOrder { PreOrder , PostOrder }
 Traversal order for region, block and operation walk utilities. More...
 
enum class  PassDisplayMode { List , Pipeline }
 An enum describing the different display modes for the information within the pass manager. More...
 
enum  TraversalMode { SinglePath , Backtrack , MultiPath }
 Defines the traversal method options to be used in the reduction tree traversal. More...
 
enum class  VerbosityLevel { ErrorsOnly = 0 , ErrorsAndWarnings , ErrorsWarningsAndRemarks }
 enum class to indicate the verbosity level of the diagnostic filter. More...
 
enum class  GreedyRewriteStrictness { AnyOp , ExistingAndNewOps , ExistingOps }
 This enum controls which ops are put on the worklist during a greedy pattern rewrite. More...
 
enum class  GreedySimplifyRegionLevel { Disabled , Normal , Aggressive }
 

Functions

raw_ostream & operator<< (raw_ostream &os, const AliasResult &result)
 
raw_ostream & operator<< (raw_ostream &os, const ModRefResult &result)
 
ChangeResult operator| (ChangeResult lhs, ChangeResult rhs)
 
ChangeResultoperator|= (ChangeResult &lhs, ChangeResult rhs)
 
ChangeResult operator& (ChangeResult lhs, ChangeResult rhs)
 
raw_ostream & operator<< (raw_ostream &os, ProgramPoint point)
 
raw_ostream & operator<< (raw_ostream &os, const AnalysisState &state)
 
raw_ostream & operator<< (raw_ostream &os, LatticeAnchor anchor)
 
LogicalResult getFlattenedAffineExpr (AffineExpr expr, unsigned numDims, unsigned numSymbols, SmallVectorImpl< int64_t > *flattenedExpr, FlatLinearConstraints *cst=nullptr, bool addConservativeSemiAffineBounds=false)
 Flattens 'expr' into 'flattenedExpr', which contains the coefficients of the dimensions, symbols, and additional variables that represent floor divisions of dimensions, symbols, and in turn other floor divisions. More...
 
LogicalResult getFlattenedAffineExprs (AffineMap map, std::vector< SmallVector< int64_t, 8 >> *flattenedExprs, FlatLinearConstraints *cst=nullptr, bool addConservativeSemiAffineBounds=false)
 Flattens the result expressions of the map to their corresponding flattened forms and set in 'flattenedExprs'. More...
 
LogicalResult getFlattenedAffineExprs (IntegerSet set, std::vector< SmallVector< int64_t, 8 >> *flattenedExprs, FlatLinearConstraints *cst=nullptr)
 
LogicalResult getMultiAffineFunctionFromMap (AffineMap map, presburger::MultiAffineFunction &multiAff)
 
AffineMap alignAffineMapWithValues (AffineMap map, ValueRange operands, ValueRange dims, ValueRange syms, SmallVector< Value > *newSyms=nullptr)
 Re-indexes the dimensions and symbols of an affine map with given operands values to align with dims and syms values. More...
 
void getForwardSlice (Operation *op, SetVector< Operation * > *forwardSlice, const ForwardSliceOptions &options={})
 Fills forwardSlice with the computed forward slice (i.e. More...
 
void getForwardSlice (Value root, SetVector< Operation * > *forwardSlice, const ForwardSliceOptions &options={})
 Value-rooted version of getForwardSlice. More...
 
void getBackwardSlice (Operation *op, SetVector< Operation * > *backwardSlice, const BackwardSliceOptions &options={})
 Fills backwardSlice with the computed backward slice (i.e. More...
 
void getBackwardSlice (Value root, SetVector< Operation * > *backwardSlice, const BackwardSliceOptions &options={})
 Value-rooted version of getBackwardSlice. More...
 
SetVector< Operation * > getSlice (Operation *op, const BackwardSliceOptions &backwardSliceOptions={}, const ForwardSliceOptions &forwardSliceOptions={})
 Iteratively computes backward slices and forward slices until a fixed point is reached. More...
 
Value matchReduction (ArrayRef< BlockArgument > iterCarriedArgs, unsigned redPos, SmallVectorImpl< Operation * > &combinerOps)
 Utility to match a generic reduction given a list of iteration-carried arguments, iterCarriedArgs and the position of the potential reduction argument within the list, redPos. More...
 
WalkContinuation walkSlice (mlir::ValueRange rootValues, WalkCallback walkCallback)
 Walks the slice starting from the rootValues using a depth-first traversal. More...
 
std::optional< SmallVector< Value > > getControlFlowPredecessors (Value value)
 Computes a vector of all control predecessors of value. More...
 
bool sortTopologically (Block *block, iterator_range< Block::iterator > ops, function_ref< bool(Value, Operation *)> isOperandReady=nullptr)
 Given a block, sort a range operations in said block in topological order. More...
 
bool sortTopologically (Block *block, function_ref< bool(Value, Operation *)> isOperandReady=nullptr)
 Given a block, sort its operations in topological order, excluding its terminator if it has one. More...
 
bool computeTopologicalSorting (MutableArrayRef< Operation * > ops, function_ref< bool(Value, Operation *)> isOperandReady=nullptr)
 Compute a topological ordering of the given ops. More...
 
SetVector< Block * > getBlocksSortedByDominance (Region &region)
 Gets a list of blocks that is sorted according to dominance. More...
 
SetVector< Operation * > topologicalSort (const SetVector< Operation * > &toSort)
 Sorts all operations in toSort topologically while also considering region semantics. More...
 
LogicalResult parseAsmSourceFile (const llvm::SourceMgr &sourceMgr, Block *block, const ParserConfig &config, AsmParserState *asmState=nullptr, AsmParserCodeCompleteContext *codeCompleteContext=nullptr)
 This parses the file specified by the indicated SourceMgr and appends parsed operations to the given block. More...
 
Attribute parseAttribute (llvm::StringRef attrStr, MLIRContext *context, Type type={}, size_t *numRead=nullptr, bool isKnownNullTerminated=false)
 This parses a single MLIR attribute to an MLIR context if it was valid. More...
 
Type parseType (llvm::StringRef typeStr, MLIRContext *context, size_t *numRead=nullptr, bool isKnownNullTerminated=false)
 This parses a single MLIR type to an MLIR context if it was valid. More...
 
AffineMap parseAffineMap (llvm::StringRef str, MLIRContext *context)
 This parses a single IntegerSet/AffineMap to an MLIR context if it was valid. More...
 
IntegerSet parseIntegerSet (llvm::StringRef str, MLIRContext *context)
 
template<typename T , typename... Ts>
static LogicalResult readResourceHandle (DialectBytecodeReader &reader, FailureOr< T > &value, Ts &&...params)
 Helper for resource handle reading that returns LogicalResult. More...
 
template<typename T , typename... Ts>
auto get (MLIRContext *context, Ts &&...params)
 Helper method that injects context only if needed, this helps unify some of the attribute construction methods. More...
 
bool isBytecode (llvm::MemoryBufferRef buffer)
 Returns true if the given buffer starts with the magic bytes that signal MLIR bytecode. More...
 
LogicalResult readBytecodeFile (llvm::MemoryBufferRef buffer, Block *block, const ParserConfig &config)
 Read the operations defined within the given memory buffer, containing MLIR bytecode, into the provided block. More...
 
LogicalResult readBytecodeFile (const std::shared_ptr< llvm::SourceMgr > &sourceMgr, Block *block, const ParserConfig &config)
 An overload with a source manager whose main file buffer is used for parsing. More...
 
LogicalResult writeBytecodeToFile (Operation *op, raw_ostream &os, const BytecodeWriterConfig &config={})
 Write the bytecode for the given operation to the provided output stream. More...
 
void populateAffineToStdConversionPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to convert from the Affine dialect to the Standard dialect, in particular convert structured affine control flow into CFG branch-based control flow. More...
 
void populateAffineToVectorConversionPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to convert vector-related Affine ops to the Vector dialect. More...
 
Value lowerAffineLowerBound (affine::AffineForOp op, OpBuilder &builder)
 Emit code that computes the lower bound of the given affine loop using standard arithmetic operations. More...
 
Value lowerAffineUpperBound (affine::AffineForOp op, OpBuilder &builder)
 Emit code that computes the upper bound of the given affine loop using standard arithmetic operations. More...
 
std::unique_ptr< PasscreateLowerAffinePass ()
 Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp) to equivalent lower-level constructs (flow of basic blocks and arithmetic primitives). More...
 
void populateAMDGPUToROCDLConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, amdgpu::Chipset chipset)
 Note: The ROCDL target does not support the LLVM bfloat type at this time and so this function will add conversions to change all bfloat uses to i16. More...
 
std::unique_ptr< PasscreateConvertAMDGPUToROCDLPass ()
 
void populateArithToEmitCPatterns (TypeConverter &typeConverter, RewritePatternSet &patterns)
 
void populateConvertArmNeon2dToIntrPatterns (RewritePatternSet &patterns)
 Populates patterns for the lowering of Arm NEON 2D ops to intrinsics. More...
 
std::unique_ptr< PasscreateConvertArmNeon2dToIntrPass ()
 Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e. More...
 
std::unique_ptr< PasscreateConvertArmSMEToLLVMPass (bool dumpTileLiveRanges=false)
 Create a pass to convert from the ArmSME dialect to LLVM intrinsics. More...
 
void configureArmSMEToLLVMConversionLegality (ConversionTarget &target)
 Configure target to convert from the ArmSME dialect to LLVM intrinsics. More...
 
void populateArmSMEToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Populate the given list with patterns that convert from the ArmSME dialect to LLVM intrinsics. More...
 
void populateArmSMEToSCFConversionPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to convert from the ArmSME dialect to SCF. More...
 
std::unique_ptr< PasscreateConvertArmSMEToSCFPass ()
 Create a pass to convert a subset of ArmSME ops to SCF. More...
 
void populateAsyncStructuralTypeConversionsAndLegality (TypeConverter &typeConverter, RewritePatternSet &patterns, ConversionTarget &target)
 Populates patterns for async structural type conversions. More...
 
std::unique_ptr< PasscreateBufferizationToMemRefPass ()
 
void populateComplexToLibmConversionPatterns (RewritePatternSet &patterns, PatternBenefit benefit)
 Populate the given list with patterns that convert from Complex to Libm calls. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertComplexToLibmPass ()
 Create a pass to convert Complex operations to libm calls. More...
 
void populateComplexToLLVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Populate the given list with patterns that convert from Complex to LLVM. More...
 
void registerConvertComplexToLLVMInterface (DialectRegistry &registry)
 
void populateComplexToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating Complex ops to SPIR-V ops. More...
 
void populateComplexToStandardConversionPatterns (RewritePatternSet &patterns)
 Populate the given list with patterns that convert from Complex to Standard. More...
 
std::unique_ptr< PasscreateConvertComplexToStandardPass ()
 Create a pass to convert Complex operations to the Standard dialect. More...
 
std::unique_ptr< OperationPass<> > createConvertControlFlowToSPIRVPass ()
 Creates a pass to convert ControlFlow ops to SPIR-V ops. More...
 
void populateConversionTargetFromOperation (Operation *op, ConversionTarget &target, LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
 Recursively walk the IR and collect all dialects implementing the interface, and populate the conversion patterns. More...
 
void populateOpConvertToLLVMConversionPatterns (Operation *op, ConversionTarget &target, LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
 Helper function for populating LLVM conversion patterns. More...
 
std::unique_ptr< PasscreateConvertToLLVMPass ()
 Create a pass that performs dialect conversion to LLVM for all dialects implementing ConvertToLLVMPatternInterface. More...
 
void registerConvertToLLVMDependentDialectLoading (DialectRegistry &registry)
 Register the extension that will load dependent dialects for LLVM conversion. More...
 
void populateFuncToEmitCPatterns (RewritePatternSet &patterns)
 
FailureOr< LLVM::LLVMFuncOp > convertFuncOpToLLVMFuncOp (FunctionOpInterface funcOp, ConversionPatternRewriter &rewriter, const LLVMTypeConverter &converter)
 Convert input FunctionOpInterface operation to LLVMFuncOp by using the provided LLVMTypeConverter. More...
 
void populateFuncToLLVMFuncOpConversionPattern (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect the default pattern to convert a FuncOp to the LLVM dialect. More...
 
void populateFuncToLLVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, const SymbolTable *symbolTable=nullptr)
 Collect the patterns to convert from the Func dialect to LLVM. More...
 
void registerConvertFuncToLLVMInterface (DialectRegistry &registry)
 
void populateFuncToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating Func ops to SPIR-V ops. More...
 
std::unique_ptr< OperationPass<> > createConvertFuncToSPIRVPass ()
 Creates a pass to convert Func ops to SPIR-V ops. More...
 
spirv::StorageClass addressSpaceToStorageClass (gpu::AddressSpace addressSpace)
 
void populateGpuToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns, bool kernelBarePtrCallConv=false)
 Collect a set of patterns to convert from the GPU dialect to LLVM and populate converter for gpu types. More...
 
void populateGpuMemorySpaceAttributeConversions (TypeConverter &typeConverter, const MemorySpaceMapping &mapping)
 Populates memory space attribute conversion rules for lowering gpu.address_space to integer values. More...
 
void populateGpuToLLVMSPVConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 
void populateGpuMemorySpaceAttributeConversions (TypeConverter &typeConverter)
 Populates memory space attribute conversion rules for lowering gpu.address_space to integer values. More...
 
LLVM::LLVMStructType convertMMAToLLVMType (gpu::MMAMatrixType type)
 Return the LLVMStructureType corresponding to the MMAMatrixType type. More...
 
void configureGpuToNVVMConversionLegality (ConversionTarget &target)
 Configure target to convert from the GPU dialect to NVVM. More...
 
void configureGpuToNVVMTypeConverter (LLVMTypeConverter &converter)
 Configure the LLVM type convert to convert types and address spaces from the GPU dialect to NVVM. More...
 
void populateGpuToNVVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to convert from the GPU dialect to NVVM. More...
 
void populateGpuSubgroupReduceOpLoweringPattern (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Populate GpuSubgroupReduce pattern to NVVM. More...
 
void populateGpuWMMAToNVVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM. More...
 
void populateGpuToROCDLConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, gpu::amd::Runtime runtime)
 Collect a set of patterns to convert from the GPU dialect to ROCDL. More...
 
void configureGpuToROCDLConversionLegality (ConversionTarget &target)
 Configure target to convert from the GPU dialect to ROCDL. More...
 
std::unique_ptr< OperationPass< gpu::GPUModuleOp > > createLowerGpuOpsToROCDLOpsPass (const std::string &chipset="gfx900", unsigned indexBitwidth=kDeriveIndexBitwidthFromDataLayout, bool useBarePtrCallConv=false, gpu::amd::Runtime runtime=gpu::amd::Runtime::Unknown)
 Creates a pass that lowers GPU dialect operations to ROCDL counterparts. More...
 
void populateGPUToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating GPU Ops to SPIR-V ops. More...
 
void populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Collect a set of patterns to convert WMMA ops from GPU dialect to SPIRV, using the KHR Cooperative Matrix extension. More...
 
void populateMMAToSPIRVCoopMatrixTypeConversion (SPIRVTypeConverter &typeConverter)
 Adds MMAMatrixType conversions to SPIR-V cooperative matrix KHR type conversion to the type converter. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertGPUToSPIRVPass (bool mapMemorySpace=true)
 Creates a pass to convert GPU kernel ops to corresponding SPIR-V ops. More...
 
std::unique_ptr< OperationPass< mlir::ModuleOp > > createConvertGpuLaunchFuncToVulkanLaunchFuncPass ()
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertLinalgToStandardPass ()
 Create a pass to convert Linalg operations to the Standard dialect. More...
 
LogicalResult structFuncArgTypeConverter (const LLVMTypeConverter &converter, Type type, SmallVectorImpl< Type > &result)
 Callback to convert function argument types. More...
 
LogicalResult barePtrFuncArgTypeConverter (const LLVMTypeConverter &converter, Type type, SmallVectorImpl< Type > &result)
 Callback to convert function argument types. More...
 
void populateMathToLibmConversionPatterns (RewritePatternSet &patterns)
 Populate the given list with patterns that convert from Math to Libm calls. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertMathToLibmPass ()
 Create a pass to convert Math operations to libm calls. More...
 
void populateMathToLLVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, bool approximateLog1p=true)
 
void registerConvertMathToLLVMInterface (DialectRegistry &registry)
 
void populateMathToROCDLConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Populate the given list with patterns that convert from Math to ROCDL calls. More...
 
void populateMathToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating Math ops to SPIR-V ops. More...
 
std::unique_ptr< OperationPass<> > createConvertMathToSPIRVPass ()
 Creates a pass to convert Math ops to SPIR-V ops. More...
 
void populateMemRefToEmitCTypeConversion (TypeConverter &typeConverter)
 
void populateMemRefToEmitCConversionPatterns (RewritePatternSet &patterns, const TypeConverter &converter)
 
void populateFinalizeMemRefToLLVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to convert memory-related operations from the MemRef dialect to the LLVM dialect. More...
 
void registerConvertMemRefToLLVMInterface (DialectRegistry &registry)
 
void populateMemRefToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating MemRef ops to SPIR-V ops. More...
 
std::unique_ptr< OperationPass<> > createMapMemRefStorageClassPass ()
 Creates a pass to map numeric MemRef memory spaces to symbolic SPIR-V storage classes. More...
 
std::unique_ptr< OperationPass<> > createConvertMemRefToSPIRVPass ()
 Creates a pass to convert MemRef ops to SPIR-V ops. More...
 
std::unique_ptr<::mlir::PasscreateConvertMeshToMPIPass ()
 Lowers Mesh communication operations (updateHalo, AllGater, ...) to MPI primitives. More...
 
void populateNVGPUToNVVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 
void populateNVVMToLLVMConversionPatterns (RewritePatternSet &patterns)
 
void registerConvertNVVMToLLVMInterface (DialectRegistry &registry)
 
void populateOpenACCToSCFConversionPatterns (RewritePatternSet &patterns)
 Collect the patterns to convert from the OpenACC dialect to OpenACC with SCF dialect. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertOpenACCToSCFPass ()
 Create a pass to convert the OpenACC dialect into the LLVMIR dialect. More...
 
void configureOpenMPToLLVMConversionLegality (ConversionTarget &target, const LLVMTypeConverter &typeConverter)
 Configure dynamic conversion legality of regionless operations from OpenMP to LLVM. More...
 
void populateOpenMPToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Populate the given list with patterns that convert from OpenMP to LLVM. More...
 
void registerConvertOpenMPToLLVMInterface (DialectRegistry &registry)
 Registers the ConvertToLLVMPatternInterface interface in the OpenMP dialect. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createPDLToPDLInterpPass ()
 Creates and returns a pass to convert PDL ops to PDL interpreter ops. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createPDLToPDLInterpPass (DenseMap< Operation *, PDLPatternConfigSet * > &configMap)
 Creates and returns a pass to convert PDL ops to PDL interpreter ops. More...
 
std::unique_ptr< PasscreateReconcileUnrealizedCastsPass ()
 Creates a pass that eliminates noop unrealized_conversion_cast operation sequences. More...
 
void populateSCFToControlFlowConversionPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to convert SCF operations to CFG branch-based operations within the ControlFlow dialect. More...
 
std::unique_ptr< PasscreateConvertSCFToCFPass ()
 Creates a pass to convert SCF operations to CFG branch-based operation in the ControlFlow dialect. More...
 
void populateSCFToEmitCConversionPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to convert SCF operations to the EmitC dialect. More...
 
LogicalResult convertAffineLoopNestToGPULaunch (affine::AffineForOp forOp, unsigned numBlockDims, unsigned numThreadDims)
 Convert a perfect affine loop nest with the outermost loop identified by forOp into a gpu::Launch operation. More...
 
void populateParallelLoopToGPUPatterns (RewritePatternSet &patterns)
 Adds the conversion pattern from scf.parallel to gpu.launch to the provided pattern list. More...
 
void configureParallelLoopToGPULegality (ConversionTarget &target)
 Configures the rewrite target such that only scf.parallel operations that are not rewritten by the provided patterns are legal. More...
 
void finalizeParallelLoopToGPUConversion (Operation *op)
 Clean up after applyPartialConversion/applyFullConversion call. More...
 
std::unique_ptr< InterfacePass< FunctionOpInterface > > createAffineForToGPUPass (unsigned numBlockDims, unsigned numThreadDims)
 Create a pass that converts loop nests into GPU kernels. More...
 
std::unique_ptr< InterfacePass< FunctionOpInterface > > createAffineForToGPUPass ()
 
std::unique_ptr< PasscreateParallelLoopToGpuPass ()
 Creates a pass that converts scf.parallel operations into a gpu.launch operation. More...
 
void populateSCFToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, ScfToSPIRVContext &scfToSPIRVContext, RewritePatternSet &patterns)
 Collects a set of patterns to lower from scf.for, scf.if, and loop.terminator to CFG operations within the SPIR-V dialect. More...
 
std::unique_ptr< OperationPass<> > createConvertSCFToSPIRVPass ()
 Creates a pass to convert SCF ops into SPIR-V ops. More...
 
void populateShapeToStandardConversionPatterns (RewritePatternSet &patterns)
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertShapeToStandardPass ()
 
void populateConvertShapeConstraintsConversionPatterns (RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateConvertShapeConstraintsPass ()
 
unsigned storageClassToAddressSpace (spirv::ClientAPI clientAPI, spirv::StorageClass storageClass)
 
void encodeBindAttribute (ModuleOp module)
 Encodes global variable's descriptor set and binding into its name if they both exist. More...
 
void populateSPIRVToLLVMTypeConversion (LLVMTypeConverter &typeConverter, spirv::ClientAPI clientAPIForAddressSpaceMapping=spirv::ClientAPI::Unknown)
 Populates type conversions with additional SPIR-V types. More...
 
void populateSPIRVToLLVMConversionPatterns (const LLVMTypeConverter &typeConverter, RewritePatternSet &patterns, spirv::ClientAPI clientAPIForAddressSpaceMapping=spirv::ClientAPI::Unknown)
 Populates the given list with patterns that convert from SPIR-V to LLVM. More...
 
void populateSPIRVToLLVMFunctionConversionPatterns (const LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
 Populates the given list with patterns for function conversion from SPIR-V to LLVM. More...
 
void populateSPIRVToLLVMModuleConversionPatterns (const LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
 Populates the given patterns for module conversion from SPIR-V to LLVM. More...
 
void populateTensorToLinalgPatterns (RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating tensor ops to Linalg ops. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createConvertTensorToLinalgPass ()
 Creates a pass to convert Tensor ops to Linalg ops. More...
 
void populateTensorToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, int64_t byteCountThreshold, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating tensor ops to SPIR-V ops. More...
 
std::unique_ptr< OperationPass<> > createConvertTensorToSPIRVPass ()
 Creates a pass to convert Tensor ops to SPIR-V ops. More...
 
void populateVectorToArmSMEPatterns (RewritePatternSet &patterns, MLIRContext &ctx)
 Collect a set of patterns to lower Vector ops to ArmSME ops that map to LLVM intrinsics. More...
 
std::unique_ptr< PasscreateConvertVectorToArmSMEPass ()
 Create a pass to lower operations from the vector dialect to Arm SME. More...
 
void populatePrepareVectorToMMAPatterns (RewritePatternSet &patterns, bool useNvGpu=false)
 Patterns to transform vector ops into a canonical form to convert to MMA matrix operations. More...
 
LogicalResult convertVectorToMMAOps (RewriterBase &rewriter, Operation *rootOp)
 Convert vector ops to MMA matrix operations nested under rootOp. More...
 
LogicalResult convertVectorToNVVMCompatibleMMASync (RewriterBase &rewriter, Operation *rootOp)
 Convert vector ops ops nested under rootOp to vector and GPU operaitons compatible with the nvvm.mma.sync lowering path. More...
 
std::unique_ptr< PasscreateConvertVectorToGPUPass (bool useNvGpu=false)
 Convert from vector to GPU ops. More...
 
void populateVectorToLLVMMatrixConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to convert from Vector contractions to LLVM Matrix Intrinsics. More...
 
void populateVectorToLLVMConversionPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, bool reassociateFPReductions=false, bool force32BitVectorIndices=false)
 Collect a set of patterns to convert from the Vector dialect to LLVM. More...
 
void populateVectorToSCFConversionPatterns (RewritePatternSet &patterns, const VectorTransferToSCFOptions &options=VectorTransferToSCFOptions())
 Collect a set of patterns to convert from the Vector dialect to SCF + func. More...
 
std::unique_ptr< PasscreateConvertVectorToSCFPass (const VectorTransferToSCFOptions &options=VectorTransferToSCFOptions())
 Create a pass to convert a subset of vector ops to SCF. More...
 
void populateVectorToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating Vector Ops to SPIR-V ops. More...
 
void populateVectorReductionToSPIRVDotProductPatterns (RewritePatternSet &patterns)
 Appends patterns to convert vector reduction of the form: More...
 
std::unique_ptr< OperationPass<> > createConvertVectorToSPIRVPass ()
 Creates a pass to convert Vector Ops to SPIR-V ops. More...
 
void populateVectorToXeGPUConversionPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to convert from the vector to XeGPU ops. More...
 
std::unique_ptr< PasscreateConvertVectorToXeGPUPass ()
 Create a pass to convert ops from vector to XeGPU. More...
 
void setupDebuggerExecutionContextHook (tracing::ExecutionContext &executionContext)
 
void populateAMXLegalizeForLLVMExportPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to lower AMX ops to ops that map to LLVM intrinsics. More...
 
void configureAMXLegalizeForExportTarget (LLVMConversionTarget &target)
 Configure the target to support lowering AMX ops to ops that map to LLVM intrinsics. More...
 
void registerConvertAMXToLLVMInterface (DialectRegistry &registry)
 Register LLVM conversion interface for AMX dialect. More...
 
std::optional< SmallVector< OpFoldResult > > inferExpandShapeOutputShape (OpBuilder &b, Location loc, ShapedType expandedType, ArrayRef< ReassociationIndices > reassociation, ArrayRef< OpFoldResult > inputShape)
 Infer the output shape for a {memref|tensor}.expand_shape when it is possible to do so. More...
 
detail::op_matcher< arith::ConstantIndexOpmatchConstantIndex ()
 Matches a ConstantIndexOp. More...
 
llvm::SmallBitVector getPositionsOfShapeOne (unsigned rank, ArrayRef< int64_t > shape)
 
Value getValueOrCreateConstantIntOp (OpBuilder &b, Location loc, OpFoldResult ofr)
 Converts an OpFoldResult to a Value. More...
 
Value getValueOrCreateConstantIndexOp (OpBuilder &b, Location loc, OpFoldResult ofr)
 Converts an OpFoldResult to a Value. More...
 
SmallVector< ValuegetValueOrCreateConstantIndexOp (OpBuilder &b, Location loc, ArrayRef< OpFoldResult > valueOrAttrVec)
 Similar to the other overload, but converts multiple OpFoldResults into Values. More...
 
Value getValueOrCreateCastToIndexLike (OpBuilder &b, Location loc, Type targetType, Value value)
 Create a cast from an index-like value (index or integer) to another index-like value. More...
 
Value convertScalarToDtype (OpBuilder &b, Location loc, Value operand, Type toType, bool isUnsignedCast)
 Converts a scalar value operand to type toType. More...
 
Value createScalarOrSplatConstant (OpBuilder &builder, Location loc, Type type, const APInt &value)
 Create a constant of type type at location loc whose value is value (an APInt or APFloat whose type must match the element type of type). More...
 
Value createScalarOrSplatConstant (OpBuilder &builder, Location loc, Type type, int64_t value)
 
Value createScalarOrSplatConstant (OpBuilder &builder, Location loc, Type type, const APFloat &value)
 
Type getType (OpFoldResult ofr)
 Returns the int type of the integer in ofr. More...
 
void populateArmSVELegalizeForLLVMExportPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to lower ArmSVE ops to ops that map to LLVM intrinsics. More...
 
void configureArmSVELegalizeForExportTarget (LLVMConversionTarget &target)
 Configure the target to support lowering ArmSVE ops to ops that map to LLVM intrinsics. More...
 
std::unique_ptr< PasscreateAsyncParallelForPass ()
 
std::unique_ptr< PasscreateAsyncParallelForPass (bool asyncDispatch, int32_t numWorkerThreads, int32_t minTaskSize)
 
void populateAsyncFuncToAsyncRuntimeConversionPatterns (RewritePatternSet &patterns, ConversionTarget &target)
 
std::unique_ptr< OperationPass< ModuleOp > > createAsyncFuncToAsyncRuntimePass ()
 
std::unique_ptr< OperationPass< ModuleOp > > createAsyncToAsyncRuntimePass ()
 
std::unique_ptr< PasscreateAsyncRuntimeRefCountingPass ()
 
std::unique_ptr< PasscreateAsyncRuntimeRefCountingOptPass ()
 
std::unique_ptr< PasscreateAsyncRuntimePolicyBasedRefCountingPass ()
 
template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref< std::optional<ElementValueT>(ElementValueT, ElementValueT)>>
Attribute constFoldBinaryOpConditional (ArrayRef< Attribute > operands, Type resultType, CalculationT &&calculate)
 Performs constant folding calculate with element-wise behavior on the two attributes in operands and returns the result if possible. More...
 
template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref< std::optional<ElementValueT>(ElementValueT, ElementValueT)>>
Attribute constFoldBinaryOpConditional (ArrayRef< Attribute > operands, CalculationT &&calculate)
 Performs constant folding calculate with element-wise behavior on the two attributes in operands and returns the result if possible. More...
 
template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = void, class CalculationT = function_ref<ElementValueT(ElementValueT, ElementValueT)>>
Attribute constFoldBinaryOp (ArrayRef< Attribute > operands, Type resultType, CalculationT &&calculate)
 
template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<ElementValueT(ElementValueT, ElementValueT)>>
Attribute constFoldBinaryOp (ArrayRef< Attribute > operands, CalculationT &&calculate)
 
template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<std::optional<ElementValueT>(ElementValueT)>>
Attribute constFoldUnaryOpConditional (ArrayRef< Attribute > operands, CalculationT &&calculate)
 Performs constant folding calculate with element-wise behavior on the one attributes in operands and returns the result if possible. More...
 
template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<ElementValueT(ElementValueT)>>
Attribute constFoldUnaryOp (ArrayRef< Attribute > operands, CalculationT &&calculate)
 
template<class AttrElementT , class TargetAttrElementT , class ElementValueT = typename AttrElementT::ValueType, class TargetElementValueT = typename TargetAttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<TargetElementValueT(ElementValueT, bool)>>
Attribute constFoldCastOp (ArrayRef< Attribute > operands, Type resType, CalculationT &&calculate)
 
void populateEmitCSizeTTypeConversions (TypeConverter &converter)
 
void populateCallOpTypeConversionPattern (RewritePatternSet &patterns, const TypeConverter &converter)
 Add a pattern to the given pattern list to convert the operand and result types of a CallOp with the given type converter. More...
 
void populateBranchOpInterfaceTypeConversionPattern (RewritePatternSet &patterns, const TypeConverter &converter, function_ref< bool(BranchOpInterface branchOp, int idx)> shouldConvertBranchOperand=nullptr)
 Add a pattern to the given pattern list to rewrite branch operations to use operands that have been legalized by the conversion framework. More...
 
bool isLegalForBranchOpInterfaceTypeConversionPattern (Operation *op, const TypeConverter &converter)
 Return true if op is a BranchOpInterface op whose operands are all legal according to converter. More...
 
void populateReturnOpTypeConversionPattern (RewritePatternSet &patterns, const TypeConverter &converter)
 Add a pattern to the given pattern list to rewrite return ops to use operands that have been legalized by the conversion framework. More...
 
bool isLegalForReturnOpTypeConversionPattern (Operation *op, const TypeConverter &converter, bool returnOpAlwaysLegal=false)
 For ReturnLike ops (except return), return True. More...
 
bool isNotBranchOpInterfaceOrReturnLikeOp (Operation *op)
 Return true if op is neither BranchOpInterface nor ReturnLike. More...
 
void populateFuncTypeConversionPatterns (const TypeConverter &typeConverter, RewritePatternSet &patterns)
 
void promoteToWorkgroupMemory (gpu::GPUFuncOp op, unsigned arg)
 Promotes a function argument to workgroup memory in the given function. More...
 
std::unique_ptr< PasscreateGpuLauchSinkIndexComputationsPass ()
 Pass that moves ops which are likely an index computation into gpu.launch body. More...
 
std::unique_ptr< OperationPass< ModuleOp > > createGpuKernelOutliningPass (StringRef dataLayoutStr=StringRef())
 Replaces gpu.launch with gpu.launch_func by moving the region into a separate kernel function. More...
 
std::unique_ptr< OperationPass< func::FuncOp > > createGpuAsyncRegionPass ()
 Rewrites a function region so that GPU ops execute asynchronously. More...
 
std::unique_ptr< OperationPass< func::FuncOp > > createGpuMapParallelLoopsPass ()
 Maps the parallel loops found in the given function to workgroups. More...
 
void populateGpuGlobalIdPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to rewrite GlobalIdOp op within the GPU dialect. More...
 
void populateGpuShufflePatterns (RewritePatternSet &patterns)
 Collect a set of patterns to rewrite shuffle ops within the GPU dialect. More...
 
void populateGpuAllReducePatterns (RewritePatternSet &patterns)
 Collect a set of patterns to rewrite all-reduce ops within the GPU dialect. More...
 
void populateGpuBreakDownSubgroupReducePatterns (RewritePatternSet &patterns, unsigned maxShuffleBitwidth=32, PatternBenefit benefit=1)
 Collect a set of patterns to break down subgroup_reduce ops into smaller ones supported by the target of size <= maxShuffleBitwidth, where size is the subgroup_reduce value bitwidth. More...
 
void populateGpuLowerSubgroupReduceToShufflePatterns (RewritePatternSet &patterns, unsigned subgroupSize, unsigned shuffleBitwidth=32, PatternBenefit benefit=1)
 Collect a set of patterns to lower gpu.subgroup_reduce into gpu.shuffle ops over shuffleBitwidth scalar types. More...
 
void populateGpuLowerClusteredSubgroupReduceToShufflePatterns (RewritePatternSet &patterns, unsigned subgroupSize, unsigned shuffleBitwidth=32, PatternBenefit benefit=1)
 Disjoint counterpart of populateGpuLowerSubgroupReduceToShufflePatterns that only matches gpu.subgroup_reduce ops with a cluster_size. More...
 
void populateGpuRewritePatterns (RewritePatternSet &patterns)
 Collect all patterns to rewrite ops within the GPU dialect. More...
 
void populateGpuDecomposeMemrefsPatterns (RewritePatternSet &patterns)
 Collect a set of patterns to decompose memrefs ops. More...
 
std::unique_ptr< PasscreateGpuDecomposeMemrefsPass ()
 Pass decomposes memref ops inside gpu.launch body. More...
 
void populateGpuEliminateBarriersPatterns (RewritePatternSet &patterns)
 Erase barriers that do not enforce conflicting memory side effects. More...
 
gpu::GPUFuncOp outlineKernelFunc (gpu::LaunchOp launchOp, StringRef kernelFnName, SmallVectorImpl< Value > &operands)
 Get a gpu.func created from outlining the region of a gpu.launch op with the given kernelFnName. More...
 
LogicalResult sinkOperationsIntoLaunchOp (gpu::LaunchOp launchOp, llvm::function_ref< bool(Operation *)> isSinkingBeneficiary)
 Sink operations into the launchOp to reduce the number of values that are used within the region of the operation, but defined outside of the region. More...
 
ParseResult parseSemiFunctionType (OpAsmParser &parser, Type &argumentType, Type &resultType, bool resultOptional=true)
 Parses a single non-function type or a function type with at least one argument. More...
 
ParseResult parseSemiFunctionType (OpAsmParser &parser, Type &argumentType, SmallVectorImpl< Type > &resultTypes)
 
void printSemiFunctionType (OpAsmPrinter &printer, Operation *op, Type argumentType, TypeRange resultType)
 Prints argument and result types in a syntax similar to that of FunctionType but allowing and requiring one to omit the parens around the argument type in absence of result types, and without the trailing -> (). More...
 
void printSemiFunctionType (OpAsmPrinter &printer, Operation *op, Type argumentType, Type resultType, bool resultOptional=true)
 
void populateExpandCtlzPattern (RewritePatternSet &patterns)
 
void populateExpandTanPattern (RewritePatternSet &patterns)
 
void populateExpandSinhPattern (RewritePatternSet &patterns)
 
void populateExpandCoshPattern (RewritePatternSet &patterns)
 
void populateExpandTanhPattern (RewritePatternSet &patterns)
 
void populateExpandAsinhPattern (RewritePatternSet &patterns)
 
void populateExpandAcoshPattern (RewritePatternSet &patterns)
 
void populateExpandAtanhPattern (RewritePatternSet &patterns)
 
void populateExpandFmaFPattern (RewritePatternSet &patterns)
 
void populateExpandFloorFPattern (RewritePatternSet &patterns)
 
void populateExpandCeilFPattern (RewritePatternSet &patterns)
 
void populateExpandExp2FPattern (RewritePatternSet &patterns)
 
void populateExpandPowFPattern (RewritePatternSet &patterns)
 
void populateExpandFPowIPattern (RewritePatternSet &patterns)
 
void populateExpandRoundFPattern (RewritePatternSet &patterns)
 
void populateExpandRoundEvenPattern (RewritePatternSet &patterns)
 
void populateExpandRsqrtPattern (RewritePatternSet &patterns)
 
void populateMathAlgebraicSimplificationPatterns (RewritePatternSet &patterns)
 
void populatePolynomialApproximateTanhPattern (RewritePatternSet &patterns)
 
void populatePolynomialApproximateErfPattern (RewritePatternSet &patterns)
 
void populateMathPolynomialApproximationPatterns (RewritePatternSet &patterns, const MathPolynomialApproximationOptions &options={})
 
void populateUpliftToFMAPatterns (RewritePatternSet &patterns)
 
raw_ostream & operator<< (raw_ostream &os, const Range &range)
 
SmallVector< Range, 8 > getOrCreateRanges (OffsetSizeAndStrideOpInterface op, OpBuilder &b, Location loc)
 Return the list of Range (i.e. More...
 
std::unique_ptr< PasscreateForLoopSpecializationPass ()
 Creates a pass that specializes for loop for unrolling and vectorization. More...
 
std::unique_ptr< PasscreateForLoopPeelingPass ()
 Creates a pass that peels for loops at their upper bounds for better vectorization. More...
 
std::unique_ptr< PasscreateSCFForLoopCanonicalizationPass ()
 Creates a pass that canonicalizes affine.min and affine.max operations inside of scf.for loops with known lower and upper bounds. More...
 
std::unique_ptr< PasscreateTestSCFParallelLoopCollapsingPass ()
 Creates a pass that transforms a single ParallelLoop over N induction variables into another ParallelLoop over less than N induction variables. More...
 
std::unique_ptr< PasscreateParallelLoopFusionPass ()
 Creates a loop fusion pass which fuses parallel loops. More...
 
std::unique_ptr< PasscreateParallelLoopSpecializationPass ()
 Creates a pass that specializes parallel loop for unrolling and vectorization. More...
 
std::unique_ptr< PasscreateParallelLoopTilingPass (llvm::ArrayRef< int64_t > tileSize={}, bool noMinMaxBounds=false)
 Creates a pass which tiles innermost parallel loops. More...
 
std::unique_ptr< PasscreateForLoopRangeFoldingPass ()
 Creates a pass which folds arith ops on induction variable into loop range. More...
 
std::unique_ptr< PasscreateForallToForLoopPass ()
 Creates a pass that converts SCF forall loops to SCF for loops. More...
 
std::unique_ptr< PasscreateForallToParallelLoopPass ()
 Creates a pass that converts SCF forall loops to SCF parallel loops. More...
 
std::unique_ptr< PasscreateForToWhileLoopPass ()
 
SmallVector< scf::ForOp > replaceLoopNestWithNewYields (RewriterBase &rewriter, MutableArrayRef< scf::ForOp > loopNest, ValueRange newIterOperands, const NewYieldValuesFn &newYieldValuesFn, bool replaceIterOperandsUsesInLoop=true)
 Update a perfectly nested loop nest to yield new values from the innermost loop and propagating it up through the loop nest. More...
 
FailureOr< func::FuncOp > outlineSingleBlockRegion (RewriterBase &rewriter, Location loc, Region &region, StringRef funcName, func::CallOp *callOp=nullptr)
 Outline a region with a single block into a new FuncOp. More...
 
LogicalResult outlineIfOp (RewriterBase &b, scf::IfOp ifOp, func::FuncOp *thenFn, StringRef thenFnName, func::FuncOp *elseFn, StringRef elseFnName)
 Outline the then and/or else regions of ifOp as follows: More...
 
bool getInnermostParallelLoops (Operation *rootOp, SmallVectorImpl< scf::ParallelOp > &result)
 Get a list of innermost parallel loops contained in rootOp. More...
 
std::optional< std::pair< AffineExpr, AffineExpr > > getSCFMinMaxExpr (Value value, SmallVectorImpl< Value > &dims, SmallVectorImpl< Value > &symbols, llvm::function_ref< bool(Operation *)> loopFilter=nullptr)
 Return the min/max expressions for value if it is an induction variable from scf.for or scf.parallel loop. More...
 
LogicalResult coalesceLoops (MutableArrayRef< scf::ForOp > loops)
 Replace a perfect nest of "for" loops with a single linearized loop. More...
 
LogicalResult coalesceLoops (RewriterBase &rewriter, MutableArrayRef< scf::ForOp >)
 
LogicalResult coalescePerfectlyNestedSCFForLoops (scf::ForOp op)
 Walk an affine.for to find a band to coalesce. More...
 
void collapseParallelLoops (RewriterBase &rewriter, scf::ParallelOp loops, ArrayRef< std::vector< unsigned >> combinedDimensions)
 Take the ParallelLoop and for each set of dimension indices, combine them into a single dimension. More...
 
FailureOr< UnrolledLoopInfoloopUnrollByFactor (scf::ForOp forOp, uint64_t unrollFactor, function_ref< void(unsigned, Operation *, OpBuilder)> annotateFn=nullptr)
 Unrolls this for operation by the specified unroll factor. More...
 
LogicalResult loopUnrollJamByFactor (scf::ForOp forOp, uint64_t unrollFactor)
 Unrolls and jams this scf.for operation by the specified unroll factor. More...
 
Range emitNormalizedLoopBounds (RewriterBase &rewriter, Location loc, OpFoldResult lb, OpFoldResult ub, OpFoldResult step)
 Materialize bounds and step of a zero-based and unit-step loop derived by normalizing the specified bounds and step. More...
 
void denormalizeInductionVariable (RewriterBase &rewriter, Location loc, Value normalizedIv, OpFoldResult origLb, OpFoldResult origStep)
 Get back the original induction variable values after loop normalization. More...
 
TileLoops extractFixedOuterLoops (scf::ForOp rootFOrOp, ArrayRef< int64_t > sizes)
 
SmallVector< Loops, 8 > tile (ArrayRef< scf::ForOp > forOps, ArrayRef< Value > sizes, ArrayRef< scf::ForOp > targets)
 Performs tiling fo imperfectly nested loops (with interchange) by strip-mining the forOps by sizes and sinking them, in their order of occurrence in forOps, under each of the targets. More...
 
Loops tile (ArrayRef< scf::ForOp > forOps, ArrayRef< Value > sizes, scf::ForOp target)
 Performs tiling (with interchange) by strip-mining the forOps by sizes and sinking them, in their order of occurrence in forOps, under target. More...
 
Loops tilePerfectlyNested (scf::ForOp rootForOp, ArrayRef< Value > sizes)
 Tile a nest of scf::ForOp loops rooted at rootForOp with the given (parametric) sizes. More...
 
void getPerfectlyNestedLoops (SmallVectorImpl< scf::ForOp > &nestedLoops, scf::ForOp root)
 Get perfectly nested sequence of loops starting at root of loop nest (the first op being another AffineFor, and the second op - a terminator). More...
 
scf::ForallOp fuseIndependentSiblingForallLoops (scf::ForallOp target, scf::ForallOp source, RewriterBase &rewriter)
 Given two scf.forall loops, target and source, fuses target into source. More...
 
scf::ForOp fuseIndependentSiblingForLoops (scf::ForOp target, scf::ForOp source, RewriterBase &rewriter)
 Given two scf.for loops, target and source, fuses target into source. More...
 
FailureOr< scf::ForallOp > normalizeForallOp (RewriterBase &rewriter, scf::ForallOp forallOp)
 Normalize an scf.forall operation. More...
 
std::unique_ptr< PasscreateShapeToShapeLowering ()
 Creates an instance of the ShapeToShapeLowering pass that legalizes Shape dialect to be convertible to Arith. More...
 
void populateShapeRewritePatterns (RewritePatternSet &patterns)
 Collects a set of patterns to rewrite ops within the Shape dialect. More...
 
void populateRemoveShapeConstraintsPatterns (RewritePatternSet &patterns)
 
std::unique_ptr< OperationPass< func::FuncOp > > createRemoveShapeConstraintsPass ()
 
std::unique_ptr< OperationPass< ModuleOp > > createOutlineShapeComputationPass ()
 Outline the shape computation part by adding shape.func and populate conrresponding mapping infomation into ShapeMappingAnalysis. More...
 
void populateSparseAssembler (RewritePatternSet &patterns, bool directOut)
 
std::unique_ptr< PasscreateSparseAssembler ()
 
std::unique_ptr< PasscreateSparseAssembler (bool directOut)
 
void populateSparseReinterpretMap (RewritePatternSet &patterns, ReinterpretMapScope scope)
 
std::unique_ptr< PasscreateSparseReinterpretMapPass ()
 
std::unique_ptr< PasscreateSparseReinterpretMapPass (ReinterpretMapScope scope)
 
void populatePreSparsificationRewriting (RewritePatternSet &patterns)
 
std::unique_ptr< PasscreatePreSparsificationRewritePass ()
 
void populateSparsificationPatterns (RewritePatternSet &patterns, const SparsificationOptions &options=SparsificationOptions())
 Sets up sparsification rewriting rules with the given options. More...
 
std::unique_ptr< PasscreateSparsificationPass ()
 
std::unique_ptr< PasscreateSparsificationPass (const SparsificationOptions &options)
 
void populateStageSparseOperationsPatterns (RewritePatternSet &patterns)
 Sets up StageSparseOperation rewriting rules. More...
 
std::unique_ptr< PasscreateStageSparseOperationsPass ()
 
void populateLowerSparseOpsToForeachPatterns (RewritePatternSet &patterns, bool enableRT, bool enableConvert)
 
std::unique_ptr< PasscreateLowerSparseOpsToForeachPass ()
 
std::unique_ptr< PasscreateLowerSparseOpsToForeachPass (bool enableRT, bool enableConvert)
 
void populateLowerForeachToSCFPatterns (RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateLowerForeachToSCFPass ()
 
void populateLowerSparseIterationToSCFPatterns (const TypeConverter &converter, RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateLowerSparseIterationToSCFPass ()
 
void populateSparseTensorConversionPatterns (const TypeConverter &typeConverter, RewritePatternSet &patterns)
 Sets up sparse tensor conversion rules. More...
 
std::unique_ptr< PasscreateSparseTensorConversionPass ()
 
void populateSparseTensorCodegenPatterns (const TypeConverter &typeConverter, RewritePatternSet &patterns, bool createSparseDeallocs, bool enableBufferInitialization)
 Sets up sparse tensor codegen rules. More...
 
std::unique_ptr< PasscreateSparseTensorCodegenPass ()
 
std::unique_ptr< PasscreateSparseTensorCodegenPass (bool createSparseDeallocs, bool enableBufferInitialization)
 
void populateSparseBufferRewriting (RewritePatternSet &patterns, bool enableBufferInitialization)
 
std::unique_ptr< PasscreateSparseBufferRewritePass ()
 
std::unique_ptr< PasscreateSparseBufferRewritePass (bool enableBufferInitialization)
 
void populateSparseVectorizationPatterns (RewritePatternSet &patterns, unsigned vectorLength, bool enableVLAVectorization, bool enableSIMDIndex32)
 Populates the given patterns list with vectorization rules. More...
 
std::unique_ptr< PasscreateSparseVectorizationPass ()
 
std::unique_ptr< PasscreateSparseVectorizationPass (unsigned vectorLength, bool enableVLAVectorization, bool enableSIMDIndex32)
 
void populateSparseGPUCodegenPatterns (RewritePatternSet &patterns, unsigned numThreads)
 
void populateSparseGPULibgenPatterns (RewritePatternSet &patterns, bool enableRT)
 
std::unique_ptr< PasscreateSparseGPUCodegenPass ()
 
std::unique_ptr< PasscreateSparseGPUCodegenPass (unsigned numThreads, bool enableRT)
 
void populateStorageSpecifierToLLVMPatterns (const TypeConverter &converter, RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateStorageSpecifierToLLVMPass ()
 
bufferization::OneShotBufferizationOptions getBufferizationOptionsForSparsification (bool analysisOnly)
 
std::unique_ptr< PasscreateSparsificationAndBufferizationPass ()
 
std::unique_ptr< PasscreateSparsificationAndBufferizationPass (const bufferization::OneShotBufferizationOptions &bufferizationOptions, const SparsificationOptions &sparsificationOptions, bool createSparseDeallocs, bool enableRuntimeLibrary, bool enableBufferInitialization, unsigned vectorLength, bool enableVLAVectorization, bool enableSIMDIndex32, bool enableGPULibgen, SparseEmitStrategy emitStrategy, SparseParallelizationStrategy parallelizationStrategy)
 
std::unique_ptr< PasscreateSparseSpaceCollapsePass ()
 
void populateBuiltinFuncToSPIRVPatterns (const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
 Appends to a pattern list additional patterns for translating the builtin func op to the SPIR-V dialect. More...
 
void populateFuncOpVectorRewritePatterns (RewritePatternSet &patterns)
 
void populateReturnOpVectorRewritePatterns (RewritePatternSet &patterns)
 
DiagnosedDefiniteFailure emitDefiniteFailure (Location loc, const Twine &message)
 Emits a definite failure with the given message. More...
 
DiagnosedDefiniteFailure emitDefiniteFailure (Operation *op, const Twine &message={})
 
DiagnosedSilenceableFailure emitSilenceableFailure (Location loc, const Twine &message={})
 Emits a silenceable failure with the given message. More...
 
DiagnosedSilenceableFailure emitSilenceableFailure (Operation *op, const Twine &message={})
 
SmallVector< int64_t > computeSuffixProduct (ArrayRef< int64_t > sizes)
 Given a set of sizes, return the suffix product. More...
 
SmallVector< int64_t > computeStrides (ArrayRef< int64_t > sizes)
 
SmallVector< int64_t > computeElementwiseMul (ArrayRef< int64_t > v1, ArrayRef< int64_t > v2)
 Return a vector containing llvm::zip_equal(v1, v2) multiplied elementwise. More...
 
int64_t computeSum (ArrayRef< int64_t > basis)
 Self-explicit. More...
 
int64_t computeProduct (ArrayRef< int64_t > basis)
 Self-explicit. More...
 
int64_t computeMaxLinearIndex (ArrayRef< int64_t > basis)
 Return the number of elements of basis (i.e. More...
 
int64_t linearize (ArrayRef< int64_t > offsets, ArrayRef< int64_t > basis)
 Return the linearized index of 'offsets' w.r.t. More...
 
SmallVector< int64_t > delinearize (int64_t linearIndex, ArrayRef< int64_t > strides)
 Given the strides together with a linear index in the dimension space, return the vector-space offsets in each dimension for a de-linearized index. More...
 
std::optional< SmallVector< int64_t > > computeShapeRatio (ArrayRef< int64_t > shape, ArrayRef< int64_t > subShape)
 Return the multi-dimensional integral ratio of subShape to the trailing dimensions of shape. More...
 
SmallVector< AffineExprcomputeSuffixProduct (ArrayRef< AffineExpr > sizes)
 Given a set of sizes, return the suffix product. More...
 
SmallVector< AffineExprcomputeStrides (ArrayRef< AffineExpr > sizes)
 
SmallVector< AffineExprcomputeElementwiseMul (ArrayRef< AffineExpr > v1, ArrayRef< AffineExpr > v2)
 Return a vector containing llvm::zip_equal(v1, v2) multiplied elementwise. More...
 
AffineExpr computeSum (MLIRContext *ctx, ArrayRef< AffineExpr > basis)
 Self-explicit. More...
 
AffineExpr computeProduct (MLIRContext *ctx, ArrayRef< AffineExpr > basis)
 Self-explicit. More...
 
AffineExpr computeMaxLinearIndex (MLIRContext *ctx, ArrayRef< AffineExpr > basis)
 Return the number of elements of basis (i.e. More...
 
AffineExpr linearize (MLIRContext *ctx, ArrayRef< AffineExpr > offsets, ArrayRef< AffineExpr > basis)
 Return the linearized index of 'offsets' w.r.t. More...
 
AffineExpr linearize (MLIRContext *ctx, ArrayRef< AffineExpr > offsets, ArrayRef< int64_t > basis)
 
SmallVector< AffineExprdelinearize (AffineExpr linearIndex, ArrayRef< AffineExpr > strides)
 Given the strides together with a linear index in the dimension space, return the vector-space offsets in each dimension for a de-linearized index. More...
 
SmallVector< AffineExprdelinearize (AffineExpr linearIndex, ArrayRef< int64_t > strides)
 
template<typename T >
SmallVector< T > applyPermutation (ArrayRef< T > input, ArrayRef< int64_t > permutation)
 
template<typename T >
SmallVector< T > applyPermutation (const SmallVectorImpl< T > &input, ArrayRef< int64_t > permutation)
 
template<typename T , unsigned N>
void applyPermutationToVector (SmallVector< T, N > &inVec, ArrayRef< int64_t > permutation)
 Apply the permutation defined by permutation to inVec. More...
 
SmallVector< int64_t > invertPermutationVector (ArrayRef< int64_t > permutation)
 Helper method to apply to inverse a permutation. More...
 
bool isIdentityPermutation (ArrayRef< int64_t > permutation)
 Returns true if permutation is an identity permutation. More...
 
bool isPermutationVector (ArrayRef< int64_t > interchange)
 Method to check if an interchange vector is a permutation. More...
 
SmallVector< int64_t > computePermutationVector (int64_t permSize, ArrayRef< int64_t > positions, ArrayRef< int64_t > desiredPositions)
 Return a permutation vector of size permSize that would result in moving positions into desiredPositions. More...
 
SmallVector< int64_t > dropDims (ArrayRef< int64_t > inputPerm, ArrayRef< int64_t > dropPositions)
 Returns a permutation vector that drop the input dims in dropPositions from inputPerm. More...
 
SmallVector< int64_t > getI64SubArray (ArrayAttr arrayAttr, unsigned dropFront=0, unsigned dropBack=0)
 Helper to return a subset of arrayAttr as a vector of int64_t. More...
 
std::pair< AffineExpr, SmallVector< OpFoldResult > > computeLinearIndex (OpFoldResult sourceOffset, ArrayRef< OpFoldResult > strides, ArrayRef< OpFoldResult > indices)
 Compute linear index from provided strides and indices, assuming strided layout. More...
 
std::pair< AffineExpr, SmallVector< OpFoldResult > > computeLinearIndex (OpFoldResult sourceOffset, ArrayRef< int64_t > strides, ArrayRef< Value > indices)
 
constexpr StringRef getReassociationAttrName ()
 Attribute name for the ArrayAttr which encodes reassociation indices. More...
 
std::optional< SmallVector< ReassociationIndices > > composeReassociationIndices (ArrayRef< ReassociationIndices > producerReassociations, ArrayRef< ReassociationIndices > consumerReassociations, MLIRContext *context)
 Compose reassociation maps that are used in pair of reshape ops where one is a producer and other is the consumer. More...
 
SmallVector< SmallVector< AffineExpr, 2 >, 2 > convertReassociationIndicesToExprs (MLIRContext *context, ArrayRef< ReassociationIndices > reassociationIndices)
 Convert reassociation indices to affine expressions. More...
 
SmallVector< AffineMap, 4 > getSymbolLessAffineMaps (ArrayRef< ReassociationExprs > reassociation)
 Constructs affine maps out of Array<Array<AffineExpr>>. More...
 
ArrayAttr getReassociationIndicesAttribute (OpBuilder &b, ArrayRef< ReassociationIndices > reassociation)
 Wraps a list of reassociations in an ArrayAttr. More...
 
SmallVector< ReassociationIndices, 2 > convertReassociationMapsToIndices (ArrayRef< ReassociationExprs > reassociationExprs)
 Convert Array<Array<AffineExpr>> to Array<Array<int64_t>>. More...
 
std::optional< SmallVector< ReassociationIndices > > getReassociationIndicesForReshape (ShapedType sourceType, ShapedType targetType)
 Return the reassociations maps to use to reshape given the source type and the target type when possible. More...
 
std::optional< SmallVector< ReassociationIndices > > getReassociationIndicesForCollapse (ArrayRef< int64_t > sourceShape, ArrayRef< int64_t > targetShape)
 Returns the reassociation maps to collapse sourceShape to targetShape if possible. More...
 
bool isReassociationValid (ArrayRef< AffineMap > reassociation, int *invalidIndex=nullptr)
 Return true if the reassociation specification is valid, false otherwise. More...
 
template<typename ReshapeOpTy , typename InverseReshapeOpTy >
static OpFoldResult foldReshapeOp (ReshapeOpTy reshapeOp, ArrayRef< Attribute > operands)
 
template<typename Op , typename T >
static LogicalResult verifyReshapeLikeTypes (Op op, T expandedType, T collapsedType, bool isExpansion)
 Common verifier for reshape-like types. More...
 
LogicalResult reshapeLikeShapesAreCompatible (function_ref< LogicalResult(const Twine &)> emitError, ArrayRef< int64_t > collapsedShape, ArrayRef< int64_t > expandedShape, ArrayRef< ReassociationIndices > reassociationMaps, bool isExpandingReshape)
 Verify that shapes of the reshaped types using following rule: if a dimension in the collapsed type is static, then the corresponding dimensions in the expanded shape should be a) static b) the product should be same as the collaped shape. More...
 
bool hasNonIdentityLayout (Type type)
 Returns true iff the type is a MemRefType and has a non-identity layout. More...
 
llvm::SmallBitVector getSlicedDimensions (ArrayRef< OpFoldResult > sliceInputShape, ArrayRef< Range > sliceParams)
 The input parameters offsets, sizes, strides specify a rectangular non rank-reducing slice of the collapse_shape output. More...
 
llvm::SmallBitVector getLinearizedDimensions (ArrayRef< ReassociationIndices > reassociationIndices)
 Determine which dimensions are linearized by a tensor.collapse_shape op by inspecting its reassociation indices. More...
 
bool isZeroIndex (OpFoldResult v)
 Return true if v is an IntegerAttr with value 0 of a ConstantIndexOp with attribute with value 0. More...
 
std::tuple< SmallVector< OpFoldResult >, SmallVector< OpFoldResult >, SmallVector< OpFoldResult > > getOffsetsSizesAndStrides (ArrayRef< Range > ranges)
 Given an array of Range values, return a tuple of (offset vector, sizes vector, and strides vector) formed by separating out the individual elements of each range. More...
 
void dispatchIndexOpFoldResult (OpFoldResult ofr, SmallVectorImpl< Value > &dynamicVec, SmallVectorImpl< int64_t > &staticVec)
 Helper function to dispatch an OpFoldResult into staticVec if: a) it is an IntegerAttr In other cases, the OpFoldResult is dispached to the dynamicVec. More...
 
void dispatchIndexOpFoldResults (ArrayRef< OpFoldResult > ofrs, SmallVectorImpl< Value > &dynamicVec, SmallVectorImpl< int64_t > &staticVec)
 Helper function to dispatch multiple OpFoldResults according to the behavior of dispatchIndexOpFoldResult(OpFoldResult ofr for a single OpFoldResult. More...
 
std::pair< int64_t, OpFoldResultgetSimplifiedOfrAndStaticSizePair (OpFoldResult ofr, Builder &b)
 Given OpFoldResult representing dim size value (*), generates a pair of sizes: More...
 
template<typename IntTy >
SmallVector< IntTy > extractFromIntegerArrayAttr (Attribute attr)
 Extract integer values from the assumed ArrayAttr of IntegerAttr. More...
 
OpFoldResult getAsOpFoldResult (Value val)
 Given a value, try to extract a constant Attribute. More...
 
SmallVector< OpFoldResultgetAsOpFoldResult (ValueRange values)
 Given an array of values, try to extract a constant Attribute from each value. More...
 
SmallVector< OpFoldResultgetAsOpFoldResult (ArrayAttr arrayAttr)
 Convert arrayAttr to a vector of OpFoldResult. More...
 
OpFoldResult getAsIndexOpFoldResult (MLIRContext *ctx, int64_t val)
 Convert int64_t to integer attributes of index type and return them as OpFoldResult. More...
 
SmallVector< OpFoldResultgetAsIndexOpFoldResult (MLIRContext *ctx, ArrayRef< int64_t > values)
 
std::optional< int64_t > getConstantIntValue (OpFoldResult ofr)
 If ofr is a constant integer or an IntegerAttr, return the integer. More...
 
std::optional< SmallVector< int64_t > > getConstantIntValues (ArrayRef< OpFoldResult > ofrs)
 If all ofrs are constant integers or IntegerAttrs, return the integers. More...
 
bool isConstantIntValue (OpFoldResult ofr, int64_t value)
 Return true if ofr is constant integer equal to value. More...
 
bool areAllConstantIntValue (ArrayRef< OpFoldResult > ofrs, int64_t value)
 Return true if all of ofrs are constant integers equal to value. More...
 
bool areConstantIntValues (ArrayRef< OpFoldResult > ofrs, ArrayRef< int64_t > values)
 Return true if all of ofrs are constant integers equal to the corresponding value in values. More...
 
bool isEqualConstantIntOrValue (OpFoldResult ofr1, OpFoldResult ofr2)
 Return true if ofr1 and ofr2 are the same integer constant attribute values or the same SSA value. More...
 
bool isEqualConstantIntOrValueArray (ArrayRef< OpFoldResult > ofrs1, ArrayRef< OpFoldResult > ofrs2)
 
SmallVector< OpFoldResultgetMixedValues (ArrayRef< int64_t > staticValues, ValueRange dynamicValues, Builder &b)
 Return a vector of OpFoldResults with the same size a staticValues, but all elements for which ShapedType::isDynamic is true, will be replaced by dynamicValues. More...
 
std::pair< SmallVector< int64_t >, SmallVector< Value > > decomposeMixedValues (const SmallVectorImpl< OpFoldResult > &mixedValues)
 Decompose a vector of mixed static or dynamic values into the corresponding pair of arrays. More...
 
SmallVector< ValuegetValuesSortedByKey (ArrayRef< Attribute > keys, ArrayRef< Value > values, llvm::function_ref< bool(Attribute, Attribute)> compare)
 Helper to sort values according to matching keys. More...
 
SmallVector< OpFoldResultgetValuesSortedByKey (ArrayRef< Attribute > keys, ArrayRef< OpFoldResult > values, llvm::function_ref< bool(Attribute, Attribute)> compare)
 
SmallVector< int64_t > getValuesSortedByKey (ArrayRef< Attribute > keys, ArrayRef< int64_t > values, llvm::function_ref< bool(Attribute, Attribute)> compare)
 
bool hasValidSizesOffsets (SmallVector< int64_t > sizesOrOffsets)
 Helper function to check whether the passed in sizes or offsets are valid. More...
 
bool hasValidStrides (SmallVector< int64_t > strides)
 Helper function to check whether the passed in strides are valid. More...
 
LogicalResult foldDynamicIndexList (SmallVectorImpl< OpFoldResult > &ofrs, bool onlyNonNegative=false, bool onlyNonZero=false)
 Returns "success" when any of the elements in ofrs is a constant value. More...
 
LogicalResult foldDynamicOffsetSizeList (SmallVectorImpl< OpFoldResult > &offsetsOrSizes)
 Returns "success" when any of the elements in offsetsOrSizes is a constant value. More...
 
LogicalResult foldDynamicStrideList (SmallVectorImpl< OpFoldResult > &strides)
 Returns "success" when any of the elements in strides is a constant value. More...
 
std::optional< int64_t > constantTripCount (OpFoldResult lb, OpFoldResult ub, OpFoldResult step)
 Return the number of iterations for a loop with a lower bound lb, upper bound ub and step step. More...
 
bool isRowMajorMatmul (ArrayAttr indexingMaps)
 Tests whether the given maps describe a row major matmul. More...
 
bool isColumnMajorMatmul (ArrayAttr indexingMaps)
 Tests whether the given maps describe a column major matmul. More...
 
bool isRowMajorBatchMatmul (ArrayAttr indexingMaps)
 Tests whether the given maps describe a row major batch matmul. More...
 
bool isVecmat (ArrayAttr indexingMaps)
 Tests whether the given maps describe a vector matrix multiplication. More...
 
bool isBatchVecmat (ArrayAttr indexingMaps)
 Tests whether the given maps describe a batch vector matrix multiplication. More...
 
bool isMatvec (ArrayAttr indexingMaps)
 Tests whether the given maps describe a matrix vector multiplication. More...
 
bool isBatchMatvec (ArrayAttr indexingMaps)
 Tests whether the given maps describe a batch matrix vector multiplication. More...
 
void findPositionsOfType (ArrayRef< utils::IteratorType > iteratorTypes, utils::IteratorType iteratorTypeName, SmallVectorImpl< unsigned > &res)
 Return positions in iteratorTypes that match iteratorTypeName. More...
 
Operationclone (OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands)
 
template<typename OpT >
OpT clone (OpBuilder &b, OpT op, TypeRange newResultTypes, ValueRange newOperands)
 
OperationcloneWithoutRegions (OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands)
 
SmallVector< NamedAttributegetPrunedAttributeList (Operation *op, ArrayRef< StringRef > elidedAttrs)
 
void populateX86VectorLegalizeForLLVMExportPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns)
 Collect a set of patterns to lower X86Vector ops to ops that map to LLVM intrinsics. More...
 
void configureX86VectorLegalizeForExportTarget (LLVMConversionTarget &target)
 Configure the target to support lowering X86Vector ops to ops that map to LLVM intrinsics. More...
 
int JitRunnerMain (int argc, char **argv, const DialectRegistry &registry, JitRunnerConfig config={})
 Entry point for all CPU runners. More...
 
std::function< llvm::Error(llvm::Module *)> makeOptimizingTransformer (unsigned optLevel, unsigned sizeLevel, llvm::TargetMachine *targetMachine)
 Create a module transformer function for MLIR ExecutionEngine that runs LLVM IR passes corresponding to the given speed and size optimization levels (e.g. More...
 
void registerAllDialects (DialectRegistry &registry)
 Add all the MLIR dialects to the provided registry. More...
 
void registerAllDialects (MLIRContext &context)
 Append all the MLIR dialects to the registry contained in the given context. More...
 
void registerAllExtensions (DialectRegistry &registry)
 This function may be called to register all MLIR dialect extensions with the provided registry. More...
 
void registerAllPasses ()
 
void registerFromLLVMIRTranslation ()
 
void registerFromSPIRVTranslation ()
 
void registerToCppTranslation ()
 
void registerToLLVMIRTranslation ()
 
void registerToSPIRVTranslation ()
 
void registerAllTranslations ()
 
bool operator!= (RegionBranchPoint lhs, RegionBranchPoint rhs)
 
bool insideMutuallyExclusiveRegions (Operation *a, Operation *b)
 Return true if a and b are in mutually exclusive regions as per RegionBranchOpInterface. More...
 
RegiongetEnclosingRepetitiveRegion (Operation *op)
 Return the first enclosing region of the given op that may be executed repetitively as per RegionBranchOpInterface or nullptr if no such region exists. More...
 
RegiongetEnclosingRepetitiveRegion (Value value)
 Return the first enclosing region of the given Value that may be executed repetitively as per RegionBranchOpInterface or nullptr if no such region exists. More...
 
raw_ostream & operator<< (raw_ostream &, const ConstantIntRanges &)
 
raw_ostream & operator<< (raw_ostream &, const IntegerValueRange &)
 
LogicalResult reifyResultShapes (OpBuilder &b, Operation *op, ReifiedRankedShapedTypeDims &reifiedReturnShapes)
 Reify the shape of the result of an operation (typically in terms of the shape of its operands). More...
 
template<typename EffectTy >
bool hasSingleEffect (Operation *op)
 Returns true if op has only an effect of type EffectTy. More...
 
template<typename EffectTy >
bool hasSingleEffect (Operation *op, Value value)
 Returns true if op has only an effect of type EffectTy (and of no other type) on value. More...
 
template<typename ValueTy , typename EffectTy >
bool hasSingleEffect (Operation *op, ValueTy value)
 Returns true if op has only an effect of type EffectTy (and of no other type) on value of type ValueTy. More...
 
template<typename... EffectTys>
bool hasEffect (Operation *op)
 Returns true if op has an effect of type EffectTy. More...
 
template<typename... EffectTys>
bool hasEffect (Operation *op, Value value)
 Returns true if op has an effect of type EffectTy on value. More...
 
template<typename ValueTy , typename... EffectTys>
bool hasEffect (Operation *op, ValueTy value)
 Returns true if op has an effect of type EffectTy on value of type ValueTy. More...
 
bool isOpTriviallyDead (Operation *op)
 Return true if the given operation is unused, and has no side effects on memory that prevent erasing. More...
 
bool wouldOpBeTriviallyDead (Operation *op)
 Return true if the given operation would be dead if unused, and has no side effects on memory that would prevent erasing. More...
 
bool isMemoryEffectFree (Operation *op)
 Returns true if the given operation is free of memory effects. More...
 
std::optional< llvm::SmallVector< MemoryEffects::EffectInstance > > getEffectsRecursively (Operation *rootOp)
 Returns the side effects of an operation. More...
 
bool isSpeculatable (Operation *op)
 Returns true if the given operation is speculatable, i.e. More...
 
bool isPure (Operation *op)
 Returns true if the given operation is pure, i.e., is speculatable that does not touch memory. More...
 
void printDynamicIndexList (OpAsmPrinter &printer, Operation *op, OperandRange values, ArrayRef< int64_t > integers, ArrayRef< bool > scalables, TypeRange valueTypes=TypeRange(), AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
 Printer hook for custom directive in assemblyFormat. More...
 
void printDynamicIndexList (OpAsmPrinter &printer, Operation *op, OperandRange values, ArrayRef< int64_t > integers, AsmParser::Delimiter delimiter)
 
void printDynamicIndexList (OpAsmPrinter &printer, Operation *op, OperandRange values, ArrayRef< int64_t > integers, TypeRange valueTypes=TypeRange(), AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
 
ParseResult parseDynamicIndexList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &values, DenseI64ArrayAttr &integers, DenseBoolArrayAttr &scalableVals, SmallVectorImpl< Type > *valueTypes=nullptr, AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
 Parser hook for custom directive in assemblyFormat. More...
 
ParseResult parseDynamicIndexList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &values, DenseI64ArrayAttr &integers, AsmParser::Delimiter delimiter)
 
ParseResult parseDynamicIndexList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &values, DenseI64ArrayAttr &integers, SmallVectorImpl< Type > *valueTypes=nullptr, AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
 
ParseResult parseDynamicIndexList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &values, DenseI64ArrayAttr &integers, SmallVectorImpl< Type > &valueTypes, AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
 
ParseResult parseDynamicIndexList (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &values, DenseI64ArrayAttr &integers, SmallVectorImpl< Type > &valueTypes, DenseBoolArrayAttr &scalableVals, AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
 
LogicalResult verifyListOfOperandsOrIntegers (Operation *op, StringRef name, unsigned expectedNumElements, ArrayRef< int64_t > attr, ValueRange values)
 Verify that a the values has as many elements as the number of entries in attr for which isDynamic evaluates to true. More...
 
inline ::llvm::hash_code hash_value (AffineExpr arg)
 Make AffineExpr hashable. More...
 
AffineExpr operator+ (int64_t val, AffineExpr expr)
 
AffineExpr operator* (int64_t val, AffineExpr expr)
 
AffineExpr operator- (int64_t val, AffineExpr expr)
 
AffineExpr getAffineDimExpr (unsigned position, MLIRContext *context)
 These free functions allow clients of the API to not use classes in detail. More...
 
AffineExpr getAffineSymbolExpr (unsigned position, MLIRContext *context)
 
AffineExpr getAffineConstantExpr (int64_t constant, MLIRContext *context)
 
SmallVector< AffineExprgetAffineConstantExprs (ArrayRef< int64_t > constants, MLIRContext *context)
 
AffineExpr getAffineBinaryOpExpr (AffineExprKind kind, AffineExpr lhs, AffineExpr rhs)
 
AffineExpr getAffineExprFromFlatForm (ArrayRef< int64_t > flatExprs, unsigned numDims, unsigned numSymbols, ArrayRef< AffineExpr > localExprs, MLIRContext *context)
 Constructs an affine expression from a flat ArrayRef. More...
 
raw_ostream & operator<< (raw_ostream &os, AffineExpr expr)
 
AffineExpr simplifyAffineExpr (AffineExpr expr, unsigned numDims, unsigned numSymbols)
 Simplify an affine expression by flattening and some amount of simple analysis. More...
 
template<typename... AffineExprTy>
void bindDims (MLIRContext *ctx, AffineExprTy &...exprs)
 Bind a list of AffineExpr references to DimExpr at positions: [0 . More...
 
template<typename AffineExprTy >
void bindDimsList (MLIRContext *ctx, MutableArrayRef< AffineExprTy > exprs)
 
template<typename... AffineExprTy>
void bindSymbols (MLIRContext *ctx, AffineExprTy &...exprs)
 Bind a list of AffineExpr references to SymbolExpr at positions: [0 . More...
 
template<typename AffineExprTy >
void bindSymbolsList (MLIRContext *ctx, MutableArrayRef< AffineExprTy > exprs)
 
std::optional< int64_t > getBoundForAffineExpr (AffineExpr expr, unsigned numDims, unsigned numSymbols, ArrayRef< std::optional< int64_t >> constLowerBounds, ArrayRef< std::optional< int64_t >> constUpperBounds, bool isUpper)
 Get a lower or upper (depending on isUpper) bound for expr while using the constant lower and upper bounds for its inputs provided in constLowerBounds and constUpperBounds. More...
 
inline ::llvm::hash_code hash_value (AffineMap arg)
 
AffineMap simplifyAffineMap (AffineMap map)
 Simplifies an affine map by simplifying its underlying AffineExpr results. More...
 
AffineMap compressDims (AffineMap map, const llvm::SmallBitVector &unusedDims)
 Drop the dims that are listed in unusedDims. More...
 
AffineMap compressUnusedDims (AffineMap map)
 Drop the dims that are not used. More...
 
SmallVector< AffineMapcompressUnusedDims (ArrayRef< AffineMap > maps)
 Drop the dims that are not used by any of the individual maps in maps. More...
 
AffineMap compressSymbols (AffineMap map, const llvm::SmallBitVector &unusedSymbols)
 Drop the symbols that are listed in unusedSymbols. More...
 
AffineMap compressUnusedSymbols (AffineMap map)
 Drop the symbols that are not used. More...
 
SmallVector< AffineMapcompressUnusedSymbols (ArrayRef< AffineMap > maps)
 Drop the symbols that are not used by any of the individual maps in maps. More...
 
AffineMap foldAttributesIntoMap (Builder &b, AffineMap map, ArrayRef< OpFoldResult > operands, SmallVector< Value > &remainingValues)
 Fold all attributes among the given operands into the affine map. More...
 
AffineMap removeDuplicateExprs (AffineMap map)
 Returns a map with the same dimension and symbol count as map, but whose results are the unique affine expressions of map. More...
 
AffineMap inversePermutation (AffineMap map)
 Returns a map of codomain to domain dimensions such that the first codomain dimension for a particular domain dimension is selected. More...
 
AffineMap inverseAndBroadcastProjectedPermutation (AffineMap map)
 Return the reverse map of a projected permutation where the projected dimensions are transformed into 0s. More...
 
AffineMap concatAffineMaps (ArrayRef< AffineMap > maps, MLIRContext *context)
 Concatenates a list of maps into a single AffineMap, stepping over potentially empty maps. More...
 
AffineMap projectDims (AffineMap map, const llvm::SmallBitVector &projectedDimensions, bool compressDimsFlag=false)
 Returns the map that results from projecting out the dimensions specified in projectedDimensions. More...
 
AffineMap projectSymbols (AffineMap map, const llvm::SmallBitVector &projectedSymbols, bool compressSymbolsFlag=false)
 Symbol counterpart of projectDims. More...
 
AffineMap getProjectedMap (AffineMap map, const llvm::SmallBitVector &projectedDimensions, bool compressDimsFlag=true, bool compressSymbolsFlag=true)
 Calls projectDims(map, projectedDimensions, compressDimsFlag). More...
 
llvm::SmallBitVector getUnusedDimsBitVector (ArrayRef< AffineMap > maps)
 
llvm::SmallBitVector getUnusedSymbolsBitVector (ArrayRef< AffineMap > maps)
 
AffineMap expandDimsToRank (AffineMap map, int64_t rank, const llvm::SmallBitVector &projectedDimensions)
 Expand map to operate on rank dims while projecting out the dims in projectedDimensions. More...
 
raw_ostream & operator<< (raw_ostream &os, AffineMap map)
 
template<typename T >
SmallVector< T > applyPermutationMap (AffineMap map, llvm::ArrayRef< T > source)
 Apply a permutation from map to source and return the result. More...
 
template<typename AffineExprContainer >
static void getMaxDimAndSymbol (ArrayRef< AffineExprContainer > exprsList, int64_t &maxDim, int64_t &maxSym)
 Calculates maximum dimension and symbol positions from the expressions in exprsLists and stores them in maxDim and maxSym respectively. More...
 
StringRef toString (AsmResourceEntryKind kind)
 
void registerAsmPrinterCLOptions ()
 Register a set of useful command-line options that can be used to configure various flags within the AsmPrinter. More...
 
raw_ostream & operator<< (raw_ostream &os, Attribute attr)
 
inline ::llvm::hash_code hash_value (Attribute arg)
 
inline ::llvm::hash_code hash_value (const NamedAttribute &arg)
 
raw_ostream & operator<< (raw_ostream &, Block &)
 
bool operator== (StringAttr lhs, std::nullptr_t)
 Define comparisons for StringAttr against nullptr and itself to avoid the StringRef overloads from being chosen when not desirable. More...
 
bool operator!= (StringAttr lhs, std::nullptr_t)
 
bool operator== (StringAttr lhs, StringAttr rhs)
 
bool operator!= (StringAttr lhs, StringAttr rhs)
 
bool operator== (StringAttr lhs, StringRef rhs)
 Allow direct comparison with StringRef. More...
 
bool operator!= (StringAttr lhs, StringRef rhs)
 
bool operator== (StringRef lhs, StringAttr rhs)
 
bool operator!= (StringRef lhs, StringAttr rhs)
 
AffineMap makeStridedLinearLayoutMap (ArrayRef< int64_t > strides, int64_t offset, MLIRContext *context)
 Given a list of strides (in which ShapedType::kDynamic represents a dynamic value), return the single result AffineMap which represents the linearized strided layout map. More...
 
std::optional< llvm::SmallDenseSet< unsigned > > computeRankReductionMask (ArrayRef< int64_t > originalShape, ArrayRef< int64_t > reducedShape, bool matchDynamic=false)
 Given an originalShape and a reducedShape assumed to be a subset of originalShape with some 1 entries erased, return the set of indices that specifies which of the entries of originalShape are dropped to obtain reducedShape. More...
 
SliceVerificationResult isRankReducedType (ShapedType originalType, ShapedType candidateReducedType)
 Check if originalType can be rank reduced to candidateReducedType type by dropping some dimensions with static size 1. More...
 
LogicalResult getStridesAndOffset (MemRefType t, SmallVectorImpl< int64_t > &strides, int64_t &offset)
 Returns the strides of the MemRef if the layout map is in strided form. More...
 
std::pair< SmallVector< int64_t >, int64_t > getStridesAndOffset (MemRefType t)
 Wrapper around getStridesAndOffset(MemRefType, SmallVectorImpl<int64_t>, int64_t) that will assert if the logical result is not succeeded. More...
 
MemRefType canonicalizeStridedLayout (MemRefType t)
 Return a version of t with identity layout if it can be determined statically that the layout is the canonical contiguous strided layout. More...
 
AffineExpr makeCanonicalStridedLayoutExpr (ArrayRef< int64_t > sizes, ArrayRef< AffineExpr > exprs, MLIRContext *context)
 Given MemRef sizes that are either static or dynamic, returns the canonical "contiguous" strides AffineExpr. More...
 
AffineExpr makeCanonicalStridedLayoutExpr (ArrayRef< int64_t > sizes, MLIRContext *context)
 Return the result of makeCanonicalStrudedLayoutExpr for the common case where exprs is {d0, d1, .., d_(sizes.size()-1)}. More...
 
bool isStrided (MemRefType t)
 Return "true" if the layout for t is compatible with strided semantics. More...
 
bool isLastMemrefDimUnitStride (MemRefType type)
 Return "true" if the last dimension of the given type has a static unit stride. More...
 
bool trailingNDimsContiguous (MemRefType type, int64_t n)
 Return "true" if the last N dimensions of the given type are contiguous. More...
 
raw_ostream & operator<< (raw_ostream &os, const DiagnosticArgument &arg)
 
raw_ostream & operator<< (raw_ostream &os, const Diagnostic &diag)
 
InFlightDiagnostic emitError (Location loc)
 Utility method to emit an error message using this location. More...
 
InFlightDiagnostic emitError (Location loc, const Twine &message)
 
InFlightDiagnostic emitWarning (Location loc)
 Utility method to emit a warning message using this location. More...
 
InFlightDiagnostic emitWarning (Location loc, const Twine &message)
 
InFlightDiagnostic emitRemark (Location loc)
 Utility method to emit a remark message using this location. More...
 
InFlightDiagnostic emitRemark (Location loc, const Twine &message)
 
template<typename... Args>
LogicalResult emitOptionalError (std::optional< Location > loc, Args &&...args)
 Overloads of the above emission functions that take an optionally null location. More...
 
template<typename... Args>
LogicalResult emitOptionalWarning (std::optional< Location > loc, Args &&...args)
 
template<typename... Args>
LogicalResult emitOptionalRemark (std::optional< Location > loc, Args &&...args)
 
inline ::llvm::hash_code hash_value (IntegerSet arg)
 
raw_ostream & operator<< (raw_ostream &os, const Location &loc)
 
inline ::llvm::hash_code hash_value (Location arg)
 
detail::constant_op_matcher m_Constant ()
 Matches a constant foldable operation. More...
 
detail::AttrOpMatcher m_Attr (StringRef attrName)
 Matches a named attribute operation. More...
 
detail::NameOpMatcher m_Op (StringRef opName)
 Matches a named operation. More...
 
template<typename AttrT >
detail::constant_op_binder< AttrT > m_Constant (AttrT *bind_value)
 Matches a value from a constant foldable operation and writes the value to bind_value. More...
 
template<typename AttrT >
detail::AttrOpBinder< AttrT > m_Attr (StringRef attrName, AttrT *bindValue)
 Matches a named attribute operation and writes the value to bind_value. More...
 
detail::constant_float_predicate_matcher m_AnyZeroFloat ()
 Matches a constant scalar / vector splat / tensor splat float (both positive and negative) zero. More...
 
detail::constant_float_predicate_matcher m_PosZeroFloat ()
 Matches a constant scalar / vector splat / tensor splat float positive zero. More...
 
detail::constant_float_predicate_matcher m_NegZeroFloat ()
 Matches a constant scalar / vector splat / tensor splat float negative zero. More...
 
detail::constant_float_predicate_matcher m_OneFloat ()
 Matches a constant scalar / vector splat / tensor splat float ones. More...
 
detail::constant_float_predicate_matcher m_NaNFloat ()
 Matches a constant scalar / vector splat / tensor splat float ones. More...
 
detail::constant_float_predicate_matcher m_PosInfFloat ()
 Matches a constant scalar / vector splat / tensor splat float positive infinity. More...
 
detail::constant_float_predicate_matcher m_NegInfFloat ()
 Matches a constant scalar / vector splat / tensor splat float negative infinity. More...
 
detail::constant_int_predicate_matcher m_Zero ()
 Matches a constant scalar / vector splat / tensor splat integer zero. More...
 
detail::constant_int_predicate_matcher m_NonZero ()
 Matches a constant scalar / vector splat / tensor splat integer that is any non-zero value. More...
 
detail::constant_int_range_predicate_matcher m_IntRangeWithoutZeroU ()
 Matches a constant scalar / vector splat / tensor splat integer or a unsigned integer range that does not contain zero. More...
 
detail::constant_int_range_predicate_matcher m_IntRangeWithoutZeroS ()
 Matches a constant scalar / vector splat / tensor splat integer or a signed integer range that does not contain zero. More...
 
detail::constant_int_range_predicate_matcher m_IntRangeWithoutNegOneS ()
 Matches a constant scalar / vector splat / tensor splat integer or a signed integer range that does not contain minus one. More...
 
detail::constant_int_predicate_matcher m_One ()
 Matches a constant scalar / vector splat / tensor splat integer one. More...
 
template<typename OpClass >
detail::op_matcher< OpClass > m_Op ()
 Matches the given OpClass. More...
 
template<typename Pattern >
bool matchPattern (Value value, const Pattern &pattern)
 Entry point for matching a pattern over a Value. More...
 
template<typename Pattern >
bool matchPattern (Operation *op, const Pattern &pattern)
 Entry point for matching a pattern over an Operation. More...
 
template<typename Pattern >
bool matchPattern (Attribute attr, const Pattern &pattern)
 Entry point for matching a pattern over an Attribute. More...
 
detail::constant_float_value_binder m_ConstantFloat (FloatAttr::ValueType *bind_value)
 Matches a constant holding a scalar/vector/tensor float (splat) and writes the float value to bind_value. More...
 
detail::constant_int_value_binder m_ConstantInt (IntegerAttr::ValueType *bind_value)
 Matches a constant holding a scalar/vector/tensor integer (splat) and writes the integer value to bind_value. More...
 
template<typename OpType , typename... Matchers>
auto m_Op (Matchers... matchers)
 
void registerMLIRContextCLOptions ()
 Register a set of useful command-line options that can be used to configure various flags within the MLIRContext. More...
 
LogicalResult convertFromAttribute (int64_t &storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Convert an IntegerAttr attribute to an int64_t, or return an error if the attribute isn't an IntegerAttr. More...
 
Attribute convertToAttribute (MLIRContext *ctx, int64_t storage)
 Convert the provided int64_t to an IntegerAttr attribute. More...
 
LogicalResult convertFromAttribute (int32_t &storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Convert an IntegerAttr attribute to an int32_t, or return an error if the attribute isn't an IntegerAttr. More...
 
Attribute convertToAttribute (MLIRContext *ctx, int32_t storage)
 Convert the provided int32_t to an IntegerAttr attribute. More...
 
LogicalResult convertFromAttribute (std::string &storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Extract the string from attr into storage. More...
 
Attribute convertToAttribute (MLIRContext *ctx, const std::string &storage)
 Convert the given string into a StringAttr. More...
 
LogicalResult convertFromAttribute (bool &storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Extract the boolean from attr into storage. More...
 
Attribute convertToAttribute (MLIRContext *ctx, bool storage)
 Convert the given string into a BooleanAttr. More...
 
LogicalResult convertFromAttribute (MutableArrayRef< int64_t > storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Convert a DenseI64ArrayAttr to the provided storage. More...
 
LogicalResult convertFromAttribute (MutableArrayRef< int32_t > storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Convert a DenseI32ArrayAttr to the provided storage. More...
 
LogicalResult convertFromAttribute (SmallVectorImpl< int64_t > &storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Convert a DenseI64ArrayAttr to the provided storage, which will be cleared before writing. More...
 
LogicalResult convertFromAttribute (SmallVectorImpl< int32_t > &storage, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 Convert a DenseI32ArrayAttr to the provided storage, which will be cleared before writing. More...
 
Attribute convertToAttribute (MLIRContext *ctx, ArrayRef< int64_t > storage)
 Convert the provided ArrayRef<int64_t> to a DenseI64ArrayAttr attribute. More...
 
bool operator== (OpState lhs, OpState rhs)
 
bool operator!= (OpState lhs, OpState rhs)
 
raw_ostream & operator<< (raw_ostream &os, OpFoldResult ofr)
 Allow printing to a stream. More...
 
raw_ostream & operator<< (raw_ostream &os, OpState op)
 Allow printing to a stream. More...
 
raw_ostream & operator<< (raw_ostream &os, const Operation &op)
 
raw_ostream & operator<< (raw_ostream &os, OperationName info)
 
llvm::hash_code hash_value (OperationName arg)
 
 LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE ()
 Enable Bitmask enums for OperationEquivalence::Flags. More...
 
llvm::hash_code hash_value (const AsmDialectResourceHandle &param)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, Type type)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, Attribute attr)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, const APFloat &value)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, float value)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, double value)
 
template<typename AsmPrinterT , typename T , std::enable_if_t<!std::is_convertible< T &, Value & >::value &&!std::is_convertible< T &, Type & >::value &&!std::is_convertible< T &, Attribute & >::value &&!std::is_convertible< T &, ValueRange >::value &&!std::is_convertible< T &, APFloat & >::value &&!llvm::is_one_of< T, bool, float, double >::value, T > * = nullptr>
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, const T &other)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, bool value)
 
template<typename AsmPrinterT , typename ValueRangeT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, const ValueTypeRange< ValueRangeT > &types)
 
template<typename AsmPrinterT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, const TypeRange &types)
 
template<typename AsmPrinterT , typename T >
std::enable_if_t< std::is_same< AsmPrinter, AsmPrinterT >::value &&std::is_convertible< T &, ValueRange >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, const T &other)=delete
 
template<typename AsmPrinterT , typename ElementT >
std::enable_if_t< std::is_base_of< AsmPrinter, AsmPrinterT >::value, AsmPrinterT & > operator<< (AsmPrinterT &p, ArrayRef< ElementT > types)
 
OpAsmPrinteroperator<< (OpAsmPrinter &p, Value value)
 
template<typename T , std::enable_if_t< std::is_convertible< T &, ValueRange >::value &&!std::is_convertible< T &, Value & >::value, T > * = nullptr>
OpAsmPrinteroperator<< (OpAsmPrinter &p, const T &values)
 
OpAsmPrinteroperator<< (OpAsmPrinter &p, Block *value)
 
void printDimensionList (OpAsmPrinter &printer, Operation *op, ArrayRef< int64_t > dimensions)
 
ParseResult parseDimensionList (OpAsmParser &parser, DenseI64ArrayAttr &dimensions)
 
bool mayHaveSSADominance (Region &region)
 Return "true" if the given region may have SSA dominance. More...
 
bool mayBeGraphRegion (Region &region)
 Return "true" if the given region may be a graph region without SSA dominance. More...
 
raw_ostream & operator<< (raw_ostream &os, SymbolTable::Visibility visibility)
 
template<typename IteratorT , typename FuncT >
LogicalResult failableParallelForEach (MLIRContext *context, IteratorT begin, IteratorT end, FuncT &&func)
 Invoke the given function on the elements between [begin, end) asynchronously. More...
 
template<typename RangeT , typename FuncT >
LogicalResult failableParallelForEach (MLIRContext *context, RangeT &&range, FuncT &&func)
 Invoke the given function on the elements in the provided range asynchronously. More...
 
template<typename FuncT >
LogicalResult failableParallelForEachN (MLIRContext *context, size_t begin, size_t end, FuncT &&func)
 Invoke the given function on the elements between [begin, end) asynchronously. More...
 
template<typename IteratorT , typename FuncT >
void parallelForEach (MLIRContext *context, IteratorT begin, IteratorT end, FuncT &&func)
 Invoke the given function on the elements between [begin, end) asynchronously. More...
 
template<typename RangeT , typename FuncT >
void parallelForEach (MLIRContext *context, RangeT &&range, FuncT &&func)
 Invoke the given function on the elements in the provided range asynchronously. More...
 
template<typename FuncT >
void parallelFor (MLIRContext *context, size_t begin, size_t end, FuncT &&func)
 Invoke the given function on the elements between [begin, end) asynchronously. More...
 
inline ::llvm::hash_code hash_value (TypeRange arg)
 Make TypeRange hashable. More...
 
raw_ostream & operator<< (raw_ostream &os, const TypeRange &types)
 Emit a type range to the given output stream. More...
 
template<typename RangeT >
bool operator== (ArrayRef< Type > lhs, const ValueTypeRange< RangeT > &rhs)
 
raw_ostream & operator<< (raw_ostream &os, Type type)
 
inline ::llvm::hash_code hash_value (Type arg)
 
Type getElementTypeOrSelf (Type type)
 Return the element type or return the type itself. More...
 
Type getElementTypeOrSelf (Attribute attr)
 Return the element type or return the type itself. More...
 
Type getElementTypeOrSelf (Value val)
 
SmallVector< Type, 10 > getFlattenedTypes (TupleType t)
 Get the types within a nested Tuple. More...
 
bool isOpaqueTypeWithName (Type type, StringRef dialect, StringRef typeData)
 Return true if the specified type is an opaque type with the specified dialect and typeData. More...
 
LogicalResult verifyCompatibleShape (ArrayRef< int64_t > shape1, ArrayRef< int64_t > shape2)
 Returns success if the given two shapes are compatible. More...
 
LogicalResult verifyCompatibleShape (Type type1, Type type2)
 Returns success if the given two types have compatible shape. More...
 
LogicalResult verifyCompatibleShapes (TypeRange types1, TypeRange types2)
 Returns success if the given two arrays have the same number of elements and each pair wise entries have compatible shape. More...
 
LogicalResult verifyCompatibleShapes (TypeRange types)
 Returns success if all given types have compatible shapes. More...
 
LogicalResult verifyCompatibleDims (ArrayRef< int64_t > dims)
 Dimensions are compatible if all non-dynamic dims are equal. More...
 
TypeRange insertTypesInto (TypeRange oldTypes, ArrayRef< unsigned > indices, TypeRange newTypes, SmallVectorImpl< Type > &storage)
 Insert a set of newTypes into oldTypes at the given indices. More...
 
TypeRange filterTypesOut (TypeRange types, const BitVector &indices, SmallVectorImpl< Type > &storage)
 Filters out any elements referenced by indices. More...
 
raw_ostream & operator<< (raw_ostream &os, const IRUnit &unit)
 
raw_ostream & operator<< (raw_ostream &os, Value value)
 
inline ::llvm::hash_code hash_value (Value arg)
 Make Value hashable. More...
 
LogicalResult verify (Operation *op, bool verifyRecursively=true)
 Perform (potentially expensive) checks of invariants, used to detect compiler bugs, on this operation and any nested operations. More...
 
LogicalResult parseSourceFile (const llvm::SourceMgr &sourceMgr, Block *block, const ParserConfig &config, LocationAttr *sourceFileLoc=nullptr)
 This parses the file specified by the indicated SourceMgr and appends parsed operations to the given block. More...
 
LogicalResult parseSourceFile (const std::shared_ptr< llvm::SourceMgr > &sourceMgr, Block *block, const ParserConfig &config, LocationAttr *sourceFileLoc=nullptr)
 An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR). More...
 
LogicalResult parseSourceFile (llvm::StringRef filename, Block *block, const ParserConfig &config, LocationAttr *sourceFileLoc=nullptr)
 This parses the file specified by the indicated filename and appends parsed operations to the given block. More...
 
LogicalResult parseSourceFile (llvm::StringRef filename, llvm::SourceMgr &sourceMgr, Block *block, const ParserConfig &config, LocationAttr *sourceFileLoc=nullptr)
 This parses the file specified by the indicated filename using the provided SourceMgr and appends parsed operations to the given block. More...
 
LogicalResult parseSourceFile (llvm::StringRef filename, const std::shared_ptr< llvm::SourceMgr > &sourceMgr, Block *block, const ParserConfig &config, LocationAttr *sourceFileLoc=nullptr)
 An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR). More...
 
LogicalResult parseSourceString (llvm::StringRef sourceStr, Block *block, const ParserConfig &config, StringRef sourceName="", LocationAttr *sourceFileLoc=nullptr)
 This parses the IR string and appends parsed operations to the given block. More...
 
template<typename ContainerOpT = Operation *>
OwningOpRef< ContainerOpT > parseSourceFile (const llvm::SourceMgr &sourceMgr, const ParserConfig &config)
 This parses the file specified by the indicated SourceMgr. More...
 
template<typename ContainerOpT = Operation *>
OwningOpRef< ContainerOpT > parseSourceFile (const std::shared_ptr< llvm::SourceMgr > &sourceMgr, const ParserConfig &config)
 An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR). More...
 
template<typename ContainerOpT = Operation *>
OwningOpRef< ContainerOpT > parseSourceFile (StringRef filename, const ParserConfig &config)
 This parses the file specified by the indicated filename. More...
 
template<typename ContainerOpT = Operation *>
OwningOpRef< ContainerOpT > parseSourceFile (llvm::StringRef filename, llvm::SourceMgr &sourceMgr, const ParserConfig &config)
 This parses the file specified by the indicated filename using the provided SourceMgr. More...
 
template<typename ContainerOpT = Operation *>
OwningOpRef< ContainerOpT > parseSourceFile (llvm::StringRef filename, const std::shared_ptr< llvm::SourceMgr > &sourceMgr, const ParserConfig &config)
 An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR). More...
 
template<typename ContainerOpT = Operation *>
OwningOpRef< ContainerOpT > parseSourceString (llvm::StringRef sourceStr, const ParserConfig &config, StringRef sourceName="")
 This parses the provided string containing MLIR. More...
 
std::string makeReproducer (StringRef anchorName, const llvm::iterator_range< OpPassManager::pass_iterator > &passes, Operation *op, StringRef outputFile, bool disableThreads=false, bool verifyPasses=false)
 
void registerPassManagerCLOptions ()
 Register a set of useful command-line options that can be used to configure a pass manager. More...
 
LogicalResult applyPassManagerCLOptions (PassManager &pm)
 Apply any values provided to the pass manager options that were registered with 'registerPassManagerOptions'. More...
 
void applyDefaultTimingPassManagerCLOptions (PassManager &pm)
 Apply any values provided to the timing manager options that were registered with registerDefaultTimingManagerOptions. More...
 
void printRegisteredPasses ()
 Prints the passes that were previously registered and stored in passRegistry. More...
 
void registerPassPipeline (StringRef arg, StringRef description, const PassRegistryFunction &function, std::function< void(function_ref< void(const detail::PassOptions &)>)> optHandler)
 Register a specific dialect pipeline registry function with the system, typically used through the PassPipelineRegistration template. More...
 
void registerPass (const PassAllocatorFunction &function)
 Register a specific dialect pass allocator function with the system, typically used through the PassRegistration template. More...
 
LogicalResult parsePassPipeline (StringRef pipeline, OpPassManager &pm, raw_ostream &errorStream=llvm::errs())
 Parse the textual representation of a pass pipeline, adding the result to 'pm' on success. More...
 
FailureOr< OpPassManagerparsePassPipeline (StringRef pipeline, raw_ostream &errorStream=llvm::errs())
 Parse the given textual representation of a pass pipeline, and return the parsed pipeline on success. More...
 
std::unique_ptr< PasscreateReductionTreePass ()
 
std::unique_ptr< PasscreateOptReductionPass ()
 
template<typename T >
static std::string debugString (T &&op)
 
std::unique_ptr< llvm::MemoryBuffer > openInputFile (llvm::StringRef inputFilename, std::string *errorMessage=nullptr)
 Open the file specified by its name for reading. More...
 
std::unique_ptr< llvm::MemoryBuffer > openInputFile (llvm::StringRef inputFilename, llvm::Align alignment, std::string *errorMessage=nullptr)
 Open the file specified by its name for reading, with the given buffer alignment constraint. More...
 
std::unique_ptr< llvm::ToolOutputFile > openOutputFile (llvm::StringRef outputFilename, std::string *errorMessage=nullptr)
 Open the file specified by its name for writing. More...
 
llvm::raw_ostream & thread_safe_nulls ()
 Returns a raw output stream that simply discards the output, but in a thread-safe manner. More...
 
void registerDefaultTimingManagerCLOptions ()
 Register a set of useful command-line options that can be used to configure a DefaultTimingManager. More...
 
void applyDefaultTimingManagerCLOptions (DefaultTimingManager &tm)
 Apply any values that were registered with 'registerDefaultTimingManagerOptions' to a DefaultTimingManager. More...
 
LogicalResult splitAndProcessBuffer (std::unique_ptr< llvm::MemoryBuffer > originalBuffer, ChunkBufferHandler processChunkBuffer, raw_ostream &os, llvm::StringRef inputSplitMarker=kDefaultSplitMarker, llvm::StringRef outputSplitMarker="")
 Splits the specified buffer on a marker (// ----- by default), processes each chunk independently according to the normal processChunkBuffer logic, and writes all results to os. More...
 
inline ::llvm::hash_code hash_value (TypeID id)
 Enable hashing TypeID. More...
 
static void registerAllToLLVMIRTranslations (DialectRegistry &registry)
 Registers all dialects that can be translated to LLVM IR and the corresponding translation interfaces. More...
 
static void registerAllGPUToLLVMIRTranslations (DialectRegistry &registry)
 Registers all the translations to LLVM IR required by GPU passes. More...
 
static void registerAllFromLLVMIRTranslations (DialectRegistry &registry)
 Registers all dialects that can be translated from LLVM IR and the corresponding translation interfaces. More...
 
void registerAMXDialectTranslation (DialectRegistry &registry)
 Register the AMX dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerAMXDialectTranslation (MLIRContext &context)
 Register the AMX dialect and the translation from it in the registry associated with the given context. More...
 
void registerArmNeonDialectTranslation (DialectRegistry &registry)
 Register the ArmNeon dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerArmNeonDialectTranslation (MLIRContext &context)
 Register the ArmNeon dialect and the translation from it in the registry associated with the given context. More...
 
void registerArmSMEDialectTranslation (DialectRegistry &registry)
 Register the ArmSME dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerArmSMEDialectTranslation (MLIRContext &context)
 Register the ArmSME dialect and the translation from it in the registry associated with the given context. More...
 
void registerArmSVEDialectTranslation (DialectRegistry &registry)
 Register the ArmSVE dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerArmSVEDialectTranslation (MLIRContext &context)
 Register the ArmSVE dialect and the translation from it in the registry associated with the given context. More...
 
void registerBuiltinDialectTranslation (DialectRegistry &registry)
 Register the translation from the builtin dialect to the LLVM IR in the given registry. More...
 
void registerBuiltinDialectTranslation (MLIRContext &context)
 Register the translation from the builtin dialect in the registry associated with the given context. More...
 
void registerGPUDialectTranslation (DialectRegistry &registry)
 Register the GPU dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerGPUDialectTranslation (MLIRContext &context)
 Register the GPU dialect and the translation from it in the registry associated with the given context. More...
 
void registerLLVMDialectImport (DialectRegistry &registry)
 Registers the LLVM dialect and its import from LLVM IR in the given registry. More...
 
void registerLLVMDialectImport (MLIRContext &context)
 Registers the LLVM dialect and its import from LLVM IR with the given context. More...
 
void registerLLVMDialectTranslation (DialectRegistry &registry)
 Register the LLVM dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerLLVMDialectTranslation (MLIRContext &context)
 Register the LLVM dialect and the translation from it in the registry associated with the given context. More...
 
void registerNVVMDialectImport (DialectRegistry &registry)
 Registers the NVVM dialect and its import from LLVM IR in the given registry. More...
 
void registerNVVMDialectImport (MLIRContext &context)
 Registers the NVVM dialect and its import from LLVM IR with the given context. More...
 
void registerNVVMDialectTranslation (DialectRegistry &registry)
 Register the NVVM dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerNVVMDialectTranslation (MLIRContext &context)
 Register the NVVM dialect and the translation from it in the registry associated with the given context. More...
 
void registerOpenACCDialectTranslation (DialectRegistry &registry)
 Register the OpenACC dialect and the translation to the LLVM IR in the given registry;. More...
 
void registerOpenACCDialectTranslation (MLIRContext &context)
 Register the OpenACC dialect and the translation in the registry associated with the given context. More...
 
void registerOpenMPDialectTranslation (DialectRegistry &registry)
 Register the OpenMP dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerOpenMPDialectTranslation (MLIRContext &context)
 Register the OpenMP dialect and the translation from it in the registry associated with the given context. More...
 
void registerROCDLDialectTranslation (DialectRegistry &registry)
 Register the ROCDL dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerROCDLDialectTranslation (MLIRContext &context)
 Register the ROCDL dialect and the translation from it in the registry associated with the given context. More...
 
void registerSPIRVDialectTranslation (DialectRegistry &registry)
 Register the SPIR-V dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerSPIRVDialectTranslation (MLIRContext &context)
 Register the SPIR-V dialect and the translation from it in the registry associated with the given context. More...
 
void registerVCIXDialectTranslation (DialectRegistry &registry)
 Register the VCIX dialect and the translation from it to the LLVM IR in the given registry. More...
 
void registerVCIXDialectTranslation (MLIRContext &context)
 Register the VCIX dialect and the translation from it in the registry associated with the given context. More...
 
void registerX86VectorDialectTranslation (DialectRegistry &registry)
 Register the X86Vector dialect and the translation from it to the LLVM IR in the given registry;. More...
 
void registerX86VectorDialectTranslation (MLIRContext &context)
 Register the X86Vector dialect and the translation from it in the registry associated with the given context. More...
 
std::unique_ptr< llvm::Module > translateModuleToLLVMIR (Operation *module, llvm::LLVMContext &llvmContext, llvm::StringRef name="LLVMDialectModule", bool disableVerification=false)
 Translates a given LLVM dialect module into an LLVM IR module living in the given context. More...
 
OwningOpRef< ModuleOp > translateLLVMIRToModule (std::unique_ptr< llvm::Module > llvmModule, MLIRContext *context, bool emitExpensiveWarnings=true, bool dropDICompositeTypeElements=false)
 Translates the LLVM module into an MLIR module living in the given context. More...
 
DataLayoutSpecInterface translateDataLayout (const llvm::DataLayout &dataLayout, MLIRContext *context)
 Translate the given LLVM data layout into an MLIR equivalent using the DLTI dialect. More...
 
llvm::LogicalResult MlirLspServerMain (int argc, char **argv, DialectRegistry &registry)
 Implementation for tools like mlir-lsp-server. More...
 
std::pair< std::string, std::string > registerAndParseCLIOptions (int argc, char **argv, llvm::StringRef toolName, DialectRegistry &registry)
 Register and parse command line options. More...
 
LogicalResult MlirOptMain (llvm::raw_ostream &outputStream, std::unique_ptr< llvm::MemoryBuffer > buffer, DialectRegistry &registry, const MlirOptMainConfig &config)
 Perform the core processing behind mlir-opt. More...
 
LogicalResult MlirOptMain (int argc, char **argv, llvm::StringRef toolName, DialectRegistry &registry)
 Implementation for tools like mlir-opt. More...
 
LogicalResult MlirOptMain (int argc, char **argv, llvm::StringRef inputFilename, llvm::StringRef outputFilename, DialectRegistry &registry)
 Implementation for tools like mlir-opt. More...
 
int asMainReturnCode (LogicalResult r)
 Helper wrapper to return the result of MlirOptMain directly from main. More...
 
llvm::LogicalResult MlirPdllLspServerMain (int argc, char **argv)
 Implementation for tools like mlir-pdll-lsp-server. More...
 
LogicalResult mlirQueryMain (int argc, char **argv, MLIRContext &context, const mlir::query::matcher::Registry &matcherRegistry)
 
LogicalResult mlirReduceMain (int argc, char **argv, MLIRContext &context)
 
int MlirTblgenMain (int argc, char **argv)
 Main Program for tools like 'mlir-tblgen' with custom backends. More...
 
LogicalResult mlirTranslateMain (int argc, char **argv, StringRef toolName)
 Translate to/from an MLIR module from/to an external representation (e.g. More...
 
void registerTranslationCLOptions ()
 Register command-line options used by the translation registry. More...
 
OwningOpRef< Operation * > parseSourceFileForTool (const std::shared_ptr< llvm::SourceMgr > &sourceMgr, const ParserConfig &config, bool insertImplicitModule)
 This parses the file specified by the indicated SourceMgr. More...
 
llvm::LogicalResult TableGenLspServerMain (int argc, char **argv)
 Implementation for tools like tblgen-lsp-server. More...
 
FailureOr< bool > transformCFGToSCF (Region &region, CFGToSCFInterface &interface, DominanceInfo &dominanceInfo)
 Transformation lifting any dialect implementing control flow graph operations to a dialect implementing structured control flow operations. More...
 
void populateCommutativityUtilsPatterns (RewritePatternSet &patterns)
 Populates the commutativity utility patterns. More...
 
size_t controlFlowSink (RegionRange regions, DominanceInfo &domInfo, function_ref< bool(Operation *, Region *)> shouldMoveIntoRegion, function_ref< void(Operation *, Region *)> moveIntoRegion)
 Given a list of regions, perform control flow sinking on them. More...
 
void getSinglyExecutedRegionsToSink (RegionBranchOpInterface branch, SmallVectorImpl< Region * > &regions)
 Populates regions with regions of the provided region branch op that are executed at most once at that are reachable given the current operands of the op. More...
 
void eliminateCommonSubExpressions (RewriterBase &rewriter, DominanceInfo &domInfo, Operation *op, bool *changed=nullptr)
 Eliminate common subexpressions within the given operation. More...
 
FailureOr< Operation * > convertOpResultTypes (Operation *op, ValueRange operands, const TypeConverter &converter, ConversionPatternRewriter &rewriter)
 Generic utility to convert op result types according to type converter without knowing exact op type. More...
 
void populateFunctionOpInterfaceTypeConversionPattern (StringRef functionLikeOpName, RewritePatternSet &patterns, const TypeConverter &converter)
 Add a pattern to the given pattern list to convert the signature of a FunctionOpInterface op with the given type converter. More...
 
template<typename FuncOpT >
void populateFunctionOpInterfaceTypeConversionPattern (RewritePatternSet &patterns, const TypeConverter &converter)
 
void populateAnyFunctionOpInterfaceTypeConversionPattern (RewritePatternSet &patterns, const TypeConverter &converter)
 
void registerConversionPDLFunctions (RewritePatternSet &patterns)
 Register the dialect conversion PDL functions with the given pattern set. More...
 
void reconcileUnrealizedCasts (ArrayRef< UnrealizedConversionCastOp > castOps, SmallVectorImpl< UnrealizedConversionCastOp > *remainingCastOps=nullptr)
 Try to reconcile all given UnrealizedConversionCastOps and store the left-over ops in remainingCastOps (if provided). More...
 
LogicalResult applyPartialConversion (ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
 Below we define several entry points for operation conversion. More...
 
LogicalResult applyPartialConversion (Operation *op, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
 
LogicalResult applyFullConversion (ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
 Apply a complete conversion on the given operations, and all nested operations. More...
 
LogicalResult applyFullConversion (Operation *op, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
 
LogicalResult applyAnalysisConversion (ArrayRef< Operation * > ops, ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
 Apply an analysis conversion on the given operations, and all nested operations. More...
 
LogicalResult applyAnalysisConversion (Operation *op, ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
 
LogicalResult applyPatternsGreedily (Region &region, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
 Rewrite ops in the given region, which must be isolated from above, by repeatedly applying the highest benefit patterns in a greedy worklist driven manner until a fixpoint is reached. More...
 
LogicalResult applyPatternsAndFoldGreedily (Region &region, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
 Same as applyPatternsAndGreedily above with folding. More...
 
LogicalResult applyPatternsGreedily (Operation *op, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
 Rewrite ops nested under the given operation, which must be isolated from above, by repeatedly applying the highest benefit patterns in a greedy worklist driven manner until a fixpoint is reached. More...
 
LogicalResult applyPatternsAndFoldGreedily (Operation *op, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
 Same as applyPatternsGreedily above with folding. More...
 
LogicalResult applyOpPatternsGreedily (ArrayRef< Operation * > ops, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr, bool *allErased=nullptr)
 Rewrite the specified ops by repeatedly applying the highest benefit patterns in a greedy worklist driven manner until a fixpoint is reached. More...
 
 LLVM_DEPRECATED ("Use applyOpPatternsGreedily() instead", "applyOpPatternsGreedily") inline LogicalResult applyOpPatternsAndFold(ArrayRef< Operation * > ops
 Same as applyOpPatternsGreedily with folding. More...
 
LogicalResult inlineRegion (InlinerInterface &interface, Region *src, Operation *inlinePoint, IRMapping &mapper, ValueRange resultsToReplace, TypeRange regionResultTypes, std::optional< Location > inlineLoc=std::nullopt, bool shouldCloneInlinedRegion=true)
 This function inlines a region, 'src', into another. More...
 
LogicalResult inlineRegion (InlinerInterface &interface, Region *src, Block *inlineBlock, Block::iterator inlinePoint, IRMapping &mapper, ValueRange resultsToReplace, TypeRange regionResultTypes, std::optional< Location > inlineLoc=std::nullopt, bool shouldCloneInlinedRegion=true)
 
LogicalResult inlineRegion (InlinerInterface &interface, Region *src, Operation *inlinePoint, ValueRange inlinedOperands, ValueRange resultsToReplace, std::optional< Location > inlineLoc=std::nullopt, bool shouldCloneInlinedRegion=true)
 This function is an overload of the above 'inlineRegion' that allows for providing the set of operands ('inlinedOperands') that should be used in-favor of the region arguments when inlining. More...
 
LogicalResult inlineRegion (InlinerInterface &interface, Region *src, Block *inlineBlock, Block::iterator inlinePoint, ValueRange inlinedOperands, ValueRange resultsToReplace, std::optional< Location > inlineLoc=std::nullopt, bool shouldCloneInlinedRegion=true)
 
LogicalResult inlineCall (InlinerInterface &interface, CallOpInterface call, CallableOpInterface callable, Region *src, bool shouldCloneInlinedRegion=true)
 This function inlines a given region, 'src', of a callable operation, 'callable', into the location defined by the given call operation. More...
 
void generateLocationsFromIR (raw_ostream &os, StringRef fileName, Operation *op, OpPrintingFlags flags)
 This function generates new locations from the given IR by snapshotting the IR to the given stream, and using the printed locations within that stream. More...
 
LogicalResult generateLocationsFromIR (StringRef fileName, Operation *op, OpPrintingFlags flags)
 This function generates new locations from the given IR by snapshotting the IR to the given file, and using the printed locations within that file. More...
 
void generateLocationsFromIR (raw_ostream &os, StringRef fileName, StringRef tag, Operation *op, OpPrintingFlags flags)
 This function generates new locations from the given IR by snapshotting the IR to the given stream, and using the printed locations within that stream. More...
 
LogicalResult generateLocationsFromIR (StringRef fileName, StringRef tag, Operation *op, OpPrintingFlags flags)
 This function generates new locations from the given IR by snapshotting the IR to the given file, and using the printed locations within that file. More...
 
std::unique_ptr< PasscreateLocationSnapshotPass (OpPrintingFlags flags, StringRef fileName="", StringRef tag="")
 Create a pass to generate new locations by snapshotting the IR to the given file, and using the printed locations within that file. More...
 
std::unique_ptr< PasscreateLocationSnapshotPass ()
 Overload utilizing pass options for initialization. More...
 
size_t moveLoopInvariantCode (ArrayRef< Region * > regions, function_ref< bool(Value, Region *)> isDefinedOutsideRegion, function_ref< bool(Operation *, Region *)> shouldMoveOutOfRegion, function_ref< void(Operation *, Region *)> moveOutOfRegion)
 Given a list of regions, perform loop-invariant code motion. More...
 
size_t moveLoopInvariantCode (LoopLikeOpInterface loopLike)
 Move side-effect free loop invariant code out of a loop-like op using methods provided by the interface. More...
 
LoopLikeOpInterface hoistLoopInvariantSubsets (RewriterBase &rewriter, LoopLikeOpInterface loopLike)
 Hoist loop-invariant tensor subsets (subset extraction and subset insertion ops) from loop-like ops. More...
 
LogicalResult tryToPromoteMemorySlots (ArrayRef< PromotableAllocationOpInterface > allocators, OpBuilder &builder, const DataLayout &dataLayout, DominanceInfo &dominance, Mem2RegStatistics statistics={})
 Attempts to promote the memory slots of the provided allocators. More...
 
LogicalResult applyPartialOneToNConversion (Operation *op, TypeConverter &typeConverter, const FrozenRewritePatternSet &patterns)
 Applies the given set of patterns recursively on the given op and adds user materializations where necessary. More...
 
void populateOneToNFunctionOpInterfaceTypeConversionPattern (StringRef functionLikeOpName, const TypeConverter &converter, RewritePatternSet &patterns)
 Add a pattern to the given pattern list to convert the signature of a FunctionOpInterface op with the given type converter. More...
 
template<typename FuncOpT >
void populateOneToNFunctionOpInterfaceTypeConversionPattern (const TypeConverter &converter, RewritePatternSet &patterns)
 
std::unique_ptr< PasscreateCanonicalizerPass ()
 Creates an instance of the Canonicalizer pass, configured with default settings (which can be overridden by pass options on the command line). More...
 
std::unique_ptr< PasscreateCanonicalizerPass (const GreedyRewriteConfig &config, ArrayRef< std::string > disabledPatterns=std::nullopt, ArrayRef< std::string > enabledPatterns=std::nullopt)
 Creates an instance of the Canonicalizer pass with the specified config. More...
 
std::unique_ptr< PasscreateControlFlowSinkPass ()
 Creates a pass to perform control-flow sinking. More...
 
std::unique_ptr< PasscreateCSEPass ()
 Creates a pass to perform common sub expression elimination. More...
 
std::unique_ptr< PasscreatePrintIRPass (const PrintIRPassOptions &={})
 Creates a pass to print IR on the debug stream. More...
 
std::unique_ptr< PasscreateGenerateRuntimeVerificationPass ()
 Creates a pass that generates IR to verify ops at runtime. More...
 
std::unique_ptr< PasscreateLoopInvariantCodeMotionPass ()
 Creates a loop invariant code motion pass that hoists loop invariant instructions out of the loop. More...
 
std::unique_ptr< PasscreateLoopInvariantSubsetHoistingPass ()
 Creates a pass that hoists loop-invariant subset ops. More...
 
std::unique_ptr< PasscreateStripDebugInfoPass ()
 Creates a pass to strip debug information from a function. More...
 
std::unique_ptr< PasscreatePrintOpStatsPass (raw_ostream &os=llvm::errs())
 Creates a pass which prints the list of ops and the number of occurrences in the module. More...
 
std::unique_ptr< PasscreatePrintOpStatsPass (raw_ostream &os, bool printAsJSON)
 Creates a pass which prints the list of ops and the number of occurrences in the module with the output format option. More...
 
std::unique_ptr< PasscreateInlinerPass ()
 Creates a pass which inlines calls and callable operations as defined by the CallGraph. More...
 
std::unique_ptr< PasscreateInlinerPass (llvm::StringMap< OpPassManager > opPipelines)
 Creates an instance of the inliner pass, and use the provided pass managers when optimizing callable operations with names matching the key type. More...
 
std::unique_ptr< PasscreateInlinerPass (llvm::StringMap< OpPassManager > opPipelines, std::function< void(OpPassManager &)> defaultPipelineBuilder)
 Creates an instance of the inliner pass, and use the provided pass managers when optimizing callable operations with names matching the key type. More...
 
std::unique_ptr< PasscreateRemoveDeadValuesPass ()
 Creates an optimization pass to remove dead values. More...
 
std::unique_ptr< PasscreateSCCPPass ()
 Creates a pass which performs sparse conditional constant propagation over nested operations. More...
 
std::unique_ptr< PasscreateSymbolDCEPass ()
 Creates a pass which delete symbol operations that are unreachable. More...
 
std::unique_ptr< PasscreateSymbolPrivatizePass (ArrayRef< std::string > excludeSymbols={})
 Creates a pass which marks top-level symbol operations as private unless listed in excludeSymbols. More...
 
std::unique_ptr< PasscreateTopologicalSortPass ()
 Creates a pass that recursively sorts nested regions without SSA dominance topologically such that, as much as possible, users of values appear after their producers. More...
 
std::unique_ptr< PasscreateCompositeFixedPointPass (std::string name, llvm::function_ref< void(OpPassManager &)> populateFunc, int maxIterations=10)
 Create composite pass, which runs provided set of passes until fixed point or maximum number of iterations reached. More...
 
template<typename Range >
bool areValuesDefinedAbove (Range values, Region &limit)
 Check if all values in the provided range are defined above the limit region. More...
 
void replaceAllUsesInRegionWith (Value orig, Value replacement, Region &region)
 Replace all uses of orig within the given region with replacement. More...
 
void visitUsedValuesDefinedAbove (Region &region, Region &limit, function_ref< void(OpOperand *)> callback)
 Calls callback for each use of a value within region or its descendants that was defined at the ancestors of the limit. More...
 
void visitUsedValuesDefinedAbove (MutableArrayRef< Region > regions, function_ref< void(OpOperand *)> callback)
 Calls callback for each use of a value within any of the regions provided that was defined in one of the ancestors. More...
 
void getUsedValuesDefinedAbove (Region &region, Region &limit, SetVector< Value > &values)
 Fill values with a list of values defined at the ancestors of the limit region and used within region or its descendants. More...
 
void getUsedValuesDefinedAbove (MutableArrayRef< Region > regions, SetVector< Value > &values)
 Fill values with a list of values used within any of the regions provided but defined in one of the ancestors. More...
 
SmallVector< ValuemakeRegionIsolatedFromAbove (RewriterBase &rewriter, Region &region, llvm::function_ref< bool(Operation *)> cloneOperationIntoRegion=[](Operation *) { return false;})
 Make a region isolated from above. More...
 
LogicalResult simplifyRegions (RewriterBase &rewriter, MutableArrayRef< Region > regions, bool mergeBlocks=true)
 Run a set of structural simplifications over the given regions. More...
 
LogicalResult eraseUnreachableBlocks (RewriterBase &rewriter, MutableArrayRef< Region > regions)
 Erase the unreachable blocks within the provided regions. More...
 
LogicalResult runRegionDCE (RewriterBase &rewriter, MutableArrayRef< Region > regions)
 This function returns success if any operations or arguments were deleted, failure otherwise. More...
 
LogicalResult tryToDestructureMemorySlots (ArrayRef< DestructurableAllocationOpInterface > allocators, OpBuilder &builder, const DataLayout &dataLayout, SROAStatistics statistics={})
 Attempts to destructure the slots of destructurable allocators. More...
 
std::unique_ptr< PasscreatePrintOpGraphPass (raw_ostream &os=llvm::errs())
 Creates a pass to print op graphs. More...
 
void walkAndApplyPatterns (Operation *op, const FrozenRewritePatternSet &patterns, RewriterBase::Listener *listener=nullptr)
 A fast walk-based pattern rewrite driver. More...
 
static bool createElementwiseOp (ConversionPatternRewriter &builder, gpu::SubgroupMmaElementwiseOp op, Type coopType, ValueRange operands)
 Creates a SPIR-V op to replace the given GPU subgroup mma elementwise op when the elementwise op directly supports with cooperative matrix type. More...
 
bool allOperandsHaveSameCoopMatrixType (ValueRange operands)
 
static Attribute convertToAttribute (MLIRContext *ctx, IntegerOverflowFlags flags)
 
static LogicalResult convertFromAttribute (IntegerOverflowFlags &flags, Attribute attr, function_ref< InFlightDiagnostic()> emitError)
 
template<typename K , typename V >
static SmallVector< V > getValuesSortedByKeyImpl (ArrayRef< K > keys, ArrayRef< V > values, llvm::function_ref< bool(K, K)> compare)
 Helper to sort values according to matching keys. More...
 
void registerTestRoundtripSPIRV ()
 
void registerTestRoundtripDebugSPIRV ()
 

Variables

static constexpr unsigned kDeriveIndexBitwidthFromDataLayout = 0
 Value to pass as bitwidth for the index type when the converter is expected to derive the bitwidth from the LLVM data layout. More...
 
template<typename... Ts>
constexpr bool has_sub_attr_or_type_v
 
const char *const kDefaultSplitMarker = "// -----"
 
const FrozenRewritePatternSetpatterns
 
const FrozenRewritePatternSet GreedyRewriteConfig config = GreedyRewriteConfig()
 
const FrozenRewritePatternSet GreedyRewriteConfig bool * changed = nullptr
 

Detailed Description

Include the generated interface declarations.

Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

The pass expands memref operations that modify the metadata of a memref (sizes, offset, strides) into a sequence of easier to analyze constructs.

This header declares functions that assist transformations in the MemRef dialect.

In particular, this pass transforms operations into explicit sequence of operations that model the effect of this operation on the different metadata. This pass uses affine constructs to materialize these effects.

See https://llvm.org/LICENSE.txt for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Typedef Documentation

◆ AllocFunType

using mlir::AllocFunType = typedef llvm::function_ref<void *(size_t)>

Definition at line 37 of file MemRefUtils.h.

◆ AttributeStorageAllocator

Definition at line 207 of file AttributeSupport.h.

◆ AttrSubElementReplacements

Definition at line 373 of file AttrTypeSubElements.h.

◆ ChunkBufferHandler

using mlir::ChunkBufferHandler = typedef function_ref<LogicalResult( std::unique_ptr<llvm::MemoryBuffer> chunkBuffer, raw_ostream &os)>

Definition at line 27 of file ToolUtilities.h.

◆ DataLayoutEntryKey

using mlir::DataLayoutEntryKey = typedef llvm::PointerUnion<Type, StringAttr>

Definition at line 30 of file DataLayoutInterfaces.h.

◆ DataLayoutEntryList

using mlir::DataLayoutEntryList = typedef llvm::SmallVector<DataLayoutEntryInterface, 4>

Definition at line 33 of file DataLayoutInterfaces.h.

◆ DataLayoutEntryListRef

using mlir::DataLayoutEntryListRef = typedef llvm::ArrayRef<DataLayoutEntryInterface>

Definition at line 34 of file DataLayoutInterfaces.h.

◆ DefaultAttributeStorage

Default storage type for attributes that require no additional initialization or storage.

Definition at line 199 of file AttributeSupport.h.

◆ DefaultTypeStorage

Default storage type for types that require no additional initialization or storage.

Definition at line 194 of file TypeSupport.h.

◆ DenseBoolArrayAttr

Definition at line 765 of file BuiltinAttributes.h.

◆ DenseBoolResourceElementsAttr

Definition at line 815 of file BuiltinAttributes.h.

◆ DenseF32ArrayAttr

Definition at line 770 of file BuiltinAttributes.h.

◆ DenseF32ResourceElementsAttr

Definition at line 833 of file BuiltinAttributes.h.

◆ DenseF64ArrayAttr

Definition at line 771 of file BuiltinAttributes.h.

◆ DenseF64ResourceElementsAttr

Definition at line 835 of file BuiltinAttributes.h.

◆ DenseI16ArrayAttr

Definition at line 767 of file BuiltinAttributes.h.

◆ DenseI16ResourceElementsAttr

Definition at line 819 of file BuiltinAttributes.h.

◆ DenseI32ArrayAttr

Definition at line 768 of file BuiltinAttributes.h.

◆ DenseI32ResourceElementsAttr

Definition at line 821 of file BuiltinAttributes.h.

◆ DenseI64ArrayAttr

Definition at line 769 of file BuiltinAttributes.h.

◆ DenseI64ResourceElementsAttr

Definition at line 823 of file BuiltinAttributes.h.

◆ DenseI8ArrayAttr

Definition at line 766 of file BuiltinAttributes.h.

◆ DenseI8ResourceElementsAttr

Definition at line 817 of file BuiltinAttributes.h.

◆ DenseMap

template<typename KeyT , typename ValueT , typename KeyInfoT = DenseMapInfo<KeyT>, typename BucketT = llvm::detail::DenseMapPair<KeyT, ValueT>>
using mlir::DenseMap = typedef llvm::DenseMap<KeyT, ValueT, KeyInfoT, BucketT>

Definition at line 126 of file LLVM.h.

◆ DenseMapInfo

template<typename T , typename Enable = void>
DenseMapInfo< mlir::RegisteredOperationName >

Definition at line 122 of file LLVM.h.

◆ DenseResourceElementsHandle

Definition at line 702 of file BuiltinAttributes.h.

◆ DenseSet

template<typename ValueT , typename ValueInfoT = DenseMapInfo<ValueT>>
using mlir::DenseSet = typedef llvm::DenseSet<ValueT, ValueInfoT>

Definition at line 128 of file LLVM.h.

◆ DenseUI16ResourceElementsAttr

Definition at line 827 of file BuiltinAttributes.h.

◆ DenseUI32ResourceElementsAttr

Definition at line 829 of file BuiltinAttributes.h.

◆ DenseUI64ResourceElementsAttr

Definition at line 831 of file BuiltinAttributes.h.

◆ DenseUI8ResourceElementsAttr

Definition at line 825 of file BuiltinAttributes.h.

◆ DialectAllocatorFunction

using mlir::DialectAllocatorFunction = typedef std::function<Dialect *(MLIRContext *)>

Definition at line 27 of file DialectRegistry.h.

◆ DialectAllocatorFunctionRef

Definition at line 28 of file DialectRegistry.h.

◆ DialectRegistrationFunction

using mlir::DialectRegistrationFunction = typedef std::function<void(DialectRegistry &)>

Interface of the function that adds all dialects and dialect extensions used for the translation to the given DialectRegistry.

Definition at line 57 of file Translation.h.

◆ DominanceInfoNode

using mlir::DominanceInfoNode = typedef llvm::DomTreeNodeBase<Block>

Definition at line 30 of file Dominance.h.

◆ DynamicDialectPopulationFunction

using mlir::DynamicDialectPopulationFunction = typedef std::function<void(MLIRContext *, DynamicDialect *)>

Definition at line 29 of file DialectRegistry.h.

◆ ElementWiseVisitor

template<typename T >
using mlir::ElementWiseVisitor = typedef llvm::function_ref<void(T &ptr, ArrayRef<int64_t>)>

Convenient callback to "visit" a memref element by element.

This takes a reference to an individual element as well as the coordinates. It can be used in conjuction with a StridedMemrefIterator.

Definition at line 130 of file MemRefUtils.h.

◆ ForwardSliceOptions

Definition at line 57 of file SliceAnalysis.h.

◆ function_ref

template<typename Fn >
using mlir::function_ref = typedef llvm::function_ref<Fn>

Definition at line 152 of file LLVM.h.

◆ GenFunction

using mlir::GenFunction = typedef std::function<bool(const llvm::RecordKeeper &records, raw_ostream &os)>

Generator function to invoke.

Definition at line 24 of file GenInfo.h.

◆ Loops

using mlir::Loops = typedef SmallVector<scf::ForOp, 8>

Tile a nest of standard for loops rooted at rootForOp by finding such parametric tile sizes that the outer loops have a fixed number of iterations as defined in sizes.

Definition at line 151 of file Utils.h.

◆ LoweringCallback

using mlir::LoweringCallback = typedef std::function<std::unique_ptr<llvm::Module>( Operation *, llvm::LLVMContext &, StringRef)>

Definition at line 48 of file GPUCommonPass.h.

◆ MemorySpaceMapping

using mlir::MemorySpaceMapping = typedef std::function<unsigned(gpu::AddressSpace)>

A function that maps a MemorySpace enum to a target-specific integer value.

Definition at line 70 of file GPUCommonPass.h.

◆ MemrefValue

A value with a memref type.

Definition at line 26 of file MemRefUtils.h.

◆ NewYieldValuesFn

using mlir::NewYieldValuesFn = typedef std::function<SmallVector<Value>( OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBbArgs)>

A function that returns the additional yielded values during replaceWithAdditionalYields.

newBbArgs are the newly added region iter_args. This function should return as many values as there are block arguments in newBbArgs.

Definition at line 25 of file LoopLikeInterface.h.

◆ OpAsmSetBlockNameFn

using mlir::OpAsmSetBlockNameFn = typedef function_ref<void(Block *, StringRef)>

A functor used to set the name of blocks in regions directly nested under an operation.

Definition at line 1736 of file OpImplementation.h.

◆ OpAsmSetValueNameFn

using mlir::OpAsmSetValueNameFn = typedef function_ref<void(Value, StringRef)>

A functor used to set the name of the start of a result group of an operation.

See 'getAsmResultNames' below for more details.

Definition at line 1732 of file OpImplementation.h.

◆ OperandElementTypeRange

Definition at line 97 of file TypeUtilities.h.

◆ PassAllocatorFunction

using mlir::PassAllocatorFunction = typedef std::function<std::unique_ptr<Pass>()>

Definition at line 41 of file PassRegistry.h.

◆ PassPipelineFn

using mlir::PassPipelineFn = typedef llvm::function_ref<LogicalResult(PassManager &pm)>

This defines the function type used to setup the pass manager.

This can be used to pass in a callback to setup a default pass pipeline to be applied on the loaded IR.

Definition at line 300 of file MlirOptMain.h.

◆ PassRegistryFunction

using mlir::PassRegistryFunction = typedef std::function<LogicalResult( OpPassManager &, StringRef options, function_ref<LogicalResult(const Twine &)> errorHandler)>

A registry function that adds passes to the given pass manager.

This should also parse options and return success() if parsing succeeded. errorHandler is a functor used to emit errors during parsing. parameter corresponds to the raw location within the pipeline string. This should always return failure.

Definition at line 38 of file PassRegistry.h.

◆ ReassociationExprs

Definition at line 28 of file ReshapeOpsUtils.h.

◆ ReassociationIndices

typedef SmallVector< int64_t, 2 > mlir::ReassociationIndices

Definition at line 27 of file Utils.h.

◆ ReassociationIndicesRef

using mlir::ReassociationIndicesRef = typedef ArrayRef<int64_t>

Definition at line 27 of file ReshapeOpsUtils.h.

◆ ReifiedRankedShapedTypeDims

Definition at line 29 of file InferTypeOpInterface.h.

◆ ReproducerStreamFactory

using mlir::ReproducerStreamFactory = typedef std::function<std::unique_ptr<ReproducerStream>(std::string &error)>

Method type for constructing ReproducerStream.

Definition at line 221 of file PassManager.h.

◆ ResultElementTypeRange

Definition at line 110 of file TypeUtilities.h.

◆ SetIntLatticeFn

Similar to SetIntRangeFn, but operating on IntegerValueRange lattice values.

This is the setResultRanges callback for the IntegerValueRange based interface method.

Definition at line 167 of file InferIntRangeInterface.h.

◆ SetIntRangeFn

The type of the setResultRanges callback provided to ops implementing InferIntRangeInterface.

It should be called once for each integer result value and be passed the ConstantIntRanges corresponding to that value.

Definition at line 161 of file InferIntRangeInterface.h.

◆ SetVector

template<typename T , typename Vector = llvm::SmallVector<T, 0>, typename Set = DenseSet<T>, unsigned N = 0>
using mlir::SetVector = typedef llvm::SetVector<T, Vector, Set, N>

Definition at line 131 of file LLVM.h.

◆ StringSet

template<typename AllocatorTy = llvm::MallocAllocator>
using mlir::StringSet = typedef llvm::StringSet<AllocatorTy>

Definition at line 133 of file LLVM.h.

◆ StringSwitch

template<typename T , typename R = T>
using mlir::StringSwitch = typedef llvm::StringSwitch<T, R>

Definition at line 141 of file LLVM.h.

◆ TargetDeviceSpecEntry

using mlir::TargetDeviceSpecEntry = typedef std::pair<StringAttr, TargetDeviceSpecInterface>

Definition at line 36 of file DataLayoutInterfaces.h.

◆ TargetDeviceSpecListRef

using mlir::TargetDeviceSpecListRef = typedef llvm::ArrayRef<TargetDeviceSpecInterface>

Definition at line 35 of file DataLayoutInterfaces.h.

◆ TileLoops

using mlir::TileLoops = typedef std::pair<Loops, Loops>

Definition at line 152 of file Utils.h.

◆ TransitiveFilter

Definition at line 41 of file SliceAnalysis.h.

◆ TranslateFromMLIRFunction

using mlir::TranslateFromMLIRFunction = typedef std::function<LogicalResult(Operation *, llvm::raw_ostream &output)>

Interface of the function that translates MLIR to a different format and outputs the result to a stream.

It is allowed to modify the operation.

Definition at line 43 of file Translation.h.

◆ TranslateFunction

using mlir::TranslateFunction = typedef std::function<LogicalResult( const std::shared_ptr<llvm::SourceMgr> &sourceMgr, llvm::raw_ostream &output, MLIRContext *)>

Interface of the function that performs file-to-file translation involving MLIR.

The input file is held in the given MemoryBuffer; the output file should be written to the given raw_ostream. The implementation should create all MLIR constructs needed during the process inside the given context. This can be used for round-tripping external formats through the MLIR system.

Definition at line 51 of file Translation.h.

◆ TranslateRawSourceMgrToMLIRFunction

using mlir::TranslateRawSourceMgrToMLIRFunction = typedef std::function<OwningOpRef<Operation *>(llvm::SourceMgr &sourceMgr, MLIRContext *)>

Definition at line 30 of file Translation.h.

◆ TranslateSourceMgrToMLIRFunction

using mlir::TranslateSourceMgrToMLIRFunction = typedef std::function<OwningOpRef<Operation *>( const std::shared_ptr<llvm::SourceMgr> &sourceMgr, MLIRContext *)>

Interface of the function that translates the sources managed by sourceMgr to MLIR.

The source manager has at least one buffer. The implementation should create a new MLIR Operation in the given context and return a pointer to it, or a nullptr in case of any error.

Definition at line 28 of file Translation.h.

◆ TranslateStringRefToMLIRFunction

using mlir::TranslateStringRefToMLIRFunction = typedef std::function<OwningOpRef<Operation *>(llvm::StringRef, MLIRContext *)>

Interface of the function that translates the given string to MLIR.

The implementation should create a new MLIR Operation in the given context. If source-related error reporting is required from within the function, use TranslateSourceMgrToMLIRFunction instead.

Definition at line 38 of file Translation.h.

◆ TypedValue

template<typename Ty , typename Value = mlir::Value>
using mlir::TypedValue = typedef std::conditional_t<std::is_same_v<Ty, mlir::Type>, mlir::Value, detail::TypedValue<Ty> >

If Ty is mlir::Type this will select Value instead of having a wrapper around it.

This helps resolve ambiguous conversion issues.

Definition at line 497 of file Value.h.

◆ TypeRangeRangeIterator

using mlir::TypeRangeRangeIterator = typedef llvm::mapped_iterator<llvm::iota_range<unsigned>::iterator, std::function<TypeRange(unsigned)> >

Definition at line 85 of file TypeRange.h.

◆ TypeStorageAllocator

This is a utility allocator used to allocate memory for instances of derived Types.

Definition at line 202 of file TypeSupport.h.

◆ TypeSubElementReplacements

Definition at line 374 of file AttrTypeSubElements.h.

◆ TypeSwitch

template<typename T , typename ResultT = void>
using mlir::TypeSwitch = typedef llvm::TypeSwitch<T, ResultT>

Definition at line 144 of file LLVM.h.

◆ ValueDimList

using mlir::ValueDimList = typedef SmallVector<std::pair<Value, std::optional<int64_t> >>

Definition at line 51 of file ValueBoundsOpInterface.h.

◆ WalkCallback

A callback that is invoked for each value encountered during the walk of the slice.

The callback takes the current value, and returns the walk continuation, which determines if the walk should proceed and if yes, with which values.

Definition at line 81 of file SliceWalk.h.

Enumeration Type Documentation

◆ AffineExprKind

enum mlir::AffineExprKind
strong
Enumerator
Add 
Mul 

RHS of mul is always a constant or a symbolic expression.

Mod 

RHS of mod is always a constant or a symbolic expression with a positive value.

FloorDiv 

RHS of floordiv is always a constant or a symbolic expression.

CeilDiv 

RHS of ceildiv is always a constant or a symbolic expression.

LAST_AFFINE_BINARY_OP 

This is a marker for the last affine binary op.

The range of binary op's is expected to be this element and earlier.

Constant 

Constant integer.

DimId 

Dimensional identifier.

SymbolId 

Symbolic identifier.

Definition at line 40 of file AffineExpr.h.

◆ AsmResourceEntryKind

This enum represents the different kinds of resource values.

Enumerator
Blob 

A blob of data with an accompanying alignment.

Bool 

A boolean value.

String 

A string value.

Definition at line 279 of file AsmState.h.

◆ ChangeResult

enum mlir::ChangeResult
strong

A result type used to indicate if a change happened.

Boolean operations on ChangeResult behave as though Change is truth.

Enumerator
NoChange 
Change 

Definition at line 36 of file DataFlowFramework.h.

◆ DeletionKind

enum mlir::DeletionKind
strong

Returned by operation promotion logic requesting the deletion of an operation.

Enumerator
Keep 

Keep the operation after promotion.

Delete 

Delete the operation after promotion.

Definition at line 35 of file MemorySlotInterfaces.h.

◆ DiagnosticSeverity

Defines the different supported severity of a diagnostic.

Enumerator
Note 
Warning 
Error 
Remark 

Definition at line 40 of file Diagnostics.h.

◆ GreedyRewriteStrictness

This enum controls which ops are put on the worklist during a greedy pattern rewrite.

Enumerator
AnyOp 

No restrictions wrt. which ops are processed.

ExistingAndNewOps 

Only pre-existing and newly created ops are processed.

ExistingOps 

Only pre-existing ops are processed.

Definition at line 23 of file GreedyPatternRewriteDriver.h.

◆ GreedySimplifyRegionLevel

Enumerator
Disabled 

Disable region control-flow simplification.

Normal 

Run the normal simplification (e.g. dead args elimination).

Aggressive 

Run extra simplificiations (e.g.

block merging), these can be more costly or have some tradeoffs associated.

Definition at line 32 of file GreedyPatternRewriteDriver.h.

◆ HoistingKind

enum mlir::HoistingKind : uint8_t
strong
Enumerator
None 
Loop 
Block 

Definition at line 21 of file AllocationOpInterface.h.

◆ PassDisplayMode

enum mlir::PassDisplayMode
strong

An enum describing the different display modes for the information within the pass manager.

Enumerator
List 
Pipeline 

Definition at line 198 of file PassManager.h.

◆ RegionKind

enum mlir::RegionKind
strong

The kinds of regions contained in an operation.

SSACFG regions require the SSA-Dominance property to hold. Graph regions do not require SSA-Dominance. If a registered operation does not implement RegionKindInterface, then any regions it contains are assumed to be SSACFG regions.

Enumerator
SSACFG 
Graph 

Definition at line 26 of file RegionKindInterface.h.

◆ ReinterpretMapScope

Defines a scope for reinterpret map pass.

Enumerator
kAll 
kGenericOnly 
kExceptGeneric 

Definition at line 45 of file Passes.h.

◆ ReshapeOpKind

enum mlir::ReshapeOpKind
strong
Enumerator
kExpand 
kCollapse 

Definition at line 184 of file ReshapeOpsUtils.h.

◆ SliceVerificationResult

Enum that captures information related to verifier error conditions on slice insert/extract type of ops.

Enumerator
Success 
RankTooLarge 
SizeMismatch 
ElemTypeMismatch 
MemSpaceMismatch 
LayoutMismatch 

Definition at line 387 of file BuiltinTypes.h.

◆ SparseEmitStrategy

Defines a scope for reinterpret map pass.

Enumerator
kFunctional 
kSparseIterator 
kDebugInterface 

Definition at line 52 of file Passes.h.

◆ SparseParallelizationStrategy

Defines a parallelization strategy.

Any independent loop is a candidate for parallelization. The loop is made parallel if (1) allowed by the strategy (e.g., AnyStorageOuterLoop considers either a dense or sparse outermost loop only), and (2) the generated code is an actual for-loop (and not a co-iterating while-loop).

Enumerator
kNone 
kDenseOuterLoop 
kAnyStorageOuterLoop 
kDenseAnyLoop 
kAnyStorageAnyLoop 

Definition at line 36 of file Passes.h.

◆ SPIRVSubByteTypeStorage

How sub-byte values are storaged in memory.

Enumerator
Packed 

Sub-byte values are tightly packed without any padding, e.g., 4xi2 -> i8.

Definition at line 34 of file SPIRVConversion.h.

◆ TraversalMode

Defines the traversal method options to be used in the reduction tree traversal.

Enumerator
SinglePath 
Backtrack 
MultiPath 

Definition at line 36 of file ReductionNode.h.

◆ VerbosityLevel

enum mlir::VerbosityLevel
strong

enum class to indicate the verbosity level of the diagnostic filter.

Enumerator
ErrorsOnly 
ErrorsAndWarnings 
ErrorsWarningsAndRemarks 

Definition at line 35 of file MlirOptMain.h.

◆ WalkOrder

enum mlir::WalkOrder
strong

Traversal order for region, block and operation walk utilities.

Enumerator
PreOrder 
PostOrder 

Definition at line 62 of file Visitors.h.

Function Documentation

◆ addressSpaceToStorageClass()

spirv::StorageClass mlir::addressSpaceToStorageClass ( gpu::AddressSpace  addressSpace)

Definition at line 12 of file AttrToSPIRVConverter.cpp.

◆ alignAffineMapWithValues()

AffineMap mlir::alignAffineMapWithValues ( AffineMap  map,
ValueRange  operands,
ValueRange  dims,
ValueRange  syms,
SmallVector< Value > *  newSyms = nullptr 
)

Re-indexes the dimensions and symbols of an affine map with given operands values to align with dims and syms values.

Each dimension/symbol of the map, bound to an operand o, is replaced with dimension i, where i is the position of o within dims. If o is not in dims, replace it with symbol i, where i is the position of o within syms. If o is not in syms either, replace it with a new symbol.

Note: If a value appears multiple times as a dimension/symbol (or both), all corresponding dim/sym expressions are replaced with the first dimension bound to that value (or first symbol if no such dimension exists).

The resulting affine map has dims.size() many dimensions and at least syms.size() many symbols.

The SSA values of the symbols of the resulting map are optionally returned via newSyms. This is a concatenation of syms with the SSA values of the newly added symbols.

Note: As part of this re-indexing, dimensions may turn into symbols, or vice versa.

Definition at line 1260 of file FlatLinearValueConstraints.cpp.

References mlir::detail::enumerate(), mlir::Builder::getAffineDimExpr(), mlir::Builder::getAffineSymbolExpr(), mlir::AffineMap::getContext(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumSymbols(), and mlir::AffineMap::replaceDimsAndSymbols().

Referenced by alignAndAddBound(), and mlir::FlatLinearValueConstraints::computeAlignedMap().

◆ allOperandsHaveSameCoopMatrixType()

bool mlir::allOperandsHaveSameCoopMatrixType ( ValueRange  operands)

Definition at line 85 of file WmmaOpsToSPIRV.cpp.

References mlir::Value::getType(), and mlir::ValueRange::getType().

◆ applyAnalysisConversion() [1/2]

LogicalResult mlir::applyAnalysisConversion ( ArrayRef< Operation * >  ops,
ConversionTarget target,
const FrozenRewritePatternSet patterns,
ConversionConfig  config = ConversionConfig() 
)

Apply an analysis conversion on the given operations, and all nested operations.

This method analyzes which operations would be successfully converted to the target if a conversion was applied. All operations that were found to be legalizable to the given 'target' are placed within the provided 'config.legalizableOps' set; note that no actual rewrites are applied to the operations on success. This method only returns failure if there are unreachable blocks in any of the regions nested within 'ops'.

Definition at line 3470 of file DialectConversion.cpp.

References mlir::Operation::clone(), config, mlir::Operation::erase(), findCommonAncestor(), mlir::IRMapping::getOperationMap(), mlir::IRMapping::lookup(), and patterns.

Referenced by applyAnalysisConversion().

◆ applyAnalysisConversion() [2/2]

LogicalResult mlir::applyAnalysisConversion ( Operation op,
ConversionTarget target,
const FrozenRewritePatternSet patterns,
ConversionConfig  config = ConversionConfig() 
)

Definition at line 3509 of file DialectConversion.cpp.

References applyAnalysisConversion(), config, and patterns.

◆ applyDefaultTimingManagerCLOptions()

void mlir::applyDefaultTimingManagerCLOptions ( DefaultTimingManager tm)

Apply any values that were registered with 'registerDefaultTimingManagerOptions' to a DefaultTimingManager.

Definition at line 619 of file Timing.cpp.

References options, mlir::DefaultTimingManager::setDisplayMode(), mlir::DefaultTimingManager::setEnabled(), and mlir::DefaultTimingManager::setOutput().

Referenced by applyDefaultTimingPassManagerCLOptions(), and performActions().

◆ applyDefaultTimingPassManagerCLOptions()

void mlir::applyDefaultTimingPassManagerCLOptions ( PassManager pm)

Apply any values provided to the timing manager options that were registered with registerDefaultTimingManagerOptions.

This is a handy helper function if you do not want to bother creating your own timing manager and passing it to the pass manager.

Definition at line 170 of file PassManagerOptions.cpp.

References applyDefaultTimingManagerCLOptions(), and mlir::PassManager::enableTiming().

◆ applyFullConversion() [1/2]

LogicalResult mlir::applyFullConversion ( ArrayRef< Operation * >  ops,
const ConversionTarget target,
const FrozenRewritePatternSet patterns,
ConversionConfig  config = ConversionConfig() 
)

Apply a complete conversion on the given operations, and all nested operations.

This method returns failure if the conversion of any operation fails, or if there are unreachable blocks in any of the regions nested within 'ops'.

Definition at line 3418 of file DialectConversion.cpp.

References config, mlir::OperationConverter::convertOperations(), and patterns.

Referenced by applyFullConversion().

◆ applyFullConversion() [2/2]

LogicalResult mlir::applyFullConversion ( Operation op,
const ConversionTarget target,
const FrozenRewritePatternSet patterns,
ConversionConfig  config = ConversionConfig() 
)

Definition at line 3426 of file DialectConversion.cpp.

References applyFullConversion(), config, and patterns.

◆ applyOpPatternsGreedily()

LogicalResult mlir::applyOpPatternsGreedily ( ArrayRef< Operation * >  ops,
const FrozenRewritePatternSet patterns,
GreedyRewriteConfig  config = GreedyRewriteConfig(),
bool *  changed = nullptr,
bool *  allErased = nullptr 
)

Rewrite the specified ops by repeatedly applying the highest benefit patterns in a greedy worklist driven manner until a fixpoint is reached.

The greedy rewrite may prematurely stop after a maximum number of iterations, which can be configured in the configuration parameter.

Also performs simple dead-code elimination before attempting to match any of the provided patterns.

Newly created ops and other pre-existing ops that use results of rewritten ops or supply operands to such ops are also processed, unless such ops are excluded via config.strictMode. Any other ops remain unmodified (i.e., regardless of strictMode).

In addition to strictness, a region scope can be specified. Only ops within the scope are simplified. This is similar to applyPatternsGreedily, where only ops within the given region/op are simplified by default. If no scope is specified, it is assumed to be the first common enclosing region of the given ops.

Note that ops in ops could be erased as result of folding, becoming dead, or via pattern rewrites. If more far reaching simplification is desired, applyPatternsGreedily should be used.

Returns "success" if the iterative process converged (i.e., fixpoint was reached) and no more patterns can be matched. changed is set to "true" if the IR was modified at all. allOpsErased is set to "true" if all ops in ops were erased.

Definition at line 1015 of file GreedyPatternRewriteDriver.cpp.

References changed, config, findCommonAncestor(), patterns, and verify().

Referenced by mlir::affine::affineForOpBodySkew(), applyPatterns(), and mlir::affine::hoistAffineIfOp().

◆ applyPartialConversion() [1/2]

LogicalResult mlir::applyPartialConversion ( ArrayRef< Operation * >  ops,
const ConversionTarget target,
const FrozenRewritePatternSet patterns,
ConversionConfig  config = ConversionConfig() 
)

Below we define several entry points for operation conversion.

It is important to note that the patterns provided to the conversion framework may have additional constraints. See the PatternRewriter Hooks section of the ConversionPatternRewriter, to see what additional constraints are imposed on the use of the PatternRewriter. Apply a partial conversion on the given operations and all nested operations. This method converts as many operations to the target as possible, ignoring operations that failed to legalize. This method only returns failure if there ops explicitly marked as illegal.

Definition at line 3401 of file DialectConversion.cpp.

References config, mlir::OperationConverter::convertOperations(), and patterns.

Referenced by applyPartialConversion().

◆ applyPartialConversion() [2/2]

LogicalResult mlir::applyPartialConversion ( Operation op,
const ConversionTarget target,
const FrozenRewritePatternSet patterns,
ConversionConfig  config = ConversionConfig() 
)

Definition at line 3409 of file DialectConversion.cpp.

References applyPartialConversion(), config, and patterns.

◆ applyPartialOneToNConversion()

LogicalResult mlir::applyPartialOneToNConversion ( Operation op,
TypeConverter typeConverter,
const FrozenRewritePatternSet patterns 
)

Applies the given set of patterns recursively on the given op and adds user materializations where necessary.

The patterns are expected to be OneToNConversionPattern, which help converting the types of the operands and results of the matched ops. The provided type converter is used to convert the operands of matched ops from their original types to operands with different types. Unlike in DialectConversion, this supports 1:N type conversions. Those conversions at the "boundary" of the pattern application, where converted results are not consumed by replaced ops that expect the converted operands or vice versa, the function inserts user materializations from the type converter. Also unlike DialectConversion, there are no legal or illegal types; the function simply applies the given patterns and does not fail if some ops or types remain unconverted (i.e., the conversion is only "partial").

Definition at line 307 of file OneToNTypeConversion.cpp.

References applyPatternsGreedily(), castKindAttrName, emitError(), getCastKindName(), mlir::Operation::getContext(), mlir::Operation::getLoc(), mlir::ValueRange::getTypes(), mlir::TypeConverter::isLegal(), mlir::TypeConverter::materializeArgumentConversion(), mlir::TypeConverter::materializeSourceConversion(), mlir::TypeConverter::materializeTargetConversion(), patterns, mlir::RewriterBase::replaceOp(), mlir::OpBuilder::setInsertionPoint(), and mlir::Operation::walk().

◆ applyPassManagerCLOptions()

LogicalResult mlir::applyPassManagerCLOptions ( PassManager pm)

Apply any values provided to the pass manager options that were registered with 'registerPassManagerOptions'.

Definition at line 145 of file PassManagerOptions.cpp.

References emitError(), mlir::PassManager::enableCrashReproducerGeneration(), mlir::PassManager::enableStatistics(), get(), mlir::PassManager::getContext(), mlir::MLIRContext::isMultithreadingEnabled(), and options.

Referenced by performActions().

◆ applyPatternsAndFoldGreedily() [1/2]

LogicalResult mlir::applyPatternsAndFoldGreedily ( Operation op,
const FrozenRewritePatternSet patterns,
GreedyRewriteConfig  config = GreedyRewriteConfig(),
bool *  changed = nullptr 
)
inline

Same as applyPatternsGreedily above with folding.

FIXME: Remove this once transition to above is complieted.

Definition at line 186 of file GreedyPatternRewriteDriver.h.

References applyPatternsGreedily(), changed, config, and patterns.

◆ applyPatternsAndFoldGreedily() [2/2]

LogicalResult mlir::applyPatternsAndFoldGreedily ( Region region,
const FrozenRewritePatternSet patterns,
GreedyRewriteConfig  config = GreedyRewriteConfig(),
bool *  changed = nullptr 
)
inline

Same as applyPatternsAndGreedily above with folding.

FIXME: Remove this once transition to above is complieted.

Definition at line 134 of file GreedyPatternRewriteDriver.h.

References applyPatternsGreedily(), changed, config, and patterns.

◆ applyPatternsGreedily() [1/2]

LogicalResult mlir::applyPatternsGreedily ( Operation op,
const FrozenRewritePatternSet patterns,
GreedyRewriteConfig  config = GreedyRewriteConfig(),
bool *  changed = nullptr 
)
inline

Rewrite ops nested under the given operation, which must be isolated from above, by repeatedly applying the highest benefit patterns in a greedy worklist driven manner until a fixpoint is reached.

The greedy rewrite may prematurely stop after a maximum number of iterations, which can be configured in the configuration parameter.

Also performs simple dead-code elimination before attempting to match any of the provided patterns.

This overload runs a separate greedy rewrite for each region of the specified op. A region scope can be set in the configuration parameter. By default, the scope is set to the region of the current greedy rewrite. Only in-scope ops are added to the worklist and only in-scope ops and the specified op itself are allowed to be modified by the patterns.

Note: The specified op may be modified, but it may not be removed by the patterns.

Returns "success" if the iterative process converged (i.e., fixpoint was reached) and no more patterns can be matched within the region. changed is set to "true" if the IR was modified at all.

Note: This method does not apply patterns to the given operation itself.

Definition at line 167 of file GreedyPatternRewriteDriver.h.

References applyPatternsGreedily(), changed, config, mlir::Operation::getRegions(), and patterns.

◆ applyPatternsGreedily() [2/2]

LogicalResult mlir::applyPatternsGreedily ( Region region,
const FrozenRewritePatternSet patterns,
GreedyRewriteConfig  config = GreedyRewriteConfig(),
bool *  changed = nullptr 
)

Rewrite ops in the given region, which must be isolated from above, by repeatedly applying the highest benefit patterns in a greedy worklist driven manner until a fixpoint is reached.

The greedy rewrite may prematurely stop after a maximum number of iterations, which can be configured in the configuration parameter.

Also performs simple dead-code elimination before attempting to match any of the provided patterns.

A region scope can be set in the configuration parameter. By default, the scope is set to the specified region. Only in-scope ops are added to the worklist and only in-scope ops are allowed to be modified by the patterns.

Returns "success" if the iterative process converged (i.e., fixpoint was reached) and no more patterns can be matched within the region. changed is set to "true" if the IR was modified at all.

Note: This method does not apply patterns to the region's parent operation.

Definition at line 897 of file GreedyPatternRewriteDriver.cpp.

References changed, config, mlir::Region::getContext(), mlir::Region::getParentOp(), mlir::Operation::hasTrait(), patterns, and verify().

Referenced by applyPartialOneToNConversion(), applyPatternsAndFoldGreedily(), applyPatternsGreedily(), mlir::affine::hoistAffineIfOp(), mlirApplyPatternsAndFoldGreedily(), mlir::spirv::unrollVectorsInFuncBodies(), and mlir::spirv::unrollVectorsInSignatures().

◆ applyPermutation() [1/2]

template<typename T >
SmallVector<T> mlir::applyPermutation ( ArrayRef< T >  input,
ArrayRef< int64_t >  permutation 
)

◆ applyPermutation() [2/2]

template<typename T >
SmallVector<T> mlir::applyPermutation ( const SmallVectorImpl< T > &  input,
ArrayRef< int64_t >  permutation 
)

Definition at line 215 of file IndexingUtils.h.

References applyPermutation().

◆ applyPermutationMap()

template<typename T >
SmallVector<T> mlir::applyPermutationMap ( AffineMap  map,
llvm::ArrayRef< T >  source 
)

Apply a permutation from map to source and return the result.

Definition at line 675 of file AffineMap.h.

References mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getResults(), and mlir::AffineMap::isProjectedPermutation().

Referenced by mlir::vector::inferTransferOpMaskType().

◆ applyPermutationToVector()

template<typename T , unsigned N>
void mlir::applyPermutationToVector ( SmallVector< T, N > &  inVec,
ArrayRef< int64_t >  permutation 
)

Apply the permutation defined by permutation to inVec.

Element i in inVec is mapped to location j = permutation[i]. E.g.: for an input vector ‘inVec = ['a’, 'b', 'c']and a permutation vectorpermutation = [2, 0, 1], this function leavesinVec = ['c', 'a', 'b']`.

Definition at line 226 of file IndexingUtils.h.

References applyPermutation().

Referenced by commonPermutationOfPackAndUnPackOp(), computePackUnPackPerm(), mlir::tensor::computeTransposedType(), getPackOpResultTypeShape(), mlir::linalg::lowerPack(), mlir::linalg::lowerUnPack(), permuteShape(), tileLinalgOpImpl(), mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl(), mlir::scf::tileUsingSCF(), vectorizeAsTensorPackOp(), and vectorizeAsTensorUnpackOp().

◆ areAllConstantIntValue()

bool mlir::areAllConstantIntValue ( ArrayRef< OpFoldResult ofrs,
int64_t  value 
)

Return true if all of ofrs are constant integers equal to value.

Definition at line 154 of file StaticValueUtils.cpp.

References isConstantIntValue().

◆ areConstantIntValues()

bool mlir::areConstantIntValues ( ArrayRef< OpFoldResult ofrs,
ArrayRef< int64_t >  values 
)

Return true if all of ofrs are constant integers equal to the corresponding value in values.

Definition at line 159 of file StaticValueUtils.cpp.

References getConstantIntValues().

◆ areValuesDefinedAbove()

template<typename Range >
bool mlir::areValuesDefinedAbove ( Range  values,
Region limit 
)

Check if all values in the provided range are defined above the limit region.

That is, if they are defined in a region that is a proper ancestor of limit.

Definition at line 24 of file RegionUtils.h.

Referenced by checkAffineLoopNestMappableImpl(), mlir::affine::coalescePerfectlyNestedAffineLoops(), and coalescePerfectlyNestedSCFForLoops().

◆ asMainReturnCode()

int mlir::asMainReturnCode ( LogicalResult  r)
inline

Helper wrapper to return the result of MlirOptMain directly from main.

Example:

int main(int argc, char **argv) {
  // ...
  return mlir::asMainReturnCode(mlir::MlirOptMain(
      argc, argv, /* ... *&zwj;/);
}

Definition at line 347 of file MlirOptMain.h.

◆ barePtrFuncArgTypeConverter()

LogicalResult mlir::barePtrFuncArgTypeConverter ( const LLVMTypeConverter converter,
Type  type,
SmallVectorImpl< Type > &  result 
)

Callback to convert function argument types.

It converts MemRef function arguments to bare pointers to the MemRef element type.

Definition at line 761 of file TypeConverter.cpp.

References mlir::LLVMTypeConverter::convertCallingConventionType().

◆ bindDims()

template<typename... AffineExprTy>
void mlir::bindDims ( MLIRContext ctx,
AffineExprTy &...  exprs 
)

◆ bindDimsList()

template<typename AffineExprTy >
void mlir::bindDimsList ( MLIRContext ctx,
MutableArrayRef< AffineExprTy >  exprs 
)

Definition at line 353 of file AffineExpr.h.

References getAffineDimExpr().

◆ bindSymbols()

template<typename... AffineExprTy>
void mlir::bindSymbols ( MLIRContext ctx,
AffineExprTy &...  exprs 
)

◆ bindSymbolsList()

template<typename AffineExprTy >
void mlir::bindSymbolsList ( MLIRContext ctx,
MutableArrayRef< AffineExprTy >  exprs 
)

◆ canonicalizeStridedLayout()

MemRefType mlir::canonicalizeStridedLayout ( MemRefType  t)

Return a version of t with identity layout if it can be determined statically that the layout is the canonical contiguous strided layout.

Otherwise pass t's layout into simplifyAffineMap and return a copy of t with simplified layout.

Otherwise pass t's layout into simplifyAffineMap and return a copy of t with simplified layout. If t has multiple layout maps or a multi-result layout, just return t.

Definition at line 875 of file BuiltinTypes.cpp.

Referenced by dropUnitDims(), and rankReducingSubviewDroppingUnitDims().

◆ clone() [1/2]

Operation * mlir::clone ( OpBuilder b,
Operation op,
TypeRange  newResultTypes,
ValueRange  newOperands 
)

◆ clone() [2/2]

template<typename OpT >
OpT mlir::clone ( OpBuilder b,
OpT  op,
TypeRange  newResultTypes,
ValueRange  newOperands 
)

Definition at line 145 of file StructuredOpsUtils.h.

References clone().

◆ cloneWithoutRegions()

Operation * mlir::cloneWithoutRegions ( OpBuilder b,
Operation op,
TypeRange  newResultTypes,
ValueRange  newOperands 
)

Definition at line 209 of file StructuredOpsUtils.cpp.

Referenced by mlirRewriterBaseCloneWithoutRegions().

◆ coalesceLoops() [1/2]

LogicalResult mlir::coalesceLoops ( MutableArrayRef< scf::ForOp >  loops)

Replace a perfect nest of "for" loops with a single linearized loop.

Assumes loops contains a list of perfectly nested loops with bounds and steps independent of any loop induction variable involved in the nest.

Definition at line 978 of file Utils.cpp.

Referenced by coalescePerfectlyNestedSCFForLoops().

◆ coalesceLoops() [2/2]

LogicalResult mlir::coalesceLoops ( RewriterBase rewriter,
MutableArrayRef< scf::ForOp >  loops 
)

◆ coalescePerfectlyNestedSCFForLoops()

LogicalResult mlir::coalescePerfectlyNestedSCFForLoops ( scf::ForOp  op)

Walk an affine.for to find a band to coalesce.

Definition at line 986 of file Utils.cpp.

References areValuesDefinedAbove(), coalesceLoops(), and getPerfectlyNestedLoops().

◆ collapseParallelLoops()

void mlir::collapseParallelLoops ( RewriterBase rewriter,
scf::ParallelOp  loops,
ArrayRef< std::vector< unsigned >>  combinedDimensions 
)

Take the ParallelLoop and for each set of dimension indices, combine them into a single dimension.

combinedDimensions must contain each index into loops exactly once.

Definition at line 1061 of file Utils.cpp.

References mlir::OpBuilder::create(), denormalizeInductionVariable(), emitNormalizedLoopBounds(), mlir::Operation::erase(), getValueOrCreateConstantIntOp(), replaceAllUsesInRegionWith(), mlir::OpBuilder::setInsertionPoint(), and mlir::OpBuilder::setInsertionPointToStart().

◆ composeReassociationIndices()

std::optional< SmallVector< ReassociationIndices > > mlir::composeReassociationIndices ( ArrayRef< ReassociationIndices producerReassociations,
ArrayRef< ReassociationIndices consumerReassociations,
MLIRContext context 
)

Compose reassociation maps that are used in pair of reshape ops where one is a producer and other is the consumer.

Only valid to use this method when both the producer and consumer are collapsing dimensions or both are expanding dimensions.

For example, producerReassociation = [[0, 1], [2], [3, 4]] consumerReassociation = [[0, 1], [2]]

is folded into

result = [[0, 1, 2], [3, 4]].

Definition at line 97 of file ReshapeOpsUtils.cpp.

Referenced by mlir::ComposeReassociativeReshapeOps< ReshapeOpTy, opKind >::matchAndRewrite().

◆ compressDims()

AffineMap mlir::compressDims ( AffineMap  map,
const llvm::SmallBitVector &  unusedDims 
)

Drop the dims that are listed in unusedDims.

Definition at line 717 of file AffineMap.cpp.

References projectDims().

Referenced by compressUnusedDims().

◆ compressSymbols()

AffineMap mlir::compressSymbols ( AffineMap  map,
const llvm::SmallBitVector &  unusedSymbols 
)

Drop the symbols that are listed in unusedSymbols.

Definition at line 731 of file AffineMap.cpp.

References projectSymbols().

Referenced by compressUnusedSymbols().

◆ compressUnusedDims() [1/2]

AffineMap mlir::compressUnusedDims ( AffineMap  map)

Drop the dims that are not used.

Definition at line 722 of file AffineMap.cpp.

References compressDims(), and getUnusedDimsBitVector().

Referenced by mlir::vector::inferTransferOpMaskType(), and reindexIndexingMap().

◆ compressUnusedDims() [2/2]

SmallVector< AffineMap > mlir::compressUnusedDims ( ArrayRef< AffineMap maps)

Drop the dims that are not used by any of the individual maps in maps.

Asserts that all maps in maps are normalized to the same number of dims and symbols.

Definition at line 726 of file AffineMap.cpp.

References compressUnusedListImpl().

◆ compressUnusedSymbols() [1/2]

AffineMap mlir::compressUnusedSymbols ( AffineMap  map)

Drop the symbols that are not used.

Definition at line 736 of file AffineMap.cpp.

References compressSymbols(), and getUnusedSymbolsBitVector().

Referenced by getProjectedMap().

◆ compressUnusedSymbols() [2/2]

SmallVector< AffineMap > mlir::compressUnusedSymbols ( ArrayRef< AffineMap maps)

Drop the symbols that are not used by any of the individual maps in maps.

Asserts that all maps in maps are normalized to the same number of dims and symbols.

Definition at line 740 of file AffineMap.cpp.

References compressUnusedListImpl().

◆ computeElementwiseMul() [1/2]

SmallVector< AffineExpr > mlir::computeElementwiseMul ( ArrayRef< AffineExpr v1,
ArrayRef< AffineExpr v2 
)

Return a vector containing llvm::zip_equal(v1, v2) multiplied elementwise.

It is the caller's responsibility to pass proper AffineExpr kind that result in valid AffineExpr (i.e. cannot multiply 2 AffineDimExpr or divide by an AffineDimExpr).

Return an empty vector if v1 and v2 are empty.

Definition at line 154 of file IndexingUtils.cpp.

References computeElementwiseMulImpl().

◆ computeElementwiseMul() [2/2]

SmallVector< int64_t > mlir::computeElementwiseMul ( ArrayRef< int64_t >  v1,
ArrayRef< int64_t >  v2 
)

Return a vector containing llvm::zip_equal(v1, v2) multiplied elementwise.

Return an empty vector if v1 and v2 are empty.

Definition at line 78 of file IndexingUtils.cpp.

References computeElementwiseMulImpl().

Referenced by mlir::detail::TileOffsetRangeImpl::getDynamicTileOffsets(), and mlir::detail::TileOffsetRangeImpl::getStaticTileOffsets().

◆ computeLinearIndex() [1/2]

std::pair< AffineExpr, SmallVector< OpFoldResult > > mlir::computeLinearIndex ( OpFoldResult  sourceOffset,
ArrayRef< int64_t >  strides,
ArrayRef< Value indices 
)

◆ computeLinearIndex() [2/2]

std::pair< AffineExpr, SmallVector< OpFoldResult > > mlir::computeLinearIndex ( OpFoldResult  sourceOffset,
ArrayRef< OpFoldResult strides,
ArrayRef< OpFoldResult indices 
)

Compute linear index from provided strides and indices, assuming strided layout.

Returns AffineExpr and list of values to apply to it, e.g.:

auto &&[expr, values] = computeLinearIndex(...); offset = affine::makeComposedFoldedAffineApply(builder, loc, expr, values);

Definition at line 304 of file IndexingUtils.cpp.

References bindSymbolsList(), and getContext().

Referenced by computeLinearIndex(), getCollapsedIndices(), getFlatOffsetAndStrides(), and mlir::affine::linearizeIndex().

◆ computeMaxLinearIndex() [1/2]

int64_t mlir::computeMaxLinearIndex ( ArrayRef< int64_t >  basis)
inline

Return the number of elements of basis (i.e.

the max linear index). Return 0 if basis is empty.

basis elements are asserted to be non-negative.

Return 0 if basis is empty.

Definition at line 69 of file IndexingUtils.h.

References computeProduct().

Referenced by handleMultidimensionalVectors(), and mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl().

◆ computeMaxLinearIndex() [2/2]

AffineExpr mlir::computeMaxLinearIndex ( MLIRContext ctx,
ArrayRef< AffineExpr basis 
)
inline

Return the number of elements of basis (i.e.

the max linear index). Return 0 if basis is empty.

It is the caller's responsibility to pass proper AffineExpr kind that result in valid AffineExpr (i.e. cannot multiply 2 AffineDimExpr or divide by an AffineDimExpr).

basis elements are expected to bind to non-negative values.

Return the 0 AffineConstantExpr if basis is empty.

Definition at line 159 of file IndexingUtils.h.

References computeProduct().

◆ computePermutationVector()

SmallVector< int64_t > mlir::computePermutationVector ( int64_t  permSize,
ArrayRef< int64_t >  positions,
ArrayRef< int64_t >  desiredPositions 
)

Return a permutation vector of size permSize that would result in moving positions into desiredPositions.

For example, permSize == 5, positions = {2, 4}, desiredPositions = {1, 0} would result in a {4, 2, 0, 1, 3} permutation vector.

Definition at line 235 of file IndexingUtils.cpp.

Referenced by computePackUnPackPerm(), and mlir::linalg::packMatmulGreedily().

◆ computeProduct() [1/2]

int64_t mlir::computeProduct ( ArrayRef< int64_t >  basis)

◆ computeProduct() [2/2]

AffineExpr mlir::computeProduct ( MLIRContext ctx,
ArrayRef< AffineExpr basis 
)

Self-explicit.

Definition at line 167 of file IndexingUtils.cpp.

References getAffineConstantExpr().

◆ computeRankReductionMask()

std::optional< llvm::SmallDenseSet< unsigned > > mlir::computeRankReductionMask ( ArrayRef< int64_t >  originalShape,
ArrayRef< int64_t >  reducedShape,
bool  matchDynamic = false 
)

Given an originalShape and a reducedShape assumed to be a subset of originalShape with some 1 entries erased, return the set of indices that specifies which of the entries of originalShape are dropped to obtain reducedShape.

The returned mask can be applied as a projection to originalShape to obtain the reducedShape. This mask is useful to track which dimensions must be kept when e.g. compute MemRef strides under rank-reducing operations. Return std::nullopt if reducedShape cannot be obtained by dropping only 1 entries in originalShape. If matchDynamic is true, then dynamic dims in originalShape and reducedShape will be considered matching with non-dynamic dims, unless the non-dynamic dim is from originalShape and equal to 1. For example, in ([1, 3, ?], [?, 5]), the mask would be {1, 0, 0}, since 3 and 5 will match with the corresponding dynamic dims.

Definition at line 423 of file BuiltinTypes.cpp.

Referenced by isRankReducedType().

◆ computeShapeRatio()

std::optional< SmallVector< int64_t > > mlir::computeShapeRatio ( ArrayRef< int64_t >  shape,
ArrayRef< int64_t >  subShape 
)

Return the multi-dimensional integral ratio of subShape to the trailing dimensions of shape.

This represents how many times subShape fits within shape. If integral division is not possible, return std::nullopt. The trailing subShape.size() entries of both shapes are assumed (and enforced) to only contain non-negative values.

Examples:

  • shapeRatio({3, 5, 8}, {2, 5, 2}) returns {3, 2, 1}.
  • shapeRatio({3, 8}, {2, 5, 2}) returns std::nullopt (subshape has higher rank).
  • shapeRatio({42, 2, 10, 32}, {2, 5, 2}) returns {42, 1, 2, 16} which is derived as {42(leading shape dim), 2/2, 10/5, 32/2}.
  • shapeRatio({42, 2, 11, 32}, {2, 5, 2}) returns std::nullopt which is derived as {42(leading shape dim), 2/2, 11/5(not divisible), 32/2}.

Definition at line 116 of file IndexingUtils.cpp.

References copy().

Referenced by getTargetShape(), and mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl().

◆ computeStrides() [1/2]

SmallVector<AffineExpr> mlir::computeStrides ( ArrayRef< AffineExpr sizes)
inline

Definition at line 129 of file IndexingUtils.h.

References computeSuffixProduct().

◆ computeStrides() [2/2]

SmallVector<int64_t> mlir::computeStrides ( ArrayRef< int64_t >  sizes)
inline

◆ computeSuffixProduct() [1/2]

SmallVector< AffineExpr > mlir::computeSuffixProduct ( ArrayRef< AffineExpr sizes)

Given a set of sizes, return the suffix product.

When applied to slicing, this is the calculation needed to derive the strides (i.e. the number of linear indices to skip along the (k-1) most minor dimensions to get the next k-slice).

This is the basis to linearize an n-D offset confined to [0 ... sizes].

Assuming sizes is [s0, .. sn], return the vector<AffineExpr> [s1 * ... * sn, s2 * ... * sn, ..., sn, 1].

It is the caller's responsibility to pass proper AffineExpr kind that result in valid AffineExpr (i.e. cannot multiply 2 AffineDimExpr or divide by an AffineDimExpr).

sizes elements are expected to bind to non-negative values.

Return an empty vector if sizes is empty.

Definition at line 147 of file IndexingUtils.cpp.

References computeSuffixProductImpl(), and getAffineConstantExpr().

◆ computeSuffixProduct() [2/2]

SmallVector< int64_t > mlir::computeSuffixProduct ( ArrayRef< int64_t >  sizes)

Given a set of sizes, return the suffix product.

When applied to slicing, this is the calculation needed to derive the strides (i.e. the number of linear indices to skip along the (k-1) most minor dimensions to get the next k-slice).

This is the basis to linearize an n-D offset confined to [0 ... sizes].

Assuming sizes is [s0, .. sn], return the vector<int64_t> [s1 * ... * sn, s2 * ... * sn, ..., sn, 1].

sizes elements are asserted to be non-negative.

Return an empty vector if sizes is empty.

Definition at line 71 of file IndexingUtils.cpp.

References computeSuffixProductImpl().

Referenced by computeStrides(), getCollapsedIndices(), and resolveSourceIndicesCollapseShape().

◆ computeSum() [1/2]

int64_t mlir::computeSum ( ArrayRef< int64_t >  basis)

Self-explicit.

Definition at line 83 of file IndexingUtils.cpp.

Referenced by HopperBuilder::buildBarrierArriveTx().

◆ computeSum() [2/2]

AffineExpr mlir::computeSum ( MLIRContext ctx,
ArrayRef< AffineExpr basis 
)

Self-explicit.

Definition at line 159 of file IndexingUtils.cpp.

References getAffineConstantExpr().

◆ computeTopologicalSorting()

bool mlir::computeTopologicalSorting ( MutableArrayRef< Operation * >  ops,
function_ref< bool(Value, Operation *)>  isOperandReady = nullptr 
)

Compute a topological ordering of the given ops.

This sort is not stable.

Note: If the specified ops contain incomplete/interrupted SSA use-def chains, the result may not actually be a topological sorting with respect to the entire program.

Definition at line 112 of file TopologicalSortUtils.cpp.

References isOpReady().

Referenced by makeRegionIsolatedFromAbove().

◆ concatAffineMaps()

AffineMap mlir::concatAffineMaps ( ArrayRef< AffineMap maps,
MLIRContext context 
)

Concatenates a list of maps into a single AffineMap, stepping over potentially empty maps.

Assumes each of the underlying map has 0 symbols. The resulting map has a number of dims equal to the max of maps' dims and the concatenated results as its results. Returns an empty map if all input maps are empty.

Example: When applied to the following list of 3 affine maps,

{
(i, j, k) -> (i, k),
(i, j, k) -> (k, j),
(i, j, k) -> (i, j)
}

Returns the map:

(i, j, k) -> (i, k, k, j, i, j)

Definition at line 836 of file AffineMap.cpp.

References mlir::AffineMap::get().

Referenced by mlir::linalg::detail::canOpOperandsBeDroppedImpl(), mlir::linalg::dropUnitDims(), and isOpOperandCanBeDroppedAfterFusedLinalgs().

◆ configureAMXLegalizeForExportTarget()

void mlir::configureAMXLegalizeForExportTarget ( LLVMConversionTarget target)

Configure the target to support lowering AMX ops to ops that map to LLVM intrinsics.

Definition at line 220 of file LegalizeForLLVMExport.cpp.

References mlir::ConversionTarget::addIllegalOp(), and mlir::ConversionTarget::addLegalOp().

◆ configureArmSMEToLLVMConversionLegality()

void mlir::configureArmSMEToLLVMConversionLegality ( ConversionTarget target)

Configure target to convert from the ArmSME dialect to LLVM intrinsics.

Definition at line 941 of file ArmSMEToLLVM.cpp.

References mlir::ConversionTarget::addIllegalDialect(), mlir::ConversionTarget::addLegalDialect(), and mlir::ConversionTarget::addLegalOp().

◆ configureArmSVELegalizeForExportTarget()

void mlir::configureArmSVELegalizeForExportTarget ( LLVMConversionTarget target)

Configure the target to support lowering ArmSVE ops to ops that map to LLVM intrinsics.

Definition at line 235 of file LegalizeForLLVMExport.cpp.

References mlir::ConversionTarget::addIllegalOp(), and mlir::ConversionTarget::addLegalOp().

◆ configureGpuToNVVMConversionLegality()

void mlir::configureGpuToNVVMConversionLegality ( ConversionTarget target)

◆ configureGpuToNVVMTypeConverter()

void mlir::configureGpuToNVVMTypeConverter ( LLVMTypeConverter converter)

Configure the LLVM type convert to convert types and address spaces from the GPU dialect to NVVM.

Definition at line 315 of file LowerGpuOpsToNVVMOps.cpp.

References mlir::TypeConverter::addConversion(), convertMMAToLLVMType(), mlir::NVVM::kGlobalMemorySpace, kSharedMemorySpace, and populateGpuMemorySpaceAttributeConversions().

◆ configureGpuToROCDLConversionLegality()

void mlir::configureGpuToROCDLConversionLegality ( ConversionTarget target)

◆ configureOpenMPToLLVMConversionLegality()

void mlir::configureOpenMPToLLVMConversionLegality ( ConversionTarget target,
const LLVMTypeConverter typeConverter 
)

Configure dynamic conversion legality of regionless operations from OpenMP to LLVM.

Definition at line 224 of file OpenMPToLLVM.cpp.

References mlir::ConversionTarget::addDynamicallyLegalOp(), and mlir::TypeConverter::isLegal().

◆ configureParallelLoopToGPULegality()

void mlir::configureParallelLoopToGPULegality ( ConversionTarget target)

Configures the rewrite target such that only scf.parallel operations that are not rewritten by the provided patterns are legal.

Definition at line 679 of file SCFToGPU.cpp.

References mlir::ConversionTarget::addDynamicallyLegalOp(), mlir::ConversionTarget::addLegalDialect(), mlir::gpu::getMappingAttrName(), and kVisitedAttrName.

◆ configureX86VectorLegalizeForExportTarget()

void mlir::configureX86VectorLegalizeForExportTarget ( LLVMConversionTarget target)

Configure the target to support lowering X86Vector ops to ops that map to LLVM intrinsics.

Definition at line 168 of file LegalizeForLLVMExport.cpp.

References mlir::ConversionTarget::addIllegalOp(), and mlir::ConversionTarget::addLegalOp().

◆ constantTripCount()

std::optional< int64_t > mlir::constantTripCount ( OpFoldResult  lb,
OpFoldResult  ub,
OpFoldResult  step 
)

Return the number of iterations for a loop with a lower bound lb, upper bound ub and step step.

Definition at line 263 of file StaticValueUtils.cpp.

References getConstantIntValue().

◆ constFoldBinaryOp() [1/2]

template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<ElementValueT(ElementValueT, ElementValueT)>>
Attribute mlir::constFoldBinaryOp ( ArrayRef< Attribute operands,
CalculationT &&  calculate 
)

Definition at line 179 of file CommonFolders.h.

◆ constFoldBinaryOp() [2/2]

template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = void, class CalculationT = function_ref<ElementValueT(ElementValueT, ElementValueT)>>
Attribute mlir::constFoldBinaryOp ( ArrayRef< Attribute operands,
Type  resultType,
CalculationT &&  calculate 
)

Definition at line 165 of file CommonFolders.h.

◆ constFoldBinaryOpConditional() [1/2]

template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref< std::optional<ElementValueT>(ElementValueT, ElementValueT)>>
Attribute mlir::constFoldBinaryOpConditional ( ArrayRef< Attribute operands,
CalculationT &&  calculate 
)

Performs constant folding calculate with element-wise behavior on the two attributes in operands and returns the result if possible.

Uses the operand element type for the element type of the returned attribute. Optional PoisonAttr template argument allows to specify 'poison' attribute which will be directly propagated to result.

Definition at line 127 of file CommonFolders.h.

References constFoldBinaryOpConditional().

◆ constFoldBinaryOpConditional() [2/2]

template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref< std::optional<ElementValueT>(ElementValueT, ElementValueT)>>
Attribute mlir::constFoldBinaryOpConditional ( ArrayRef< Attribute operands,
Type  resultType,
CalculationT &&  calculate 
)

Performs constant folding calculate with element-wise behavior on the two attributes in operands and returns the result if possible.

Uses resultType for the type of the returned attribute. Optional PoisonAttr template argument allows to specify 'poison' attribute which will be directly propagated to result.

Definition at line 38 of file CommonFolders.h.

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

Referenced by constFoldBinaryOpConditional().

◆ constFoldCastOp()

template<class AttrElementT , class TargetAttrElementT , class ElementValueT = typename AttrElementT::ValueType, class TargetElementValueT = typename TargetAttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<TargetElementValueT(ElementValueT, bool)>>
Attribute mlir::constFoldCastOp ( ArrayRef< Attribute operands,
Type  resType,
CalculationT &&  calculate 
)

Definition at line 269 of file CommonFolders.h.

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

◆ constFoldUnaryOp()

template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<ElementValueT(ElementValueT)>>
Attribute mlir::constFoldUnaryOp ( ArrayRef< Attribute operands,
CalculationT &&  calculate 
)

Definition at line 255 of file CommonFolders.h.

◆ constFoldUnaryOpConditional()

template<class AttrElementT , class ElementValueT = typename AttrElementT::ValueType, class PoisonAttr = ub::PoisonAttr, class CalculationT = function_ref<std::optional<ElementValueT>(ElementValueT)>>
Attribute mlir::constFoldUnaryOpConditional ( ArrayRef< Attribute operands,
CalculationT &&  calculate 
)

Performs constant folding calculate with element-wise behavior on the one attributes in operands and returns the result if possible.

Optional PoisonAttr template argument allows to specify 'poison' attribute which will be directly propagated to result.

Definition at line 197 of file CommonFolders.h.

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

◆ controlFlowSink()

size_t mlir::controlFlowSink ( RegionRange  regions,
DominanceInfo domInfo,
function_ref< bool(Operation *, Region *)>  shouldMoveIntoRegion,
function_ref< void(Operation *, Region *)>  moveIntoRegion 
)

Given a list of regions, perform control flow sinking on them.

For each region, control-flow sinking moves operations that dominate the region but whose only users are in the region into the regions so that they aren't executed on paths where their results are not needed.

TODO: For the moment, this is a simple control-flow sink, i.e., no duplicating of ops. It should be made to accept a cost model to determine whether duplicating a particular op is profitable.

Example:

%0 = arith.addi %arg0, %arg1
scf.if %cond {
scf.yield %0
} else {
scf.yield %arg2
}

After control-flow sink:

scf.if %cond {
%0 = arith.addi %arg0, %arg1
scf.yield %0
} else {
scf.yield %arg2
}

Users must supply a callback shouldMoveIntoRegion that determines whether the given operation that only has users in the given operation should be moved into that region. If this returns true, moveIntoRegion is called on the same operation and region.

moveIntoRegion must move the operation into the region such that dominance of the operation is preserved; for example, by moving the operation to the start of the entry block. This ensures the preservation of SSA dominance of the operation's results.

Returns the number of operations sunk.

Definition at line 127 of file ControlFlowSinkUtils.cpp.

◆ convertAffineLoopNestToGPULaunch()

LogicalResult mlir::convertAffineLoopNestToGPULaunch ( affine::AffineForOp  forOp,
unsigned  numBlockDims,
unsigned  numThreadDims 
)

Convert a perfect affine loop nest with the outermost loop identified by forOp into a gpu::Launch operation.

Map numBlockDims outer loops to GPU blocks and numThreadDims to GPU threads. The bounds of the loops that are mapped should be independent of the induction variables of the other mapped loops.

No check on the size of the block or grid, or on the validity of parallelization is performed, it is under the responsibility of the caller to strip-mine the loops and to perform the dependence analysis before calling the conversion.

◆ convertFromAttribute() [1/9]

LogicalResult mlir::convertFromAttribute ( bool &  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Extract the boolean from attr into storage.

If attr is not a BoolAttr, return failure and emit an error into the diagnostic from emitError.

Definition at line 67 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [2/9]

LogicalResult mlir::convertFromAttribute ( int32_t &  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Convert an IntegerAttr attribute to an int32_t, or return an error if the attribute isn't an IntegerAttr.

If the optional diagnostic is provided an error message is also emitted.

Definition at line 37 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [3/9]

LogicalResult mlir::convertFromAttribute ( int64_t &  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Convert an IntegerAttr attribute to an int64_t, or return an error if the attribute isn't an IntegerAttr.

If the optional diagnostic is provided an error message is also emitted.

Definition at line 22 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [4/9]

static LogicalResult mlir::convertFromAttribute ( IntegerOverflowFlags &  flags,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)
static

Definition at line 66 of file LLVMDialect.cpp.

References emitError().

◆ convertFromAttribute() [5/9]

LogicalResult mlir::convertFromAttribute ( MutableArrayRef< int32_t >  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Convert a DenseI32ArrayAttr to the provided storage.

It is expected that the storage has the same size as the array. An error is returned if the attribute isn't a DenseI32ArrayAttr or it does not have the same size. If the optional diagnostic is provided an error message is also emitted.

Definition at line 105 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [6/9]

LogicalResult mlir::convertFromAttribute ( MutableArrayRef< int64_t >  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Convert a DenseI64ArrayAttr to the provided storage.

It is expected that the storage has the same size as the array. An error is returned if the attribute isn't a DenseI64ArrayAttr or it does not have the same size. If the optional diagnostic is provided an error message is also emitted.

Definition at line 99 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [7/9]

LogicalResult mlir::convertFromAttribute ( SmallVectorImpl< int32_t > &  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Convert a DenseI32ArrayAttr to the provided storage, which will be cleared before writing.

It is expected that the storage has the same size as the array. An error is returned and emitted to the optional emitError function if the attribute isn't a DenseI32ArrayAttr.

Definition at line 132 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [8/9]

LogicalResult mlir::convertFromAttribute ( SmallVectorImpl< int64_t > &  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Convert a DenseI64ArrayAttr to the provided storage, which will be cleared before writing.

An error is returned and emitted to the optional emitError function if the attribute isn't a DenseI64ArrayAttr.

Definition at line 126 of file ODSSupport.cpp.

References emitError().

◆ convertFromAttribute() [9/9]

LogicalResult mlir::convertFromAttribute ( std::string &  storage,
Attribute  attr,
function_ref< InFlightDiagnostic()>  emitError 
)

Extract the string from attr into storage.

If attr is not a StringAttr, return failure and emit an error into the diagnostic from emitError.

Definition at line 52 of file ODSSupport.cpp.

References emitError().

◆ convertFuncOpToLLVMFuncOp()

FailureOr< LLVM::LLVMFuncOp > mlir::convertFuncOpToLLVMFuncOp ( FunctionOpInterface  funcOp,
ConversionPatternRewriter rewriter,
const LLVMTypeConverter converter 
)

◆ convertMMAToLLVMType()

LLVM::LLVMStructType mlir::convertMMAToLLVMType ( gpu::MMAMatrixType  type)

Return the LLVMStructureType corresponding to the MMAMatrixType type.

Definition at line 379 of file WmmaOpsToNvvm.cpp.

References getElementType(), mlir::gpu::MMAMatrixType::getOperand(), mlir::gpu::MMAMatrixType::getShape(), and mlir::NVVM::inferMMAType().

Referenced by configureGpuToNVVMTypeConverter().

◆ convertOpResultTypes()

FailureOr< Operation * > mlir::convertOpResultTypes ( Operation op,
ValueRange  operands,
const TypeConverter converter,
ConversionPatternRewriter rewriter 
)

◆ convertReassociationIndicesToExprs()

SmallVector< SmallVector< AffineExpr, 2 >, 2 > mlir::convertReassociationIndicesToExprs ( MLIRContext context,
ArrayRef< ReassociationIndices reassociationIndices 
)

Convert reassociation indices to affine expressions.

Definition at line 133 of file ReshapeOpsUtils.cpp.

References getAffineDimExpr().

◆ convertReassociationMapsToIndices()

SmallVector< ReassociationIndices, 2 > mlir::convertReassociationMapsToIndices ( ArrayRef< ReassociationExprs reassociationExprs)

Convert Array<Array<AffineExpr>> to Array<Array<int64_t>>.

Definition at line 170 of file ReshapeOpsUtils.cpp.

◆ convertScalarToDtype()

Value mlir::convertScalarToDtype ( OpBuilder b,
Location  loc,
Value  operand,
Type  toType,
bool  isUnsignedCast 
)

Converts a scalar value operand to type toType.

If the value doesn't convert, a warning will be issued and the operand is returned as is (which will presumably yield a verification issue downstream).

Definition at line 239 of file Utils.cpp.

References convertScalarToComplexDtype(), convertScalarToFpDtype(), convertScalarToIntDtype(), emitWarning(), and mlir::Value::getType().

Referenced by mlir::linalg::createMul(), and mlir::sparse_tensor::genCast().

◆ convertToAttribute() [1/6]

Attribute mlir::convertToAttribute ( MLIRContext ctx,
ArrayRef< int64_t >  storage 
)

Convert the provided ArrayRef<int64_t> to a DenseI64ArrayAttr attribute.

Definition at line 138 of file ODSSupport.cpp.

References mlir::detail::DenseArrayAttrImpl< T >::get().

◆ convertToAttribute() [2/6]

Attribute mlir::convertToAttribute ( MLIRContext ctx,
bool  storage 
)

Convert the given string into a BooleanAttr.

Definition at line 76 of file ODSSupport.cpp.

References mlir::BoolAttr::get().

◆ convertToAttribute() [3/6]

Attribute mlir::convertToAttribute ( MLIRContext ctx,
const std::string &  storage 
)

Convert the given string into a StringAttr.

Note that this takes a reference to the storage of a string property, which is an std::string.

Definition at line 61 of file ODSSupport.cpp.

References get().

◆ convertToAttribute() [4/6]

Attribute mlir::convertToAttribute ( MLIRContext ctx,
int32_t  storage 
)

Convert the provided int32_t to an IntegerAttr attribute.

Definition at line 47 of file ODSSupport.cpp.

References get().

◆ convertToAttribute() [5/6]

Attribute mlir::convertToAttribute ( MLIRContext ctx,
int64_t  storage 
)

Convert the provided int64_t to an IntegerAttr attribute.

Definition at line 32 of file ODSSupport.cpp.

References get().

◆ convertToAttribute() [6/6]

static Attribute mlir::convertToAttribute ( MLIRContext ctx,
IntegerOverflowFlags  flags 
)
static

Definition at line 60 of file LLVMDialect.cpp.

References get().

◆ convertVectorToMMAOps()

LogicalResult mlir::convertVectorToMMAOps ( RewriterBase rewriter,
Operation rootOp 
)

Convert vector ops to MMA matrix operations nested under rootOp.

This will convert slice of operations that can be legally converted to MMA operations. The rest of the vector operations are left untouched.

Definition at line 1242 of file VectorToGPU.cpp.

References convertBroadcastOp(), convertConstantOp(), convertContractOp(), convertElementwiseOp(), convertElementwiseOpToMMA(), convertForOp(), convertTransferReadOp(), convertTransferWriteOp(), convertYieldOp(), DBGS, and getOpToConvert().

◆ convertVectorToNVVMCompatibleMMASync()

LogicalResult mlir::convertVectorToNVVMCompatibleMMASync ( RewriterBase rewriter,
Operation rootOp 
)

Convert vector ops ops nested under rootOp to vector and GPU operaitons compatible with the nvvm.mma.sync lowering path.

This will convert a slice of operations that can be legally lowered on this path while the rest of the vector operations are left untouched.

Definition at line 1275 of file VectorToGPU.cpp.

References convertConstantOpMmaSync(), convertContractOpToMmaSync(), convertExtractStridedSlice(), convertForOp(), convertTransferReadToLoads(), convertTransferWriteToStores(), convertYieldOp(), mlir::Operation::emitError(), mlir::Operation::emitOpError(), and getOpToConvert().

◆ createAffineForToGPUPass() [1/2]

std::unique_ptr< InterfacePass< FunctionOpInterface > > mlir::createAffineForToGPUPass ( )

Definition at line 76 of file SCFToGPUPass.cpp.

◆ createAffineForToGPUPass() [2/2]

std::unique_ptr< InterfacePass< FunctionOpInterface > > mlir::createAffineForToGPUPass ( unsigned  numBlockDims,
unsigned  numThreadDims 
)

Create a pass that converts loop nests into GPU kernels.

It considers top-level affine.for operations as roots of loop nests and converts them to the gpu.launch operations if possible.

No check on the size of the block or grid, or on the validity of parallelization is performed, it is under the responsibility of the caller to strip-mine the loops and to perform the dependence analysis before calling the conversion.

Definition at line 72 of file SCFToGPUPass.cpp.

◆ createAsyncFuncToAsyncRuntimePass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createAsyncFuncToAsyncRuntimePass ( )

Definition at line 906 of file AsyncToAsyncRuntime.cpp.

◆ createAsyncParallelForPass() [1/2]

std::unique_ptr< Pass > mlir::createAsyncParallelForPass ( )

Definition at line 938 of file AsyncParallelFor.cpp.

◆ createAsyncParallelForPass() [2/2]

std::unique_ptr< Pass > mlir::createAsyncParallelForPass ( bool  asyncDispatch,
int32_t  numWorkerThreads,
int32_t  minTaskSize 
)

Definition at line 942 of file AsyncParallelFor.cpp.

◆ createAsyncRuntimePolicyBasedRefCountingPass()

std::unique_ptr< Pass > mlir::createAsyncRuntimePolicyBasedRefCountingPass ( )

Definition at line 563 of file AsyncRuntimeRefCounting.cpp.

◆ createAsyncRuntimeRefCountingOptPass()

std::unique_ptr< Pass > mlir::createAsyncRuntimeRefCountingOptPass ( )

Definition at line 234 of file AsyncRuntimeRefCountingOpt.cpp.

◆ createAsyncRuntimeRefCountingPass()

std::unique_ptr< Pass > mlir::createAsyncRuntimeRefCountingPass ( )

Definition at line 559 of file AsyncRuntimeRefCounting.cpp.

◆ createAsyncToAsyncRuntimePass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createAsyncToAsyncRuntimePass ( )

Definition at line 901 of file AsyncToAsyncRuntime.cpp.

◆ createBufferizationToMemRefPass()

std::unique_ptr< Pass > mlir::createBufferizationToMemRefPass ( )

Definition at line 171 of file BufferizationToMemRef.cpp.

◆ createCanonicalizerPass() [1/2]

std::unique_ptr< Pass > mlir::createCanonicalizerPass ( )

Creates an instance of the Canonicalizer pass, configured with default settings (which can be overridden by pass options on the command line).

Create a Canonicalizer pass.

Definition at line 74 of file Canonicalizer.cpp.

Referenced by mlir::tosa::addTosaToLinalgPasses(), mlir::bufferization::buildBufferDeallocationPipeline(), mlir::sparse_tensor::buildSparsifier(), and defaultInlinerOptPipeline().

◆ createCanonicalizerPass() [2/2]

std::unique_ptr< Pass > mlir::createCanonicalizerPass ( const GreedyRewriteConfig config,
ArrayRef< std::string >  disabledPatterns = std::nullopt,
ArrayRef< std::string >  enabledPatterns = std::nullopt 
)

Creates an instance of the Canonicalizer pass with the specified config.

disabledPatterns is a set of labels used to filter out input patterns with a debug label or debug name in this set. enabledPatterns is a set of labels used to filter out input patterns that do not have one of the labels in this set. Debug labels must be set explicitly on patterns or when adding them with RewritePatternSet::addWithLabel. Debug names may be empty, but patterns created with RewritePattern::create have their default debug name set to their type name.

Definition at line 80 of file Canonicalizer.cpp.

References config.

◆ createCompositeFixedPointPass()

std::unique_ptr< Pass > mlir::createCompositeFixedPointPass ( std::string  name,
llvm::function_ref< void(OpPassManager &)>  populateFunc,
int  maxIterations = 10 
)

Create composite pass, which runs provided set of passes until fixed point or maximum number of iterations reached.

Definition at line 99 of file CompositePass.cpp.

◆ createControlFlowSinkPass()

std::unique_ptr< Pass > mlir::createControlFlowSinkPass ( )

Creates a pass to perform control-flow sinking.

Definition at line 56 of file ControlFlowSink.cpp.

◆ createConvertAMDGPUToROCDLPass()

std::unique_ptr< Pass > mlir::createConvertAMDGPUToROCDLPass ( )

Definition at line 1064 of file AMDGPUToROCDL.cpp.

◆ createConvertArmNeon2dToIntrPass()

std::unique_ptr< Pass > mlir::createConvertArmNeon2dToIntrPass ( )

Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e.

equivalent ops operating on flattened 1D vectors and mapping more directly to the corresponding Arm NEON instruction.

Definition at line 73 of file ArmNeon2dToIntr.cpp.

◆ createConvertArmSMEToLLVMPass()

std::unique_ptr< Pass > mlir::createConvertArmSMEToLLVMPass ( bool  dumpTileLiveRanges = false)

Create a pass to convert from the ArmSME dialect to LLVM intrinsics.

Definition at line 1024 of file ArmSMEToLLVM.cpp.

◆ createConvertArmSMEToSCFPass()

std::unique_ptr< Pass > mlir::createConvertArmSMEToSCFPass ( )

Create a pass to convert a subset of ArmSME ops to SCF.

Definition at line 416 of file ArmSMEToSCF.cpp.

◆ createConvertComplexToLibmPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertComplexToLibmPass ( )

Create a pass to convert Complex operations to libm calls.

Definition at line 148 of file ComplexToLibm.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createConvertComplexToStandardPass()

std::unique_ptr< Pass > mlir::createConvertComplexToStandardPass ( )

Create a pass to convert Complex operations to the Standard dialect.

Definition at line 1272 of file ComplexToStandard.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createConvertControlFlowToSPIRVPass()

std::unique_ptr< OperationPass<> > mlir::createConvertControlFlowToSPIRVPass ( )

Creates a pass to convert ControlFlow ops to SPIR-V ops.

Definition at line 56 of file ControlFlowToSPIRVPass.cpp.

◆ createConvertFuncToSPIRVPass()

std::unique_ptr< OperationPass<> > mlir::createConvertFuncToSPIRVPass ( )

Creates a pass to convert Func ops to SPIR-V ops.

Definition at line 54 of file FuncToSPIRVPass.cpp.

◆ createConvertGpuLaunchFuncToVulkanLaunchFuncPass()

std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > mlir::createConvertGpuLaunchFuncToVulkanLaunchFuncPass ( )

Definition at line 209 of file ConvertGPULaunchFuncToVulkanLaunchFunc.cpp.

◆ createConvertGPUToSPIRVPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertGPUToSPIRVPass ( bool  mapMemorySpace = true)

Creates a pass to convert GPU kernel ops to corresponding SPIR-V ops.

For a gpu.func to be converted, it should have a spirv.entry_point_abi attribute. If mapMemorySpace is true, performs MemRef memory space to SPIR-V mapping according to default Vulkan rules first.

Definition at line 164 of file GPUToSPIRVPass.cpp.

◆ createConvertLinalgToStandardPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertLinalgToStandardPass ( )

Create a pass to convert Linalg operations to the Standard dialect.

Definition at line 155 of file LinalgToStandard.cpp.

◆ createConvertMathToLibmPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertMathToLibmPass ( )

Create a pass to convert Math operations to libm calls.

Definition at line 221 of file MathToLibm.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createConvertMathToSPIRVPass()

std::unique_ptr< OperationPass<> > mlir::createConvertMathToSPIRVPass ( )

Creates a pass to convert Math ops to SPIR-V ops.

Definition at line 56 of file MathToSPIRVPass.cpp.

◆ createConvertMemRefToSPIRVPass()

std::unique_ptr< OperationPass<> > mlir::createConvertMemRefToSPIRVPass ( )

Creates a pass to convert MemRef ops to SPIR-V ops.

Definition at line 58 of file MemRefToSPIRVPass.cpp.

◆ createConvertMeshToMPIPass()

std::unique_ptr<::mlir::Pass > mlir::createConvertMeshToMPIPass ( )

Lowers Mesh communication operations (updateHalo, AllGater, ...) to MPI primitives.

Definition at line 437 of file MeshToMPI.cpp.

◆ createConvertOpenACCToSCFPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertOpenACCToSCFPass ( )

Create a pass to convert the OpenACC dialect into the LLVMIR dialect.

Definition at line 98 of file OpenACCToSCF.cpp.

◆ createConvertSCFToCFPass()

std::unique_ptr< Pass > mlir::createConvertSCFToCFPass ( )

Creates a pass to convert SCF operations to CFG branch-based operation in the ControlFlow dialect.

Definition at line 730 of file SCFToControlFlow.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createConvertSCFToSPIRVPass()

std::unique_ptr<OperationPass<> > mlir::createConvertSCFToSPIRVPass ( )

Creates a pass to convert SCF ops into SPIR-V ops.

◆ createConvertShapeConstraintsPass()

std::unique_ptr< Pass > mlir::createConvertShapeConstraintsPass ( )

Definition at line 71 of file ConvertShapeConstraints.cpp.

◆ createConvertShapeToStandardPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertShapeToStandardPass ( )

Definition at line 732 of file ShapeToStandard.cpp.

◆ createConvertTensorToLinalgPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertTensorToLinalgPass ( )

Creates a pass to convert Tensor ops to Linalg ops.

Definition at line 50 of file TensorToLinalgPass.cpp.

◆ createConvertTensorToSPIRVPass()

std::unique_ptr< OperationPass<> > mlir::createConvertTensorToSPIRVPass ( )

Creates a pass to convert Tensor ops to SPIR-V ops.

Definition at line 57 of file TensorToSPIRVPass.cpp.

◆ createConvertToLLVMPass()

std::unique_ptr< Pass > mlir::createConvertToLLVMPass ( )

Create a pass that performs dialect conversion to LLVM for all dialects implementing ConvertToLLVMPatternInterface.

Definition at line 284 of file ConvertToLLVMPass.cpp.

◆ createConvertVectorToArmSMEPass()

std::unique_ptr< Pass > mlir::createConvertVectorToArmSMEPass ( )

Create a pass to lower operations from the vector dialect to Arm SME.

Definition at line 39 of file VectorToArmSMEPass.cpp.

◆ createConvertVectorToGPUPass()

std::unique_ptr< Pass > mlir::createConvertVectorToGPUPass ( bool  useNvGpu = false)

Convert from vector to GPU ops.

Definition at line 1345 of file VectorToGPU.cpp.

◆ createConvertVectorToSCFPass()

std::unique_ptr< Pass > mlir::createConvertVectorToSCFPass ( const VectorTransferToSCFOptions options = VectorTransferToSCFOptions())

Create a pass to convert a subset of vector ops to SCF.

Definition at line 1745 of file VectorToSCF.cpp.

References options.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createConvertVectorToSPIRVPass()

std::unique_ptr< OperationPass<> > mlir::createConvertVectorToSPIRVPass ( )

Creates a pass to convert Vector Ops to SPIR-V ops.

Definition at line 56 of file VectorToSPIRVPass.cpp.

◆ createConvertVectorToXeGPUPass()

std::unique_ptr< Pass > mlir::createConvertVectorToXeGPUPass ( )

Create a pass to convert ops from vector to XeGPU.

Definition at line 334 of file VectorToXeGPU.cpp.

◆ createCSEPass()

std::unique_ptr< Pass > mlir::createCSEPass ( )

Creates a pass to perform common sub expression elimination.

Definition at line 416 of file CSE.cpp.

Referenced by mlir::bufferization::buildBufferDeallocationPipeline().

◆ createElementwiseOp()

static bool mlir::createElementwiseOp ( ConversionPatternRewriter builder,
gpu::SubgroupMmaElementwiseOp  op,
Type  coopType,
ValueRange  operands 
)
static

Creates a SPIR-V op to replace the given GPU subgroup mma elementwise op when the elementwise op directly supports with cooperative matrix type.

Returns false if cannot.

See SPV_KHR_cooperative_matrix for supported elementwise ops.

Definition at line 43 of file WmmaOpsToSPIRV.cpp.

References ADDI, mlir::RewriterBase::replaceOpWithNewOp(), and SUBI.

◆ createForallToForLoopPass()

std::unique_ptr< Pass > mlir::createForallToForLoopPass ( )

Creates a pass that converts SCF forall loops to SCF for loops.

Definition at line 72 of file ForallToFor.cpp.

◆ createForallToParallelLoopPass()

std::unique_ptr< Pass > mlir::createForallToParallelLoopPass ( )

Creates a pass that converts SCF forall loops to SCF parallel loops.

Definition at line 81 of file ForallToParallel.cpp.

◆ createForLoopPeelingPass()

std::unique_ptr< Pass > mlir::createForLoopPeelingPass ( )

Creates a pass that peels for loops at their upper bounds for better vectorization.

Definition at line 353 of file LoopSpecialization.cpp.

◆ createForLoopRangeFoldingPass()

std::unique_ptr< Pass > mlir::createForLoopRangeFoldingPass ( )

Creates a pass which folds arith ops on induction variable into loop range.

Definition at line 91 of file LoopRangeFolding.cpp.

◆ createForLoopSpecializationPass()

std::unique_ptr< Pass > mlir::createForLoopSpecializationPass ( )

Creates a pass that specializes for loop for unrolling and vectorization.

Definition at line 349 of file LoopSpecialization.cpp.

◆ createForToWhileLoopPass()

std::unique_ptr< Pass > mlir::createForToWhileLoopPass ( )

Definition at line 120 of file ForToWhile.cpp.

◆ createGenerateRuntimeVerificationPass()

std::unique_ptr< Pass > mlir::createGenerateRuntimeVerificationPass ( )

Creates a pass that generates IR to verify ops at runtime.

Definition at line 38 of file GenerateRuntimeVerification.cpp.

◆ createGpuAsyncRegionPass()

std::unique_ptr< OperationPass< func::FuncOp > > mlir::createGpuAsyncRegionPass ( )

Rewrites a function region so that GPU ops execute asynchronously.

Definition at line 351 of file AsyncRegionRewriter.cpp.

◆ createGpuDecomposeMemrefsPass()

std::unique_ptr< Pass > mlir::createGpuDecomposeMemrefsPass ( )

Pass decomposes memref ops inside gpu.launch body.

Definition at line 242 of file DecomposeMemRefs.cpp.

◆ createGpuKernelOutliningPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createGpuKernelOutliningPass ( StringRef  dataLayoutStr = StringRef())

Replaces gpu.launch with gpu.launch_func by moving the region into a separate kernel function.

Definition at line 475 of file KernelOutlining.cpp.

◆ createGpuLauchSinkIndexComputationsPass()

std::unique_ptr< Pass > mlir::createGpuLauchSinkIndexComputationsPass ( )

Pass that moves ops which are likely an index computation into gpu.launch body.

Definition at line 470 of file KernelOutlining.cpp.

◆ createGpuMapParallelLoopsPass()

std::unique_ptr< mlir::OperationPass< mlir::func::FuncOp > > mlir::createGpuMapParallelLoopsPass ( )

Maps the parallel loops found in the given function to workgroups.

The first loop encountered will be mapped to the global workgroup and the second loop encountered to the local workgroup. Within each mapping, the first three dimensions are mapped to x/y/z hardware ids and all following dimensions are mapped to sequential loops.

Definition at line 151 of file ParallelLoopMapper.cpp.

◆ createInlinerPass() [1/3]

std::unique_ptr< Pass > mlir::createInlinerPass ( )

Creates a pass which inlines calls and callable operations as defined by the CallGraph.

Definition at line 186 of file InlinerPass.cpp.

◆ createInlinerPass() [2/3]

std::unique_ptr< Pass > mlir::createInlinerPass ( llvm::StringMap< OpPassManager opPipelines)

Creates an instance of the inliner pass, and use the provided pass managers when optimizing callable operations with names matching the key type.

Callable operations with a name not within the provided map will use the default inliner pipeline during optimization.

Definition at line 190 of file InlinerPass.cpp.

References defaultInlinerOptPipeline().

◆ createInlinerPass() [3/3]

std::unique_ptr< Pass > mlir::createInlinerPass ( llvm::StringMap< OpPassManager opPipelines,
std::function< void(OpPassManager &)>  defaultPipelineBuilder 
)

Creates an instance of the inliner pass, and use the provided pass managers when optimizing callable operations with names matching the key type.

Callable operations with a name not within the provided map will use the provided default pipeline builder.

Definition at line 194 of file InlinerPass.cpp.

◆ createLocationSnapshotPass() [1/2]

std::unique_ptr< Pass > mlir::createLocationSnapshotPass ( )

Overload utilizing pass options for initialization.

Definition at line 157 of file LocationSnapshot.cpp.

◆ createLocationSnapshotPass() [2/2]

std::unique_ptr< Pass > mlir::createLocationSnapshotPass ( OpPrintingFlags  flags,
StringRef  fileName = "",
StringRef  tag = "" 
)

Create a pass to generate new locations by snapshotting the IR to the given file, and using the printed locations within that file.

If filename is empty, a temporary file is generated instead. If a 'tag' is non-empty, the generated locations are represented as a NameLoc with the given tag as the name, and then fused with the existing locations. Otherwise, the existing locations are replaced.

Definition at line 152 of file LocationSnapshot.cpp.

◆ createLoopInvariantCodeMotionPass()

std::unique_ptr< Pass > mlir::createLoopInvariantCodeMotionPass ( )

Creates a loop invariant code motion pass that hoists loop invariant instructions out of the loop.

Definition at line 60 of file LoopInvariantCodeMotion.cpp.

Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().

◆ createLoopInvariantSubsetHoistingPass()

std::unique_ptr< Pass > mlir::createLoopInvariantSubsetHoistingPass ( )

Creates a pass that hoists loop-invariant subset ops.

Definition at line 64 of file LoopInvariantCodeMotion.cpp.

◆ createLowerAffinePass()

std::unique_ptr< Pass > mlir::createLowerAffinePass ( )

Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp) to equivalent lower-level constructs (flow of basic blocks and arithmetic primitives).

Lowers If and For operations within a function into their lower level CFG equivalent blocks.

Definition at line 575 of file AffineToStandard.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createLowerForeachToSCFPass()

std::unique_ptr< Pass > mlir::createLowerForeachToSCFPass ( )

◆ createLowerGpuOpsToROCDLOpsPass()

std::unique_ptr< OperationPass< gpu::GPUModuleOp > > mlir::createLowerGpuOpsToROCDLOpsPass ( const std::string &  chipset = "gfx900",
unsigned  indexBitwidth = kDeriveIndexBitwidthFromDataLayout,
bool  useBarePtrCallConv = false,
gpu::amd::Runtime  runtime = gpu::amd::Runtime::Unknown 
)

Creates a pass that lowers GPU dialect operations to ROCDL counterparts.

The index bitwidth used for the lowering of the device side index computations is configurable.

Definition at line 405 of file LowerGpuOpsToROCDLOps.cpp.

◆ createLowerSparseIterationToSCFPass()

std::unique_ptr< Pass > mlir::createLowerSparseIterationToSCFPass ( )

◆ createLowerSparseOpsToForeachPass() [1/2]

std::unique_ptr< Pass > mlir::createLowerSparseOpsToForeachPass ( )

◆ createLowerSparseOpsToForeachPass() [2/2]

std::unique_ptr< Pass > mlir::createLowerSparseOpsToForeachPass ( bool  enableRT,
bool  enableConvert 
)

Definition at line 458 of file SparseTensorPasses.cpp.

◆ createMapMemRefStorageClassPass()

std::unique_ptr< OperationPass<> > mlir::createMapMemRefStorageClassPass ( )

Creates a pass to map numeric MemRef memory spaces to symbolic SPIR-V storage classes.

The mapping is read from the command-line option.

Definition at line 326 of file MapMemRefStorageClassPass.cpp.

◆ createOptReductionPass()

std::unique_ptr< Pass > mlir::createOptReductionPass ( )

Definition at line 90 of file OptReductionPass.cpp.

◆ createOutlineShapeComputationPass()

std::unique_ptr< OperationPass< ModuleOp > > mlir::createOutlineShapeComputationPass ( )

Outline the shape computation part by adding shape.func and populate conrresponding mapping infomation into ShapeMappingAnalysis.

Definition at line 329 of file OutlineShapeComputation.cpp.

◆ createParallelLoopFusionPass()

std::unique_ptr< Pass > mlir::createParallelLoopFusionPass ( )

Creates a loop fusion pass which fuses parallel loops.

Definition at line 285 of file ParallelLoopFusion.cpp.

◆ createParallelLoopSpecializationPass()

std::unique_ptr< Pass > mlir::createParallelLoopSpecializationPass ( )

Creates a pass that specializes parallel loop for unrolling and vectorization.

Definition at line 345 of file LoopSpecialization.cpp.

◆ createParallelLoopTilingPass()

std::unique_ptr<Pass> mlir::createParallelLoopTilingPass ( llvm::ArrayRef< int64_t >  tileSize = {},
bool  noMinMaxBounds = false 
)

Creates a pass which tiles innermost parallel loops.

If noMinMaxBounds, the upper bound of the inner loop will be a same value among different outter loop iterations, and an additional inbound check will be emitted inside the internal loops.

◆ createParallelLoopToGpuPass()

std::unique_ptr< Pass > mlir::createParallelLoopToGpuPass ( )

Creates a pass that converts scf.parallel operations into a gpu.launch operation.

The mapping of loop dimensions to launch dimensions is derived from mapping attributes. See ParallelToGpuLaunchLowering::matchAndRewrite for a description of the used attributes.

Definition at line 80 of file SCFToGPUPass.cpp.

◆ createPDLToPDLInterpPass() [1/2]

std::unique_ptr< OperationPass< ModuleOp > > mlir::createPDLToPDLInterpPass ( )

Creates and returns a pass to convert PDL ops to PDL interpreter ops.

Definition at line 1016 of file PDLToPDLInterp.cpp.

◆ createPDLToPDLInterpPass() [2/2]

std::unique_ptr< OperationPass< ModuleOp > > mlir::createPDLToPDLInterpPass ( DenseMap< Operation *, PDLPatternConfigSet * > &  configMap)

Creates and returns a pass to convert PDL ops to PDL interpreter ops.

configMap holds a map of the configurations for each pattern being compiled.

Definition at line 1019 of file PDLToPDLInterp.cpp.

◆ createPreSparsificationRewritePass()

std::unique_ptr< Pass > mlir::createPreSparsificationRewritePass ( )

◆ createPrintIRPass()

std::unique_ptr< Pass > mlir::createPrintIRPass ( const PrintIRPassOptions &  options = {})

Creates a pass to print IR on the debug stream.

Definition at line 34 of file PrintIR.cpp.

References options.

◆ createPrintOpGraphPass()

std::unique_ptr< Pass > mlir::createPrintOpGraphPass ( raw_ostream &  os = llvm::errs())

Creates a pass to print op graphs.

Definition at line 364 of file ViewOpGraph.cpp.

◆ createPrintOpStatsPass() [1/2]

std::unique_ptr< Pass > mlir::createPrintOpStatsPass ( raw_ostream &  os,
bool  printAsJSON 
)

Creates a pass which prints the list of ops and the number of occurrences in the module with the output format option.

Definition at line 120 of file OpStats.cpp.

◆ createPrintOpStatsPass() [2/2]

std::unique_ptr< Pass > mlir::createPrintOpStatsPass ( raw_ostream &  os = llvm::errs())

Creates a pass which prints the list of ops and the number of occurrences in the module.

Definition at line 116 of file OpStats.cpp.

◆ createReconcileUnrealizedCastsPass()

std::unique_ptr< Pass > mlir::createReconcileUnrealizedCastsPass ( )

Creates a pass that eliminates noop unrealized_conversion_cast operation sequences.

Definition at line 52 of file ReconcileUnrealizedCasts.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createReductionTreePass()

std::unique_ptr< Pass > mlir::createReductionTreePass ( )

Definition at line 259 of file ReductionTreePass.cpp.

◆ createRemoveDeadValuesPass()

std::unique_ptr< Pass > mlir::createRemoveDeadValuesPass ( )

Creates an optimization pass to remove dead values.

Definition at line 639 of file RemoveDeadValues.cpp.

◆ createRemoveShapeConstraintsPass()

std::unique_ptr< OperationPass< func::FuncOp > > mlir::createRemoveShapeConstraintsPass ( )

Definition at line 70 of file RemoveShapeConstraints.cpp.

◆ createScalarOrSplatConstant() [1/3]

Value mlir::createScalarOrSplatConstant ( OpBuilder builder,
Location  loc,
Type  type,
const APFloat &  value 
)

◆ createScalarOrSplatConstant() [2/3]

Value mlir::createScalarOrSplatConstant ( OpBuilder builder,
Location  loc,
Type  type,
const APInt &  value 
)

Create a constant of type type at location loc whose value is value (an APInt or APFloat whose type must match the element type of type).

If type is a shaped type, create a splat constant of the given value. Constants are folded if possible.

Definition at line 271 of file Utils.cpp.

References mlir::OpBuilder::create(), mlir::DenseElementsAttr::get(), and mlir::Builder::getIntegerAttr().

Referenced by clampInput(), constructResultVector(), and createScalarOrSplatConstant().

◆ createScalarOrSplatConstant() [3/3]

Value mlir::createScalarOrSplatConstant ( OpBuilder builder,
Location  loc,
Type  type,
int64_t  value 
)

Definition at line 284 of file Utils.cpp.

References createScalarOrSplatConstant().

◆ createSCCPPass()

std::unique_ptr< Pass > mlir::createSCCPPass ( )

Creates a pass which performs sparse conditional constant propagation over nested operations.

Definition at line 133 of file SCCP.cpp.

◆ createSCFForLoopCanonicalizationPass()

std::unique_ptr< Pass > mlir::createSCFForLoopCanonicalizationPass ( )

Creates a pass that canonicalizes affine.min and affine.max operations inside of scf.for loops with known lower and upper bounds.

Definition at line 187 of file LoopCanonicalization.cpp.

◆ createShapeToShapeLowering()

std::unique_ptr< Pass > mlir::createShapeToShapeLowering ( )

Creates an instance of the ShapeToShapeLowering pass that legalizes Shape dialect to be convertible to Arith.

For example, shape.num_elements get transformed to shape.reduce, which can be lowered to SCF and Arith.

Definition at line 85 of file ShapeToShapeLowering.cpp.

◆ createSparseAssembler() [1/2]

std::unique_ptr< Pass > mlir::createSparseAssembler ( )

Definition at line 421 of file SparseTensorPasses.cpp.

◆ createSparseAssembler() [2/2]

std::unique_ptr<Pass> mlir::createSparseAssembler ( bool  directOut)

◆ createSparseBufferRewritePass() [1/2]

std::unique_ptr< Pass > mlir::createSparseBufferRewritePass ( )

◆ createSparseBufferRewritePass() [2/2]

std::unique_ptr< Pass > mlir::createSparseBufferRewritePass ( bool  enableBufferInitialization)

Definition at line 490 of file SparseTensorPasses.cpp.

◆ createSparseGPUCodegenPass() [1/2]

std::unique_ptr< Pass > mlir::createSparseGPUCodegenPass ( )

◆ createSparseGPUCodegenPass() [2/2]

std::unique_ptr< Pass > mlir::createSparseGPUCodegenPass ( unsigned  numThreads,
bool  enableRT 
)

Definition at line 510 of file SparseTensorPasses.cpp.

◆ createSparseReinterpretMapPass() [1/2]

std::unique_ptr< Pass > mlir::createSparseReinterpretMapPass ( )

◆ createSparseReinterpretMapPass() [2/2]

std::unique_ptr< Pass > mlir::createSparseReinterpretMapPass ( ReinterpretMapScope  scope)

Definition at line 430 of file SparseTensorPasses.cpp.

References options.

◆ createSparseSpaceCollapsePass()

std::unique_ptr< Pass > mlir::createSparseSpaceCollapsePass ( )

◆ createSparseTensorCodegenPass() [1/2]

std::unique_ptr< Pass > mlir::createSparseTensorCodegenPass ( )

◆ createSparseTensorCodegenPass() [2/2]

std::unique_ptr< Pass > mlir::createSparseTensorCodegenPass ( bool  createSparseDeallocs,
bool  enableBufferInitialization 
)

Definition at line 479 of file SparseTensorPasses.cpp.

◆ createSparseTensorConversionPass()

std::unique_ptr< Pass > mlir::createSparseTensorConversionPass ( )

◆ createSparseVectorizationPass() [1/2]

std::unique_ptr< Pass > mlir::createSparseVectorizationPass ( )

◆ createSparseVectorizationPass() [2/2]

std::unique_ptr< Pass > mlir::createSparseVectorizationPass ( unsigned  vectorLength,
bool  enableVLAVectorization,
bool  enableSIMDIndex32 
)

Definition at line 499 of file SparseTensorPasses.cpp.

◆ createSparsificationAndBufferizationPass() [1/2]

std::unique_ptr< mlir::Pass > mlir::createSparsificationAndBufferizationPass ( )

◆ createSparsificationAndBufferizationPass() [2/2]

std::unique_ptr< mlir::Pass > mlir::createSparsificationAndBufferizationPass ( const bufferization::OneShotBufferizationOptions bufferizationOptions,
const SparsificationOptions sparsificationOptions,
bool  createSparseDeallocs,
bool  enableRuntimeLibrary,
bool  enableBufferInitialization,
unsigned  vectorLength,
bool  enableVLAVectorization,
bool  enableSIMDIndex32,
bool  enableGPULibgen,
SparseEmitStrategy  emitStrategy,
SparseParallelizationStrategy  parallelizationStrategy 
)

Definition at line 250 of file SparsificationAndBufferizationPass.cpp.

◆ createSparsificationPass() [1/2]

std::unique_ptr< Pass > mlir::createSparsificationPass ( )

◆ createSparsificationPass() [2/2]

std::unique_ptr< Pass > mlir::createSparsificationPass ( const SparsificationOptions options)

Definition at line 445 of file SparseTensorPasses.cpp.

References options.

◆ createStageSparseOperationsPass()

std::unique_ptr< Pass > mlir::createStageSparseOperationsPass ( )

◆ createStorageSpecifierToLLVMPass()

std::unique_ptr< Pass > mlir::createStorageSpecifierToLLVMPass ( )

Definition at line 515 of file SparseTensorPasses.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createStripDebugInfoPass()

std::unique_ptr< Pass > mlir::createStripDebugInfoPass ( )

Creates a pass to strip debug information from a function.

Definition at line 46 of file StripDebugInfo.cpp.

Referenced by mlir::sparse_tensor::buildSparsifier().

◆ createSymbolDCEPass()

std::unique_ptr< Pass > mlir::createSymbolDCEPass ( )

Creates a pass which delete symbol operations that are unreachable.

This pass may only be scheduled on an operation that defines a SymbolTable.

Definition at line 149 of file SymbolDCE.cpp.

◆ createSymbolPrivatizePass()

std::unique_ptr< Pass > mlir::createSymbolPrivatizePass ( ArrayRef< std::string >  excludeSymbols = {})

Creates a pass which marks top-level symbol operations as private unless listed in excludeSymbols.

Definition at line 61 of file SymbolPrivatize.cpp.

◆ createTestSCFParallelLoopCollapsingPass()

std::unique_ptr< Pass > mlir::createTestSCFParallelLoopCollapsingPass ( )

Creates a pass that transforms a single ParallelLoop over N induction variables into another ParallelLoop over less than N induction variables.

Definition at line 109 of file ParallelLoopCollapsing.cpp.

◆ createTopologicalSortPass()

std::unique_ptr< Pass > mlir::createTopologicalSortPass ( )

Creates a pass that recursively sorts nested regions without SSA dominance topologically such that, as much as possible, users of values appear after their producers.

Definition at line 38 of file TopologicalSort.cpp.

◆ debugString()

template<typename T >
static std::string mlir::debugString ( T &&  op)
static

◆ decomposeMixedValues()

std::pair< SmallVector< int64_t >, SmallVector< Value > > mlir::decomposeMixedValues ( const SmallVectorImpl< OpFoldResult > &  mixedValues)

Decompose a vector of mixed static or dynamic values into the corresponding pair of arrays.

This is the inverse function of getMixedValues.

Definition at line 211 of file StaticValueUtils.cpp.

◆ delinearize() [1/3]

SmallVector< AffineExpr > mlir::delinearize ( AffineExpr  linearIndex,
ArrayRef< AffineExpr strides 
)

Given the strides together with a linear index in the dimension space, return the vector-space offsets in each dimension for a de-linearized index.

Let li = linearIndex, assuming strides are [s0, .. sn], return the vector of AffineExpr [li % s0, (li / s0) % s1, ..., (li / s0 / .. / sn-1) % sn]

It is the caller's responsibility to pass proper AffineExpr kind that result in valid AffineExpr (i.e. cannot multiply 2 AffineDimExpr or divide by an AffineDimExpr).

strides elements are expected to bind to non-negative values.

Definition at line 187 of file IndexingUtils.cpp.

References delinearizeImpl(), and mlir::AffineExpr::floorDiv().

◆ delinearize() [2/3]

SmallVector< AffineExpr > mlir::delinearize ( AffineExpr  linearIndex,
ArrayRef< int64_t >  strides 
)

◆ delinearize() [3/3]

SmallVector< int64_t > mlir::delinearize ( int64_t  linearIndex,
ArrayRef< int64_t >  strides 
)

Given the strides together with a linear index in the dimension space, return the vector-space offsets in each dimension for a de-linearized index.

strides elements are asserted to be non-negative.

Let li = linearIndex, assuming strides are [s0, .. sn], return the vector of int64_t [li % s0, (li / s0) % s1, ..., (li / s0 / .. / sn-1) % sn]

Definition at line 107 of file IndexingUtils.cpp.

References delinearizeImpl().

Referenced by commonLinearIdBuilderFn(), createParallelComputeFunction(), delinearize(), foreachIndividualVectorElement(), mlir::detail::TileOffsetRangeImpl::getDynamicTileOffsets(), mlir::detail::TileOffsetRangeImpl::getStaticTileOffsets(), handleMultidimensionalVectors(), and resolveSourceIndicesCollapseShape().

◆ denormalizeInductionVariable()

void mlir::denormalizeInductionVariable ( RewriterBase rewriter,
Location  loc,
Value  normalizedIv,
OpFoldResult  origLb,
OpFoldResult  origStep 
)

◆ dispatchIndexOpFoldResult()

void mlir::dispatchIndexOpFoldResult ( OpFoldResult  ofr,
SmallVectorImpl< Value > &  dynamicVec,
SmallVectorImpl< int64_t > &  staticVec 
)

Helper function to dispatch an OpFoldResult into staticVec if: a) it is an IntegerAttr In other cases, the OpFoldResult is dispached to the dynamicVec.

In such dynamic cases, ShapedType::kDynamic is also pushed to staticVec. This is useful to extract mixed static and dynamic entries that come from an AttrSizedOperandSegments trait.

In such dynamic cases, a copy of the sentinel value is also pushed to staticVec. This is useful to extract mixed static and dynamic entries that come from an AttrSizedOperandSegments trait.

Definition at line 48 of file StaticValueUtils.cpp.

Referenced by dispatchIndexOpFoldResults().

◆ dispatchIndexOpFoldResults()

void mlir::dispatchIndexOpFoldResults ( ArrayRef< OpFoldResult ofrs,
SmallVectorImpl< Value > &  dynamicVec,
SmallVectorImpl< int64_t > &  staticVec 
)

Helper function to dispatch multiple OpFoldResults according to the behavior of dispatchIndexOpFoldResult(OpFoldResult ofr for a single OpFoldResult.

Definition at line 75 of file StaticValueUtils.cpp.

References dispatchIndexOpFoldResult().

Referenced by mlir::tensor::bubbleUpPadSlice(), getStaticTilesImpl(), and inferCastResultType().

◆ dropDims()

SmallVector< int64_t > mlir::dropDims ( ArrayRef< int64_t >  inputPerm,
ArrayRef< int64_t >  dropPositions 
)

Returns a permutation vector that drop the input dims in dropPositions from inputPerm.

For example, inputPerm = {2, 4, 0, 1, 3} and dropPositions= {1, 2} would result in a {2, 0, 1} permutation vector.

Definition at line 255 of file IndexingUtils.cpp.

Referenced by SwapTransposeWithBroadcast::matchAndRewrite().

◆ eliminateCommonSubExpressions()

void mlir::eliminateCommonSubExpressions ( RewriterBase rewriter,
DominanceInfo domInfo,
Operation op,
bool *  changed = nullptr 
)

Eliminate common subexpressions within the given operation.

This transform looks for and deduplicates equivalent operations.

changed indicates whether the IR was modified or not.

Definition at line 382 of file CSE.cpp.

References changed.

◆ emitDefiniteFailure() [1/2]

DiagnosedDefiniteFailure mlir::emitDefiniteFailure ( Location  loc,
const Twine &  message 
)
inline

Emits a definite failure with the given message.

The returned object allows for last-minute modification to the error message, such as attaching notes and completing the message. It will be reported when the object is destructed or converted.

Definition at line 243 of file DiagnosedSilenceableFailure.h.

Referenced by mlir::transform::TransformState::applyTransform(), and definiteFailureHelper().

◆ emitDefiniteFailure() [2/2]

DiagnosedDefiniteFailure mlir::emitDefiniteFailure ( Operation op,
const Twine &  message = {} 
)
inline

Definition at line 247 of file DiagnosedSilenceableFailure.h.

◆ emitError() [1/2]

InFlightDiagnostic mlir::emitError ( Location  loc)

Utility method to emit an error message using this location.

Emit an error message using this location.

Definition at line 328 of file Diagnostics.cpp.

Referenced by mlir::AllocationOpLLVMLowering::allocateBufferManuallyAlign(), applyPartialOneToNConversion(), applyPassManagerCLOptions(), mlir::ROCDL::SerializeGPUModuleBase::assembleIsa(), buildSequentialConstant(), mlir::transform::detail::checkApplyToOne(), checkDeclareOperands(), checkedAddLLVMFnAttribute(), mlir::transform::detail::checkNestedConsumption(), checkTensorElementType(), cleanupPrivateVars(), mlir::detail::constructContainerOpForParserIfNecessary(), convertCallLLVMIntrinsicOp(), mlir::LLVM::ModuleImport::convertDataLayout(), convertDenseArrayFromAttr(), convertDenseResourceElementsAttr(), convertFromAttribute(), mlir::LLVM::ModuleImport::convertGlobals(), mlir::LLVM::ModuleImport::convertValue(), CpAsyncBulkTensorCommonVerifier(), mlir::ControlFlowToSCFTransformation::createUnreachableTerminator(), deserializeCacheControlDecoration(), deserializeModule(), mlir::spirv::Deserializer::processOp< spirv::CopyMemoryOp >(), mlir::spirv::Deserializer::processOp< spirv::EntryPointOp >(), mlir::spirv::Deserializer::processOp< spirv::ExecutionModeOp >(), mlir::spirv::Deserializer::processOp< spirv::FunctionCallOp >(), mlir::spirv::Deserializer::processOp< spirv::GenericCastToPtrExplicitOp >(), mlir::ImplicitLocOpBuilder::emitError(), mlir::Operation::emitError(), mlir::detail::Parser::emitError(), emitOptionalError(), mlir::transform::detail::expandPathsToMLIRFiles(), mlir::quant::fakeQuantAttrsToType(), mlir::detail::PassCrashReproducerGenerator::finalize(), mlir::detail::OpPassManagerImpl::finalizePassList(), forwardPassthroughAttributes(), mlir::DynamicType::get(), getAttrOrTypeVerifier(), mlir::gpu::MMAMatrixType::getChecked(), mlir::DynamicAttr::getChecked(), mlir::DynamicType::getChecked(), mlir::spirv::MatrixType::getChecked(), mlir::quant::CalibratedQuantizedType::getChecked(), mlir::spirv::SampledImageType::getChecked(), mlir::quant::UniformQuantizedPerAxisType::getChecked(), mlir::quant::UniformQuantizedType::getChecked(), mlir::quant::AnyQuantizedType::getChecked(), mlir::detail::getDefaultDiagnosticEmitFn(), mlir::spirv::getElementPtrType(), getElementType(), getInsertExtractValueElementType(), mlir::LLVM::detail::getLLVMConstant(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), getOverloadedDeclaration(), getScalarConstantAsAttr(), mlir::tracing::InstallDebugHandler::Impl::Impl(), mlir::LLVMImportInterface::initializeImport(), irdlAttrOrTypeVerifier(), irdlOpVerifier(), loadIRDLDialects(), mlirAsmStateCreateForValue(), mlirEmitError(), mlirLLVMStructTypeLiteralGetChecked(), mlirReduceMain(), mlir::Op< ConcreteType, Traits >::parseProperties(), mlir::transform::detail::parseTransformModuleFromFile(), performActions(), mlir::spirv::processDecorationList(), mlir::dlti::query(), readBytecodeFileImpl(), registerFromLLVMIRTranslation(), reshapeLikeShapesAreCompatible(), mlir::PassManager::run(), mlir::OperationName::setOpPropertiesFromAttribute(), mlir::MlirOptMainConfig::setPassPipelineParser(), mlir::OperationState::setProperties(), mlir::DynamicOpDefinition::setPropertiesFromAttr(), mlir::RegisteredOperationName::Model< ConcreteOp >::setPropertiesFromAttr(), translateDataLayout(), mlir::DynamicAttrDefinition::verify(), mlir::DynamicTypeDefinition::verify(), mlir::irdl::IsConstraint::verify(), mlir::irdl::BaseAttrConstraint::verify(), mlir::irdl::BaseTypeConstraint::verify(), mlir::irdl::DynParametricAttrConstraint::verify(), mlir::irdl::DynParametricTypeConstraint::verify(), mlir::irdl::AnyOfConstraint::verify(), mlir::irdl::AllOfConstraint::verify(), mlir::irdl::ConstraintVerifier::verify(), mlir::irdl::RegionConstraint::verify(), mlir::detail::verifyDataLayoutSpec(), verifyDimensionCompatibility(), verifyEntries(), verifyGatherOperandAndResultShape(), verifyInGroupDevice(), mlir::OperationName::verifyInherentAttrs(), mlir::RegisteredOperationName::Model< ConcreteOp >::verifyInherentAttrs(), mlir::gpu::MMAMatrixType::verifyInvariants(), mlir::spirv::InterfaceVarABIAttr::verifyInvariants(), mlir::spirv::VerCapExtAttr::verifyInvariants(), mlir::spirv::MatrixType::verifyInvariants(), mlir::quant::CalibratedQuantizedType::verifyInvariants(), mlir::spirv::SampledImageType::verifyInvariants(), mlir::quant::UniformQuantizedPerAxisType::verifyInvariants(), mlir::quant::UniformQuantizedType::verifyInvariants(), mlir::quant::QuantizedType::verifyInvariants(), mlir::quant::AnyQuantizedType::verifyInvariants(), verifyMapClause(), verifyMeshAxes(), verifyPrivateVarsMapping(), verifyRegionAttribute(), verifyScatterOrSliceOperandAndResultShape(), mlir::detail::verifyTargetSystemSpec(), and verifyVectorConstructionInvariants().

◆ emitError() [2/2]

InFlightDiagnostic mlir::emitError ( Location  loc,
const Twine &  message 
)

Definition at line 329 of file Diagnostics.cpp.

References emitDiag(), and Error.

◆ emitNormalizedLoopBounds()

Range mlir::emitNormalizedLoopBounds ( RewriterBase rewriter,
Location  loc,
OpFoldResult  lb,
OpFoldResult  ub,
OpFoldResult  step 
)

Materialize bounds and step of a zero-based and unit-step loop derived by normalizing the specified bounds and step.

Definition at line 693 of file Utils.cpp.

References mlir::OpBuilder::createOrFold(), emitNormalizedLoopBoundsForIndexType(), getConstantIntValue(), mlir::Builder::getOneAttr(), getType(), getValueOrCreateConstantIntOp(), and mlir::Builder::getZeroAttr().

Referenced by coalesceLoops(), collapseParallelLoops(), and normalizeForallOp().

◆ emitOptionalError()

template<typename... Args>
LogicalResult mlir::emitOptionalError ( std::optional< Location loc,
Args &&...  args 
)

Overloads of the above emission functions that take an optionally null location.

If the location is null, no diagnostic is emitted and a failure is returned. Given that the provided location may be null, these methods take the diagnostic arguments directly instead of relying on the returned InFlightDiagnostic.

Definition at line 497 of file Diagnostics.h.

References mlir::InFlightDiagnostic::append(), and emitError().

Referenced by mlir::arith::getIdentityValueAttr(), mlir::arith::getReductionOp(), and mlir::vector::getVectorReductionOp().

◆ emitOptionalRemark()

template<typename... Args>
LogicalResult mlir::emitOptionalRemark ( std::optional< Location loc,
Args &&...  args 
)

Definition at line 509 of file Diagnostics.h.

References mlir::InFlightDiagnostic::append(), and emitRemark().

◆ emitOptionalWarning()

template<typename... Args>
LogicalResult mlir::emitOptionalWarning ( std::optional< Location loc,
Args &&...  args 
)

Definition at line 503 of file Diagnostics.h.

References mlir::InFlightDiagnostic::append(), and emitWarning().

◆ emitRemark() [1/2]

InFlightDiagnostic mlir::emitRemark ( Location  loc)

Utility method to emit a remark message using this location.

Emit a remark message using this location.

Definition at line 342 of file Diagnostics.cpp.

Referenced by emitOptionalRemark(), mlir::ImplicitLocOpBuilder::emitRemark(), and mlir::Operation::emitRemark().

◆ emitRemark() [2/2]

InFlightDiagnostic mlir::emitRemark ( Location  loc,
const Twine &  message 
)

Definition at line 345 of file Diagnostics.cpp.

References emitDiag(), and Remark.

◆ emitSilenceableFailure() [1/2]

DiagnosedSilenceableFailure mlir::emitSilenceableFailure ( Location  loc,
const Twine &  message = {} 
)
inline

Emits a silenceable failure with the given message.

A silenceable failure must be either suppressed or converted into a definite failure and reported to the user.

Definition at line 256 of file DiagnosedSilenceableFailure.h.

Referenced by containsAll(), dispatchMappedValues(), mlir::transform::expandTargetSpecification(), mlir::transform::TrackingListener::findReplacementOp(), isOpSibling(), pipelineForSharedCopies(), verifyNamedSequenceOp(), and verifyYieldingSingleBlockOp().

◆ emitSilenceableFailure() [2/2]

DiagnosedSilenceableFailure mlir::emitSilenceableFailure ( Operation op,
const Twine &  message = {} 
)
inline

Definition at line 262 of file DiagnosedSilenceableFailure.h.

◆ emitWarning() [1/2]

InFlightDiagnostic mlir::emitWarning ( Location  loc)

◆ emitWarning() [2/2]

InFlightDiagnostic mlir::emitWarning ( Location  loc,
const Twine &  message 
)

Definition at line 337 of file Diagnostics.cpp.

References emitDiag(), and Warning.

◆ encodeBindAttribute()

void mlir::encodeBindAttribute ( ModuleOp  module)

Encodes global variable's descriptor set and binding into its name if they both exist.

Definition at line 1992 of file SPIRVToLLVM.cpp.

References get(), kBinding, kDescriptorSet, mlir::SymbolTable::replaceAllSymbolUses(), and mlir::SymbolTable::setSymbolName().

◆ eraseUnreachableBlocks()

LogicalResult mlir::eraseUnreachableBlocks ( RewriterBase rewriter,
MutableArrayRef< Region regions 
)

Erase the unreachable blocks within the provided regions.

Returns success if any blocks were erased, failure otherwise.

Definition at line 183 of file RegionUtils.cpp.

References mlir::Region::begin(), mlir::Region::empty(), mlir::Region::end(), mlir::RewriterBase::eraseBlock(), and mlir::Region::front().

Referenced by simplifyRegions().

◆ expandDimsToRank()

AffineMap mlir::expandDimsToRank ( AffineMap  map,
int64_t  rank,
const llvm::SmallBitVector &  projectedDimensions 
)

Expand map to operate on rank dims while projecting out the dims in projectedDimensions.

This amounts to composing map with id(rank).dropResults(projectedDimensions).

Definition at line 955 of file AffineMap.cpp.

References mlir::AffineMap::compose(), mlir::AffineMap::dropResults(), mlir::AffineMap::getContext(), and mlir::AffineMap::getMultiDimIdentityMap().

◆ extractFixedOuterLoops()

TileLoops mlir::extractFixedOuterLoops ( scf::ForOp  rootFOrOp,
ArrayRef< int64_t >  sizes 
)

◆ extractFromIntegerArrayAttr()

template<typename IntTy >
SmallVector<IntTy> mlir::extractFromIntegerArrayAttr ( Attribute  attr)

Extract integer values from the assumed ArrayAttr of IntegerAttr.

Definition at line 84 of file StaticValueUtils.h.

◆ failableParallelForEach() [1/2]

template<typename IteratorT , typename FuncT >
LogicalResult mlir::failableParallelForEach ( MLIRContext context,
IteratorT  begin,
IteratorT  end,
FuncT &&  func 
)

Invoke the given function on the elements between [begin, end) asynchronously.

If the given function returns a failure when processing any of the elements, execution is stopped and a failure is returned from this function. This means that in the case of failure, not all elements of the range will be processed. Diagnostics emitted during processing are ordered relative to the element's position within [begin, end). If the provided context does not have multi-threading enabled, this function always processes elements sequentially.

Definition at line 36 of file Threading.h.

References mlir::ParallelDiagnosticHandler::eraseOrderIDForThread(), mlir::MLIRContext::isMultithreadingEnabled(), and mlir::ParallelDiagnosticHandler::setOrderIDForThread().

Referenced by failableParallelForEach(), failableParallelForEachN(), and parallelForEach().

◆ failableParallelForEach() [2/2]

template<typename RangeT , typename FuncT >
LogicalResult mlir::failableParallelForEach ( MLIRContext context,
RangeT &&  range,
FuncT &&  func 
)

Invoke the given function on the elements in the provided range asynchronously.

If the given function returns a failure when processing any of the elements, execution is stopped and a failure is returned from this function. This means that in the case of failure, not all elements of the range will be processed. Diagnostics emitted during processing are ordered relative to the element's position within the range. If the provided context does not have multi-threading enabled, this function always processes elements sequentially.

Definition at line 90 of file Threading.h.

References failableParallelForEach().

◆ failableParallelForEachN()

template<typename FuncT >
LogicalResult mlir::failableParallelForEachN ( MLIRContext context,
size_t  begin,
size_t  end,
FuncT &&  func 
)

Invoke the given function on the elements between [begin, end) asynchronously.

If the given function returns a failure when processing any of the elements, execution is stopped and a failure is returned from this function. This means that in the case of failure, not all elements of the range will be processed. Diagnostics emitted during processing are ordered relative to the element's position within [begin, end). If the provided context does not have multi-threading enabled, this function always processes elements sequentially.

Definition at line 105 of file Threading.h.

References failableParallelForEach().

◆ filterTypesOut()

TypeRange mlir::filterTypesOut ( TypeRange  types,
const BitVector &  indices,
SmallVectorImpl< Type > &  storage 
)

Filters out any elements referenced by indices.

If any types are removed, storage is used to hold the new type list. Returns the new type list.

Definition at line 195 of file TypeUtilities.cpp.

◆ finalizeParallelLoopToGPUConversion()

void mlir::finalizeParallelLoopToGPUConversion ( Operation op)

Clean up after applyPartialConversion/applyFullConversion call.

Definition at line 687 of file SCFToGPU.cpp.

References kVisitedAttrName, and mlir::Operation::walk().

◆ findPositionsOfType()

void mlir::findPositionsOfType ( ArrayRef< utils::IteratorType >  iteratorTypes,
utils::IteratorType  iteratorTypeName,
SmallVectorImpl< unsigned > &  res 
)
inline

Return positions in iteratorTypes that match iteratorTypeName.

Definition at line 77 of file StructuredOpsUtils.h.

References mlir::detail::enumerate().

◆ foldAttributesIntoMap()

AffineMap mlir::foldAttributesIntoMap ( Builder b,
AffineMap  map,
ArrayRef< OpFoldResult operands,
SmallVector< Value > &  remainingValues 
)

Fold all attributes among the given operands into the affine map.

Return the folded affine map. Return all remaining values via remainingValues.

Definition at line 745 of file AffineMap.cpp.

References mlir::Builder::getAffineConstantExpr(), mlir::Builder::getAffineDimExpr(), mlir::Builder::getAffineSymbolExpr(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumSymbols(), and mlir::AffineMap::replaceDimsAndSymbols().

Referenced by mlir::ValueBoundsConstraintSet::areOverlappingSlices(), mlir::affine::makeComposedAffineApply(), and makeComposedMinMax().

◆ foldDynamicIndexList()

LogicalResult mlir::foldDynamicIndexList ( SmallVectorImpl< OpFoldResult > &  ofrs,
bool  onlyNonNegative = false,
bool  onlyNonZero = false 
)

Returns "success" when any of the elements in ofrs is a constant value.

In that case the value is replaced by an attribute. Returns "failure" when no folding happened. If onlyNonNegative and onlyNonZero are set, only non-negative and non-zero constant values are folded respectively.

Definition at line 293 of file StaticValueUtils.cpp.

References getConstantIntValue(), m_Constant(), and matchPattern().

Referenced by foldDynamicOffsetSizeList(), foldDynamicStrideList(), and mlir::OpWithOffsetSizesAndStridesConstantArgumentFolder< OpType, ResultTypeFn, CastOpFunc >::matchAndRewrite().

◆ foldDynamicOffsetSizeList()

LogicalResult mlir::foldDynamicOffsetSizeList ( SmallVectorImpl< OpFoldResult > &  offsetsOrSizes)

Returns "success" when any of the elements in offsetsOrSizes is a constant value.

In that case the value is replaced by an attribute. Returns "failure" when no folding happened. Invalid values are not folded to avoid canonicalization crashes.

Definition at line 314 of file StaticValueUtils.cpp.

References foldDynamicIndexList().

◆ foldDynamicStrideList()

LogicalResult mlir::foldDynamicStrideList ( SmallVectorImpl< OpFoldResult > &  strides)

Returns "success" when any of the elements in strides is a constant value.

In that case the value is replaced by an attribute. Returns "failure" when no folding happened. Invalid values are not folded to avoid canonicalization crashes.

Definition at line 319 of file StaticValueUtils.cpp.

References foldDynamicIndexList().

◆ foldReshapeOp()

template<typename ReshapeOpTy , typename InverseReshapeOpTy >
static OpFoldResult mlir::foldReshapeOp ( ReshapeOpTy  reshapeOp,
ArrayRef< Attribute operands 
)
static

Definition at line 86 of file ReshapeOpsUtils.h.

◆ fuseIndependentSiblingForallLoops()

scf::ForallOp mlir::fuseIndependentSiblingForallLoops ( scf::ForallOp  target,
scf::ForallOp  source,
RewriterBase rewriter 
)

Given two scf.forall loops, target and source, fuses target into source.

Assumes that the given loops are siblings and are independent of each other.

This function does not perform any legality checks and simply fuses the loops. The caller is responsible for ensuring that the loops are legal to fuse.

Definition at line 1364 of file Utils.cpp.

References mlir::OpBuilder::clone(), mlir::OpBuilder::create(), mlir::IRMapping::map(), mlir::RewriterBase::replaceOp(), mlir::OpBuilder::setInsertionPointAfter(), and mlir::OpBuilder::setInsertionPointToStart().

◆ fuseIndependentSiblingForLoops()

scf::ForOp mlir::fuseIndependentSiblingForLoops ( scf::ForOp  target,
scf::ForOp  source,
RewriterBase rewriter 
)

Given two scf.for loops, target and source, fuses target into source.

Assumes that the given loops are siblings and are independent of each other.

This function does not perform any legality checks and simply fuses the loops. The caller is responsible for ensuring that the loops are legal to fuse.

Definition at line 1416 of file Utils.cpp.

References mlir::OpBuilder::clone(), mlir::OpBuilder::create(), mlir::IRMapping::map(), mlir::RewriterBase::replaceOp(), mlir::OpBuilder::setInsertionPointAfter(), and mlir::OpBuilder::setInsertionPointToStart().

◆ generateLocationsFromIR() [1/4]

void mlir::generateLocationsFromIR ( raw_ostream &  os,
StringRef  fileName,
Operation op,
OpPrintingFlags  flags 
)

This function generates new locations from the given IR by snapshotting the IR to the given stream, and using the printed locations within that stream.

The generated locations replace the current operation locations.

Definition at line 101 of file LocationSnapshot.cpp.

Referenced by generateLocationsFromIR(), and generateLocationsFromIR().

◆ generateLocationsFromIR() [2/4]

void mlir::generateLocationsFromIR ( raw_ostream &  os,
StringRef  fileName,
StringRef  tag,
Operation op,
OpPrintingFlags  flags 
)

This function generates new locations from the given IR by snapshotting the IR to the given stream, and using the printed locations within that stream.

The generated locations are represented as a NameLoc with the given tag as the name, and then fused with the existing locations.

Definition at line 117 of file LocationSnapshot.cpp.

References generateLocationsFromIR().

◆ generateLocationsFromIR() [3/4]

LogicalResult mlir::generateLocationsFromIR ( StringRef  fileName,
Operation op,
OpPrintingFlags  flags 
)

This function generates new locations from the given IR by snapshotting the IR to the given file, and using the printed locations within that file.

If filename is empty, a temporary file is generated instead.

Definition at line 108 of file LocationSnapshot.cpp.

References generateLocationsFromIR().

◆ generateLocationsFromIR() [4/4]

LogicalResult mlir::generateLocationsFromIR ( StringRef  fileName,
StringRef  tag,
Operation op,
OpPrintingFlags  flags 
)

This function generates new locations from the given IR by snapshotting the IR to the given file, and using the printed locations within that file.

If filename is empty, a temporary file is generated instead.

Definition at line 125 of file LocationSnapshot.cpp.

References generateLocationsFromIR().

◆ get()

template<typename T , typename... Ts>
auto mlir::get ( MLIRContext context,
Ts &&...  params 
)

Helper method that injects context only if needed, this helps unify some of the attribute construction methods.

Definition at line 509 of file BytecodeImplementation.h.

Referenced by addAtomicRMW(), mlir::OperationState::addAttribute(), addComdat(), mlir::ROCDL::SerializeGPUModuleBase::addControlVariables(), addOpaquePointerConversion(), addResumeFunction(), addScopeToFunction(), allocateSubviewGPUMemoryInAddressSpace(), allocBuffer(), mlir::sparse_tensor::allocDenseTensor(), mlir::NamedAttrList::append(), mlir::NVVM::SerializeGPUModuleBase::appendStandardLibs(), mlir::ROCDL::SerializeGPUModuleBase::appendStandardLibs(), appendX1Dim(), applyPad(), applyPassManagerCLOptions(), applyToIntegerAttrs(), areAllIndicesI32(), mlir::transform::detail::assembleTransformLibraryFromPaths(), bitAndAddrspaceCast(), broadcast(), mlir::tensor::bubbleUpPadSlice(), mlir::bufferization::func_ext::FuncOpInterface::bufferize(), mlir::NVVM::PtxBuilder::build(), mlir::affine::AffineDmaStartOp::build(), mlir::affine::AffineDmaWaitOp::build(), HopperBuilder::buildAndInitBarrierInSharedMemory(), mlir::bufferization::buildDeallocationLibraryFunction(), HopperBuilder::buildGlobalMemRefDescriptor(), buildLLVMFunctionType(), buildPackingLoopNestImpl(), mlir::tosa::buildQTypeAttrFromMinMax(), buildSequentialConstant(), buildUnrealizedCast(), calculateMemoryRequirements(), castAllocFuncResult(), mlir::quant::QuantizedType::castFromExpressedType(), mlir::quant::QuantizedType::castFromStorageType(), castToCompatibleMemRefType(), castToElemPtrPtr(), mlir::quant::QuantizedType::castToExpressedType(), mlir::quant::QuantizedType::castToStorageType(), checkedAddLLVMFnAttribute(), mlir::TensorType::cloneWith(), mlir::BaseMemRefType::cloneWith(), mlir::linalg::collapseOpIterationDims(), collapseValue(), collectSymbolScopes(), collectValidReferencesFor(), computeCollapsedLayoutMap(), computeExpandedLayoutMap(), concatArrayAttr(), mlir::AffineMap::constantFold(), constFoldBinaryOpConditional(), constFoldCastOp(), constFoldUnaryOpConditional(), mlir::detail::constructSubElementReplacement(), mlir::quant::ExpressedToQuantizedConverter::convert(), mlir::arith::convertArithFastMathAttrToLLVM(), mlir::arith::convertArithRoundingModeAttrToLLVM(), convertArrayType(), convertDataOp(), convertFuncOpToLLVMFuncOp(), convertFuncOpTypes(), mlir::LLVMTypeConverter::convertFunctionTypeCWrapper(), mlir::LLVM::ModuleImport::convertGlobals(), convertIntegerArrayToMDNode(), convertIntegerToMDNode(), convertIntegerToMetadata(), mlir::LLVM::ModuleImport::convertIntrinsicArguments(), convertIntrinsicResult(), convertIteratorType(), convertIterSpaceType(), convertLevelType(), convertLinkerOptionsOp(), convertOmpCritical(), convertOmpMasked(), convertOperationImpl(), convertPointerType(), convertRuntimeArrayType(), convertStandaloneDataOp(), convertToAttribute(), convertTransferReadOp(), mlir::LLVM::ModuleImport::convertValue(), convertVecTypeHint(), convertVecTypeHintToMDNode(), convTypes(), convVals(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::DistinctAttr::create(), createAsyncDispatchFunction(), mlir::nvgpu::createAsyncGroups(), createConstFromIntAttribute(), createCtlzFunc(), createCustomDialectWrapper(), createDimGetterFunctionCall(), createElementFPowIFunc(), createElementIPowIFunc(), createFullPartialVectorTransferRead(), createFullPartialVectorTransferWrite(), mlir::LLVM::createGlobalString(), createGroupReduceOpImpl(), createI32ConstantOf(), createIfNonNull(), createLinalgBodyCalculationForElementwiseOp(), createNewAliasScopesFromNoAliasParameter(), createNonLdMatrixLoads(), mlir::LLVM::createPrintStrCall(), createPrivateMemRef(), createQuickSort(), mlir::vector::createReadOrMaskedRead(), createSortStableFunc(), createVL(), createWriteOrMaskedWrite(), deepCloneAliasScopes(), defaultAllocBufferCallBack(), deserializeCacheControlDecoration(), deserializeModule(), mlir::spirv::Deserializer::processOp< spirv::EntryPointOp >(), mlir::spirv::Deserializer::processOp< spirv::ExecutionModeOp >(), mlir::spirv::Deserializer::processOp< spirv::FunctionCallOp >(), diagnoseInvalidOperandDominance(), mlir::detail::divideCeil(), doAsyncDispatch(), doSequentialDispatch(), dropTrailingX1Dim(), dumpIndexMemRef(), PyAttrBuilderMap::dundeGetItemNamed(), PyAttrBuilderMap::dunderContains(), PyAttrBuilderMap::dundeSetItemNamed(), emulatedVectorLoad(), encodeBindAttribute(), encodeKernelName(), mlir::tosa::EqualizeRanks(), mlir::function_interface_impl::eraseFunctionArguments(), mlir::function_interface_impl::eraseFunctionResults(), expandRank(), extendVectorRank(), mlir::detail::OpPassManagerImpl::finalizePassList(), finalizeWhileOp(), findPayloadRoot(), flattenVecToBits(), foldBinaryOpChecked(), foldBinaryOpUnchecked(), foldCastOp(), foldDynamicToStaticDimSizes(), foldMemRefCasts(), foldMinMaxOp(), mlir::sparse_tensor::foreachFieldAndTypeInSparseTensor(), mlir::sparse_tensor::genAlloca(), mlir::sparse_tensor::genAllocaScalar(), mlir::sparse_tensor::FuncCallOrInlineGenerator< SubClass >::genCallOrInline(), generateCopy(), generateNewRefAttr(), genExpand(), mlir::sparse_tensor::genReader(), genSliceToSize(), mlir::sparse_tensor::genToMemref(), mlir::sparse_tensor::genValFromAttr(), mlir::gpu::MMAMatrixType::get(), mlir::spirv::StructType::get(), mlir::spirv::InterfaceVarABIAttr::get(), mlir::spirv::VerCapExtAttr::get(), mlir::detail::DenseArrayAttrImpl< T >::get(), mlir::DenseElementsAttr::get(), mlir::detail::DenseResourceElementsAttrBase< T >::get(), mlir::spirv::ImageType::get(), mlir::FileLineColLoc::get(), mlir::FlatSymbolRefAttr::get(), mlir::spirv::MatrixType::get(), mlir::spirv::RuntimeArrayType::get(), mlir::spirv::CooperativeMatrixType::get(), mlir::spirv::ArrayType::get(), mlir::quant::CalibratedQuantizedType::get(), mlir::spirv::SampledImageType::get(), mlir::spirv::PointerType::get(), mlir::quant::UniformQuantizedPerAxisType::get(), mlir::quant::UniformQuantizedType::get(), mlir::quant::AnyQuantizedType::get(), mlir::spirv::TargetEnvAttr::get(), mlir::LLVM::detail::LoopAnnotationTranslation::getAccessGroups(), mlir::Builder::getAffineMapArrayAttr(), mlir::affine::AffineDmaStartOp::getAffineMapAttrForMemRef(), mlir::affine::AffineDmaWaitOp::getAffineMapAttrForMemRef(), mlir::Builder::getArrayAttr(), getAsIndexOpFoldResult(), mlir::Builder::getAttr(), mlir::pdl_to_pdl_interp::PredicateBuilder::getAttribute(), getAttributeIndexFromIndexOperands(), mlir::FloatType::getBF16(), mlir::Builder::getBoolVectorAttr(), mlir::OpTrait::util::getBroadcastedType(), mlir::bufferization::func_ext::getBufferizedFunctionArgType(), getByteArrayType(), getCallOpVarCalleeType(), getCanonicalSubViewResultType(), VectorizationState::getCanonicalVecType(), mlir::python::PyBlock::getCapsule(), getCastCompatibleMemRefType(), getCharPtr(), getCompressedMaskOp(), getConvOrPoolOutputDim(), mlir::sparse_tensor::SparseTensorType::getCOOType(), mlir::detail::getDefaultABIAlignment(), mlir::detail::getDefaultDiagnosticEmitFn(), mlir::detail::getDefaultPreferredAlignment(), mlir::spirv::getDefaultResourceLimits(), getDefaultStorageParams(), mlir::detail::getDefaultTypeSizeInBits(), mlir::sparse_tensor::SparseTensorType::getDemappedType(), getDenseResource(), mlir::python::PyDialects::getDialectForKey(), mlir::Builder::getDictionaryAttr(), mlir::Operation::getDiscardableAttrDictionary(), getDistinctOrUnique(), getDynamicSharedMemorySymbol(), getElementalFuncTypeForOp(), mlir::ConvertToLLVMPattern::getElementPtrType(), mlir::spirv::StructType::getEmpty(), mlir::spirv::getEntryPointABIAttr(), getExpandedType(), mlir::shape::getExtentTensorType(), mlir::FloatType::getF128(), mlir::FloatType::getF16(), mlir::Builder::getF16FloatAttr(), mlir::FloatType::getF32(), mlir::Builder::getF32FloatAttr(), mlir::Builder::getF32VectorAttr(), mlir::FloatType::getF64(), mlir::Builder::getF64FloatAttr(), mlir::Builder::getF64VectorAttr(), mlir::FloatType::getF80(), mlir::LLVM::getFixedVectorType(), mlir::FloatType::getFloat4E2M1FN(), mlir::FloatType::getFloat6E2M3FN(), mlir::FloatType::getFloat6E3M2FN(), mlir::FloatType::getFloat8E3M4(), mlir::FloatType::getFloat8E4M3(), mlir::FloatType::getFloat8E4M3B11FNUZ(), mlir::FloatType::getFloat8E4M3FN(), mlir::FloatType::getFloat8E4M3FNUZ(), mlir::FloatType::getFloat8E5M2(), mlir::FloatType::getFloat8E5M2FNUZ(), mlir::FloatType::getFloat8E8M0FNU(), mlir::Builder::getFloatAttr(), mlir::sparse_tensor::getFunc(), mlir::Builder::getFunctionType(), mlir::Builder::getFusedLoc(), getGetValueTypeOpValueType(), mlir::bufferization::getGlobalFor(), mlir::Builder::getI16IntegerAttr(), mlir::Builder::getI16Type(), getI1SameShape(), mlir::Builder::getI1Type(), mlir::Builder::getI2Type(), mlir::Builder::getI32IntegerAttr(), mlir::Builder::getI32TensorAttr(), mlir::Builder::getI32Type(), mlir::Builder::getI32VectorAttr(), mlir::Builder::getI4Type(), mlir::Builder::getI64IntegerAttr(), mlir::Builder::getI64TensorAttr(), mlir::Builder::getI64Type(), mlir::Builder::getI64VectorAttr(), mlir::Builder::getI8IntegerAttr(), mlir::Builder::getI8Type(), mlir::spirv::StructType::getIdentified(), mlir::Builder::getIndexArrayAttr(), mlir::Builder::getIndexAttr(), mlir::Builder::getIndexTensorAttr(), mlir::Builder::getIndexType(), mlir::LLVMTypeConverter::getIndexType(), mlir::Builder::getIndexVectorAttr(), getInitializerTypeForGlobal(), mlir::sparse_tensor::SparseTensorSpecifier::getInitValue(), mlir::Builder::getIntegerAttr(), mlir::Builder::getIntegerType(), getInterfaceVariables(), mlir::ConvertToLLVMPattern::getIntPtrType(), mlir::ROCDL::getKernelMetadata(), getLaneId(), mlir::DataFlowSolver::getLatticeAnchor(), getLibraryCallSymbolRef(), mlir::LLVM::detail::getLLVMConstant(), mlir::arith::getLLVMDefaultFPExceptionBehavior(), getLLVMFuncType(), mlir::dataflow::CFGEdge::getLoc(), getMangledSortHelperFunc(), mlir::ConvertToLLVMPattern::getMemRefDescriptorSizes(), mlir::bufferization::getMemRefType(), mlir::bufferization::getMemRefTypeWithFullyDynamicLayout(), mlir::bufferization::getMemRefTypeWithStaticIdentityLayout(), mlir::nvgpu::getMmaSyncRegisterType(), getMmaSyncVectorOperandType(), mlir::Builder::getNoneType(), getNormalizedEncodingForSpecifier(), mlir::sparse_tensor::getOpaquePointerType(), mlir::LLVM::ModuleTranslation::getOrCreateAliasScope(), mlir::LLVM::ModuleTranslation::getOrCreateAliasScopes(), getOrCreateFormatStringConstant(), mlir::MLIRContext::getOrLoadDynamicDialect(), getOverloadedDeclaration(), getPackOpSourceOrPaddedSource(), getPointerSpec(), mlir::LLVM::getScalableVectorType(), getScalarConstantAsAttr(), getScalarOrVectorConstInt(), getSharedAddressSpaceAttribute(), mlir::Builder::getSI32IntegerAttr(), mlir::emitc::getSignedTypeFor(), mlir::ConvertToLLVMPattern::getSizeInBytes(), mlir::arm_sme::getSMETileTypeForElement(), mlir::Builder::getStringAttr(), mlir::memref::getTensorTypeFromMemRefType(), mlir::FloatType::getTF32(), mlir::Builder::getTupleType(), mlir::tosa::ValueKnowledge::getType(), mlir::Builder::getType(), mlir::Builder::getTypeArrayAttr(), mlir::Builder::getUI32IntegerAttr(), mlir::spirv::getUnaryOpResultType(), mlir::Builder::getUnitAttr(), mlir::Builder::getUnknownLoc(), mlir::emitc::getUnsignedTypeFor(), getValAndBoolStructType(), mlir::LLVM::getVectorType(), getVectorType(), mlir::ConvertToLLVMPattern::getVoidPtrType(), mlir::ConvertToLLVMPattern::getVoidType(), mlir::transform::gpu::GpuBlockIdBuilder::GpuBlockIdBuilder(), mlir::transform::gpu::GpuThreadIdBuilder::GpuThreadIdBuilder(), mlir::transform::gpu::GpuWarpgroupIdBuilder::GpuWarpgroupIdBuilder(), mlir::transform::gpu::GpuWarpIdBuilder::GpuWarpIdBuilder(), handleInlinedAllocas(), handleLoopAnnotations(), handleMultidimensionalVectors(), mlir::tracing::InstallDebugHandler::Impl::Impl(), inferCastResultType(), inferIntrinsicResultType(), mlir::detail::inferReturnTensorTypes(), inferSideEffectAnnotations(), inferSparseBufferType(), inferStridedSliceOpResultType(), mlir::vector::inferTransferOpMaskType(), inferTransposeResultType(), mlir::LLVMImportInterface::initializeImport(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), mlir::function_interface_impl::insertFunctionArguments(), mlir::function_interface_impl::insertFunctionResults(), invertPredicate(), irdlOpVerifier(), isBatchMatvec(), isBatchVecmat(), isMatvec(), isVecmat(), joinShapes(), linearId0(), linearId1(), linearId2(), mlir::spirv::linearizeIndex(), mlir::LLVMTypeConverter::LLVMTypeConverter(), loadIRDLDialects(), mlir::SymbolTable::lookup(), mlir::LLVM::lookupOrCreateFn(), mlir::LLVM::lookupOrCreateFreeFn(), mlir::LLVM::lookupOrCreateGenericFreeFn(), mlir::LLVM::lookupOrCreateMemRefCopyFn(), mlir::LLVM::lookupOrCreatePrintBF16Fn(), mlir::LLVM::lookupOrCreatePrintCloseFn(), mlir::LLVM::lookupOrCreatePrintCommaFn(), mlir::LLVM::lookupOrCreatePrintF16Fn(), mlir::LLVM::lookupOrCreatePrintF32Fn(), mlir::LLVM::lookupOrCreatePrintF64Fn(), mlir::LLVM::lookupOrCreatePrintI64Fn(), mlir::LLVM::lookupOrCreatePrintNewlineFn(), mlir::LLVM::lookupOrCreatePrintOpenFn(), mlir::LLVM::lookupOrCreatePrintStringFn(), mlir::LLVM::lookupOrCreatePrintU64Fn(), lookupOrCreateSPIRVFn(), mlir::SymbolTable::lookupSymbolIn(), lowerEntryPointABIAttr(), mlir::LowerToLLVMOptions::LowerToLLVMOptions(), makeArrayAttr(), makeI64ArrayAttr(), makeStridedLayoutDynamic(), matchAndReplaceDepthwiseConv(), mlir::GPUDynamicSharedMemoryOpLowering::matchAndRewrite(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), SwapTransposeWithBroadcast::matchAndRewrite(), mlir::gpu::index_lowering::OpLowering< Op, XOp, YOp, ZOp >::matchAndRewrite(), ConvertLoad::matchAndRewrite(), InsertSliceVectorizePattern::matchAndRewrite(), mlir::linalg::DecomposeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), MaterializePadValue::matchAndRewrite(), ConsolidateTransposeOptimization::matchAndRewrite(), matchAndRewriteSortOp(), memcpyRewire(), mlir::spirv::MemorySpaceToStorageClassConverter::MemorySpaceToStorageClassConverter(), memsetRewire(), mergeInto(), mergeOverflowFlags(), minMaxValueForFloat(), minMaxValueForSignedInt(), minMaxValueForUnsignedInt(), mlirAffineMapAttrGet(), mlirArrayAttrGet(), mlirAttributeGetType(), mlirComplexTypeGet(), mlirDictionaryAttrGet(), mlirDictionaryAttrGetElementByName(), mlirFloatAttrDoubleGet(), mlirFunctionTypeGet(), mlirGPUObjectAttrGet(), mlirGPUObjectAttrGetWithKernels(), mlirIdentifierGet(), mlirIndexTypeGet(), mlirIntegerAttrGet(), mlirIntegerSetAttrGet(), mlirIntegerTypeGet(), mlirIntegerTypeSignedGet(), mlirIntegerTypeUnsignedGet(), mlirLLVMArrayTypeGet(), mlirLLVMCConvAttrGet(), mlirLLVMComdatAttrGet(), mlirLLVMDIAnnotationAttrGet(), mlirLLVMDIBasicTypeAttrGet(), mlirLLVMDICompileUnitAttrGet(), mlirLLVMDICompositeTypeAttrGet(), mlirLLVMDIDerivedTypeAttrGet(), mlirLLVMDIExpressionAttrGet(), mlirLLVMDIExpressionElemAttrGet(), mlirLLVMDIFileAttrGet(), mlirLLVMDIFlagsAttrGet(), mlirLLVMDIImportedEntityAttrGet(), mlirLLVMDILexicalBlockAttrGet(), mlirLLVMDILexicalBlockFileAttrGet(), mlirLLVMDILocalVariableAttrGet(), mlirLLVMDIModuleAttrGet(), mlirLLVMDINullTypeAttrGet(), mlirLLVMDIStringTypeAttrGet(), mlirLLVMDISubprogramAttrGet(), mlirLLVMDISubroutineTypeAttrGet(), mlirLLVMFunctionTypeGet(), mlirLLVMLinkageAttrGet(), mlirLLVMPointerTypeGet(), mlirLLVMVoidTypeGet(), mlirLocationCallSiteGet(), mlirLocationFusedGet(), mlirLocationNameGet(), mlirLocationUnknownGet(), mlirMemRefTypeContiguousGet(), mlirMemRefTypeGet(), mlirNoneTypeGet(), mlirNVGPUTensorMapDescriptorTypeGet(), mlirOpaqueAttrGet(), mlirOpaqueTypeGet(), mlirOperationSetInherentAttributeByName(), mlirOpOperandGetValue(), mlirPDLAttributeTypeGet(), mlirPDLOperationTypeGet(), mlirPDLRangeTypeGet(), mlirPDLTypeTypeGet(), mlirPDLValueTypeGet(), mlirRankedTensorTypeGet(), mlirReduceMain(), mlirSparseElementsAttribute(), mlirSparseTensorEncodingAttrGet(), mlirStridedLayoutAttrGet(), mlirStringAttrGet(), mlirStringAttrTypedGet(), mlirSymbolRefAttrGet(), mlirSymbolTableReplaceAllSymbolUses(), mlirTransformAnyOpTypeGet(), mlirTransformAnyParamTypeGet(), mlirTransformAnyValueTypeGet(), mlirTransformOperationTypeGet(), mlirTransformParamTypeGet(), mlirTupleTypeGet(), mlirTypeAttrGet(), mlirUnitAttrGet(), mlirUnmanagedDenseResourceElementsAttrGet(), mlirUnrankedMemRefTypeGet(), mlirUnrankedTensorTypeGet(), mlirVectorTypeGet(), mlirVectorTypeGetScalable(), mlir::x86vector::avx2::inline_asm::mm256BlendPsAsm(), mlir::mesh::moveLastSplitAxisInResharding(), mlir::arith::NarrowTypeEmulationConverter::NarrowTypeEmulationConverter(), mlir::affine::normalizeMemRefType(), mlir::dataflow::IntegerValueRangeLattice::onUpdate(), mlir::OperationName::OperationName(), mlir::detail::DenseArrayAttrImpl< int32_t >::operator ArrayRef< int32_t >(), mlir::MemRefType::Builder::operator MemRefType(), mlir::RankedTensorType::Builder::operator RankedTensorType(), mlir::VectorType::Builder::operator VectorType(), SubViewReturnTypeCanonicalizer::operator()(), mlir::LLVM::GEPIndicesAdaptor< DynamicRange >::iterator::operator*(), mlir::DenseElementsAttr::AttributeElementIterator::operator*(), optionalLevelAttr(), outlineExecuteOp(), outlineKernelFuncImpl(), outlineSingleBlockRegion(), packFunctionArguments(), padOperandToSmallestStaticBoundingBox(), parseAffineMapWithMinMax(), parseAllReduceOperation(), mlir::detail::Parser::parseAttribute(), parseBound(), mlir::detail::Parser::parseCallSiteLocation(), parseCaptureType(), parseClauseAttr(), parseCombinedConstructsLoop(), mlir::detail::Parser::parseComplexType(), parseCopyprivate(), mlir::detail::Parser::parseDecOrHexAttr(), mlir::detail::Parser::parseDenseArrayAttr(), mlir::detail::Parser::parseDenseResourceElementsAttr(), parseDependVarList(), parseDeviceTypeArrayAttr(), parseDeviceTypeOperandsWithKeywordOnly(), parseDeviceTypeOperandsWithSegment(), parseEmitCGlobalOpTypeAndInitialValue(), mlir::detail::Parser::parseExtendedAttr(), mlir::detail::Parser::parseFloatAttr(), parseForeachMatchSymbols(), mlir::function_interface_impl::parseFunctionOp(), mlir::detail::Parser::parseFusedLocation(), parseGangClause(), parseGlobalMemrefOpTypeAndInitialValue(), mlir::spirv::parseImageOperands(), parseKeyValuePair(), parseLaunchDimType(), parseLevelRange(), mlir::detail::Parser::parseLocationInstance(), parseMembersIndex(), mlir::detail::Parser::parseNameOrFileLineColRange(), mlir::detail::Parser::parseNonFunctionType(), parseNumGangs(), parseOneOpBundle(), parseOpBundles(), mlir::detail::Parser::parseOptionalAttribute(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalSymbolName(), parseOrderClause(), mlir::Op< ConcreteType, Traits >::parseProperties(), parseRangeType(), parseResultsValueType(), parseRoutineGangClause(), parseScheduleClause(), mlir::detail::Parser::parseSparseElementsAttr(), mlir::detail::Parser::parseStridedLayoutAttr(), parseSwitchOpCases(), parseSymOperandList(), parseSynchronizationHint(), mlir::detail::Parser::parseTensorType(), mlir::transform::detail::parseTransformModuleFromFile(), mlir::detail::Parser::parseTupleType(), mlir::Dialect::parseType(), parseTypedInitialValue(), mlir::tosa::parseTypeOrAttr(), parseValuesWithVariadicity(), parseValueWithVariadicity(), parseVarPtrType(), parseWaitClause(), performActions(), populateAMXLegalizeForLLVMExportPatterns(), populateAsyncStructuralTypeConversionsAndLegality(), populateEmitCSizeTTypeConversions(), populateGpuToNVVMConversionPatterns(), mlir::memref::populateMemRefNarrowTypeEmulationConversions(), populateMemRefToEmitCTypeConversion(), populateMMAToSPIRVCoopMatrixTypeConversion(), mlir::vector::populateVectorLinearizeTypeConversionsAndLegality(), printClauseWithRegionArgs(), printMinMaxBound(), printOffloadingHandler(), mlir::LLVM::ModuleImport::processFunctionAttributes(), processMemoryEffects(), processOperands(), processPassthroughAttrs(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), promoteSubViews(), reducedVectorTypeBack(), reduceInnermostDim(), mlir::ExtensibleDialect::registerDynamicAttr(), mlir::ExtensibleDialect::registerDynamicType(), registerFromLLVMIRTranslation(), remapInlinedLocations(), mlir::Operation::removeAttr(), mlir::Operation::removeDiscardableAttr(), mlir::SymbolTable::rename(), renameSymbol(), mlir::SymbolTable::renameToUnique(), mlir::LLVM::MergeFragments::replace(), replaceAllSymbolUsesImpl(), mlir::IntegerSet::replaceDimsAndSymbols(), replaceOpWithPredicatedOp(), mlir::linalg::rewriteAsPaddedOp(), rewriteI4ToI8SignedExt(), rewriteI4ToI8UnsignedExt(), rewriteI8ToI4Trunc(), mlir::linalg::rewriteInIm2Col(), PadOpVectorizationWithInsertSlicePattern::rewriteUser(), mlir::NamedAttrList::set(), setAccessGroupsAttr(), setAliasScopesAttr(), mlir::function_interface_impl::setAllArgAttrDicts(), setAllArgResAttrDicts(), mlir::function_interface_impl::setAllResultAttrDicts(), mlir::function_interface_impl::setArgAttrs(), setArgResAttrDict(), mlir::Operation::setAttr(), setAttributionAttrs(), mlir::Operation::setAttrs(), mlir::Operation::setDiscardableAttr(), mlir::Operation::setDiscardableAttrs(), mlir::LLVM::ModuleImport::setFastmathFlagsAttr(), mlir::function_interface_impl::setFunctionType(), setNoaliasScopesAttr(), mlir::MlirOptMainConfig::setPassPipelineParser(), mlir::function_interface_impl::setResultAttrs(), mlir::UnrankedMemRefDescriptor::setSize(), mlir::UnrankedMemRefDescriptor::setStride(), mlir::SymbolTable::setSymbolName(), mlir::SymbolTable::setSymbolVisibility(), setTBAAAttr(), setupCoroMachinery(), mlir::LLVM::DIExpressionRewriter::simplify(), mlir::UnrankedMemRefDescriptor::size(), mlir::MemRefDescriptor::size(), mlir::UnrankedMemRefDescriptor::sizeBasePtr(), sourceMaterializationCallback(), mlir::vector::splitFullAndPartialTransfer(), mlir::linalg::splitReduction(), mlir::mesh::spmdizeFuncOp(), mlir::sparse_tensor::CodegenEnv::startEmit(), mlir::UnrankedMemRefDescriptor::stride(), mlir::UnrankedMemRefDescriptor::strideBasePtr(), mlir::SymbolTable::SymbolTable(), translateDataLayout(), mlir::LLVM::detail::DebugImporter::translateExpression(), mlir::LLVM::detail::DebugTranslation::translateExpression(), mlir::LLVM::detail::DebugImporter::translateFuncLocation(), mlir::LLVM::detail::DebugImporter::translateGlobalVariableExpression(), mlir::LLVM::detail::DebugTranslation::translateGlobalVariableExpression(), translateLLVMIRToModule(), mlir::LLVM::detail::DebugImporter::translateLoc(), translateMap(), mlir::x86vector::avx2::transpose4x8xf32(), mlir::x86vector::avx2::transpose8x8xf32(), trimLeadingOneDims(), trimNonScalableUnitDims(), mlir::mesh::tryUpdateHaloInResharding(), mlir::mesh::unsplitLastAxisInResharding(), updateCalls(), updateFuncOp(), vectorizeAsTensorPackOp(), vectorizeAsTensorUnpackOp(), mlir::linalg::vectorizeCopy(), mlir::irdl::RegionConstraint::verify(), verifyOutputShape(), verifyTransferOp(), walkIndicesAsAttr(), mlir::arith::WideIntEmulationConverter::WideIntEmulationConverter(), wmmaPushInputOperand(), wrapExternalFunction(), mlir::detail::wrapIntegerMemorySpace(), and wrapNumericMemorySpace().

◆ getAffineBinaryOpExpr()

AffineExpr mlir::getAffineBinaryOpExpr ( AffineExprKind  kind,
AffineExpr  lhs,
AffineExpr  rhs 
)

◆ getAffineConstantExpr()

AffineExpr mlir::getAffineConstantExpr ( int64_t  constant,
MLIRContext context 
)

Definition at line 641 of file AffineExpr.cpp.

References mlir::StorageUniquer::get(), and mlir::MLIRContext::getAffineUniquer().

Referenced by canonicalizeMapOrSetAndOperands(), mlir::AffineExpr::ceilDiv(), mlir::AffineMap::compose(), composeAffineMapAndOperands(), computeProduct(), computeSuffixProduct(), computeSum(), detectAsFloorDiv(), mlir::linalg::dropUnitDims(), mlir::AffineExpr::floorDiv(), mlir::Builder::getAffineConstantExpr(), getAffineConstantExprs(), getAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getAsIntegerSet(), mlir::AffineMap::getConstantMap(), mlir::IntegerSet::getEmptySet(), getSemiAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getSliceBounds(), mlir::vector::getTransferMinorIdentityMap(), inverseAndBroadcastProjectedPermutation(), isModOfModSubtraction(), linearize(), mlir::affine::linearizeIndex(), makeCanonicalStridedLayoutExpr(), makePermutationMap(), makeStridedLinearLayoutMap(), mlirAffineConstantExprGet(), mlir::AffineExpr::operator%(), mlir::AffineExpr::operator*(), mlir::AffineExpr::operator+(), mlir::AffineExpr::operator-(), mlir::AffineExpr::operator==(), mlir::AffineMap::partialConstantFold(), projectCommonImpl(), simplifyAdd(), simplifyCeilDiv(), simplifyExprAndOperands(), simplifyFloorDiv(), simplifyMinOrMaxExprWithOperands(), simplifyMod(), simplifyMul(), simplifySemiAffine(), sliceTransferIndices(), symbolicDivide(), transferReadSupportsMMAMatrixType(), translateMap(), verifyOutputShape(), and mlir::SimpleAffineExprFlattener::visitModExpr().

◆ getAffineConstantExprs()

SmallVector< AffineExpr > mlir::getAffineConstantExprs ( ArrayRef< int64_t >  constants,
MLIRContext context 
)

◆ getAffineDimExpr()

AffineExpr mlir::getAffineDimExpr ( unsigned  position,
MLIRContext context 
)

These free functions allow clients of the API to not use classes in detail.

Definition at line 617 of file AffineExpr.cpp.

References DimId, and getAffineDimOrSymbol().

Referenced by adjustMap(), mlir::detail::bindDims(), bindDimsList(), calculateImplicitMap(), canonicalizeMapOrSetAndOperands(), canonicalizePromotedSymbols(), common3DIdBuilderFn(), commonLinearIdBuilderFn(), mlir::AffineMap::compose(), composeAffineMapAndOperands(), computeIteratorTypesAndIndexingMaps(), mlir::FlatLinearConstraints::computeLocalVars(), mlir::linalg::computeTileSizes(), convertReassociationIndicesToExprs(), deduplicateAndResolveOperands(), mlir::linalg::dropUnitDims(), genReplaceDimToLvlMap(), mlir::Builder::getAffineDimExpr(), getAffineExprFromFlatForm(), getCollapsedOpIndexingMap(), getDimMap(), mlir::nvgpu::getLaneIdToLdMatrixMatrixCoord(), mlir::AffineMap::getMultiDimIdentityMap(), mlir::AffineMap::getMultiDimMapWithTargets(), getSemiAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getSliceBounds(), insertParallelDim(), inverseAndBroadcastProjectedPermutation(), mlir::sparse_tensor::inverseBlockSparsity(), inversePermutation(), mlir::AffineExpr::isFunctionOfDim(), isNormalizedMemRefDynamicDim(), mlir::linalg::makeAffineDimExprs(), makeCanonicalStridedLayoutExpr(), makePermutationMap(), makeStridedLinearLayoutMap(), mlirAffineDimExprGet(), projectCommonImpl(), replaceDimOrSym(), scaleReductionDim(), mlir::AffineExpr::shiftDims(), sliceTransferIndices(), mlir::linalg::splitReductionByScaling(), transferReadSupportsMMAMatrixType(), and translateMap().

◆ getAffineExprFromFlatForm()

AffineExpr mlir::getAffineExprFromFlatForm ( ArrayRef< int64_t >  flatExprs,
unsigned  numDims,
unsigned  numSymbols,
ArrayRef< AffineExpr localExprs,
MLIRContext context 
)

Constructs an affine expression from a flat ArrayRef.

If there are local identifiers (neither dimensional nor symbolic) that appear in the sum of products expression, 'localExprs' is expected to have the AffineExpr for it, and is substituted into. The ArrayRef 'eq' is expected to be in the format [dims, symbols, locals, constant term].

If there are local identifiers (neither dimensional nor symbolic) that appear in the sum of products expression, localExprs is expected to have the AffineExpr for it, and is substituted into. The ArrayRef flatExprs is expected to be in the format [dims, symbols, locals, constant term].

Definition at line 1048 of file AffineExpr.cpp.

References getAffineConstantExpr(), getAffineDimExpr(), and getAffineSymbolExpr().

Referenced by mlir::FlatLinearConstraints::getAsIntegerSet(), mlir::affine::FlatAffineValueConstraints::getIneqAsAffineValueMap(), mlir::FlatLinearConstraints::getLowerAndUpperBound(), simplifyAffineExpr(), mlir::SimpleAffineExprFlattener::visitModExpr(), and mlir::SimpleAffineExprFlattener::visitMulExpr().

◆ getAffineSymbolExpr()

AffineExpr mlir::getAffineSymbolExpr ( unsigned  position,
MLIRContext context 
)

◆ getAsIndexOpFoldResult() [1/2]

SmallVector<OpFoldResult> mlir::getAsIndexOpFoldResult ( MLIRContext ctx,
ArrayRef< int64_t >  values 
)

Definition at line 113 of file StaticValueUtils.cpp.

References getAsIndexOpFoldResult().

◆ getAsIndexOpFoldResult() [2/2]

OpFoldResult mlir::getAsIndexOpFoldResult ( MLIRContext ctx,
int64_t  val 
)

Convert int64_t to integer attributes of index type and return them as OpFoldResult.

Definition at line 109 of file StaticValueUtils.cpp.

References get().

Referenced by HopperBuilder::buildPredicateLoadsOnThread0(), commonLinearIdBuilderFn(), computeLinearIndex(), and getAsIndexOpFoldResult().

◆ getAsOpFoldResult() [1/3]

SmallVector< OpFoldResult > mlir::getAsOpFoldResult ( ArrayAttr  arrayAttr)

Convert arrayAttr to a vector of OpFoldResult.

Definition at line 101 of file StaticValueUtils.cpp.

◆ getAsOpFoldResult() [2/3]

OpFoldResult mlir::getAsOpFoldResult ( Value  val)

◆ getAsOpFoldResult() [3/3]

SmallVector< OpFoldResult > mlir::getAsOpFoldResult ( ValueRange  values)

Given an array of values, try to extract a constant Attribute from each value.

If this fails, return the original value.

Definition at line 95 of file StaticValueUtils.cpp.

References getAsOpFoldResult().

◆ getBackwardSlice() [1/2]

void mlir::getBackwardSlice ( Operation op,
SetVector< Operation * > *  backwardSlice,
const BackwardSliceOptions options = {} 
)

Fills backwardSlice with the computed backward slice (i.e.

all the transitive defs of op), without including that operation.

This additionally takes a TransitiveFilter which acts as a frontier: when looking at defs transitively, an operation that does not pass the filter is never propagated through. This allows in particular to carve out the scope within a ForOp or the scope within an IfOp.

The implementation traverses the def chains in postorder traversal for efficiency reasons: if an operation is already in backwardSlice, no need to traverse its definitions again. Since useuse-def chains form a DAG, this terminates.

Upon return to the root call, backwardSlice is filled with a postorder list of defs. This happens to be a topological order, from the point of view of the use-def chains.

Example starting from node 8

1 2 3 4 |_______| |______| | | | | 5 6 |___|_____________| | | 7 8 |_______________| | 9

Assuming all local orders match the numbering order: {1, 2, 5, 3, 4, 6}

Definition at line 138 of file SliceAnalysis.cpp.

References getBackwardSliceImpl(), and options.

Referenced by checkAssumptionForLoop(), computeBackwardSlice(), dependsOnCarriedVals(), getBackwardSlice(), getPipelineStages(), getSlice(), and getSliceContract().

◆ getBackwardSlice() [2/2]

void mlir::getBackwardSlice ( Value  root,
SetVector< Operation * > *  backwardSlice,
const BackwardSliceOptions options = {} 
)

Value-rooted version of getBackwardSlice.

Return the union of all backward slices for the op defining or owning the value root.

Definition at line 150 of file SliceAnalysis.cpp.

References getBackwardSlice(), mlir::Value::getDefiningOp(), mlir::Operation::getParentOp(), and options.

◆ getBlocksSortedByDominance()

SetVector< Block * > mlir::getBlocksSortedByDominance ( Region region)

Gets a list of blocks that is sorted according to dominance.

This sort is stable.

Definition at line 155 of file TopologicalSortUtils.cpp.

References mlir::Region::getBlocks().

Referenced by convertDataOp(), convertOmpOpRegions(), and getOrCreateBlockIndices().

◆ getBoundForAffineExpr()

std::optional< int64_t > mlir::getBoundForAffineExpr ( AffineExpr  expr,
unsigned  numDims,
unsigned  numSymbols,
ArrayRef< std::optional< int64_t >>  constLowerBounds,
ArrayRef< std::optional< int64_t >>  constUpperBounds,
bool  isUpper 
)

Get a lower or upper (depending on isUpper) bound for expr while using the constant lower and upper bounds for its inputs provided in constLowerBounds and constUpperBounds.

Return std::nullopt if such a bound can't be computed. This method only handles simple sum of product expressions (w.r.t constant coefficients) so as to not depend on anything heavyweight in Analysis. Expressions of the form: c0*d0 + c1*d1 + c2*s0 + ... + c_n are handled. Expressions involving floordiv, ceildiv, mod or semi-affine ones will lead a none being returned.

Definition at line 1595 of file AffineExpr.cpp.

References CeilDiv, FloorDiv, Mod, mlir::SimpleAffineExprFlattener::numLocals, mlir::SimpleAffineExprFlattener::operandExprStack, and mlir::AffineExprVisitor< SubClass, RetTy >::walkPostOrder().

Referenced by getLowerBound(), getUpperBound(), and simplifyMinOrMaxExprWithOperands().

◆ getBufferizationOptionsForSparsification()

mlir::bufferization::OneShotBufferizationOptions mlir::getBufferizationOptionsForSparsification ( bool  analysisOnly)

◆ getConstantIntValue()

std::optional< int64_t > mlir::getConstantIntValue ( OpFoldResult  ofr)

If ofr is a constant integer or an IntegerAttr, return the integer.

Definition at line 120 of file StaticValueUtils.cpp.

References m_ConstantInt(), and matchPattern().

Referenced by mlir::affine::FlatAffineValueConstraints::addInductionVarOrTerminalSymbol(), mlir::scf::addLoopRangeConstraints(), allocBuffer(), areTilesAndTiledDimsAllConstant(), asShapeWithAnyValueAsDynamic(), buildAffineLoopFromValues(), canOmitTileOffsetInBoundsCheck(), checkSafeToTileToForall(), mlir::affine::MemRefRegion::compute(), mlir::linalg::computeContinuousTileSizes(), constantTripCount(), constifyIndexValues(), mlir::nvgpu::createAsyncGroups(), createInBoundsCond(), mlir::linalg::GenerateLoopNest< LoopTy >::doit(), emitNormalizedLoopBounds(), foldCstValueToCstAttrBasis(), foldDynamicIndexList(), foldDynamicToStaticDimSizes(), foldIdentityOffsetSizeAndStrideOpInterface(), mlir::affine::ComputationSliceState::getAsConstraints(), getBoundedTileSize(), getCollapsedIndices(), getConstantIntValues(), getConstantRange(), getConstantTripCount(), mlir::vector::getConstantVscaleMultiplier(), mlir::ValueBoundsConstraintSet::getExpr(), getPackOpSourceOrPaddedSource(), getProductOfIntsOrIndexes(), getSimplifiedOfrAndStaticSizePair(), getSlicedDimensions(), isConstantIntValue(), isDimOpValidSymbol(), mlir::vector::isDisjointTransferIndices(), isEqualConstantIntOrValue(), isTrivialSubViewOp(), isZeroIndex(), loopScheduling(), loopUnrollByFactor(), mlir::linalg::makeTiledLoopRanges(), FoldTensorCastPackOp::matchAndRewrite(), FoldConstantCase::matchAndRewrite(), mlir::linalg::pack(), peelForLoop(), mlir::scf::rewritePeeledMinMaxOp(), mlir::affine::simplifyConstrainedMinMaxOp(), tileDividesIterationDomain(), tileLinalgOpImpl(), unFoldOpIntResult(), validateFullTilesOnDims(), and mlir::ValueBoundsConstraintSet::Variable::Variable().

◆ getConstantIntValues()

std::optional< SmallVector< int64_t > > mlir::getConstantIntValues ( ArrayRef< OpFoldResult ofrs)

If all ofrs are constant integers or IntegerAttrs, return the integers.

Definition at line 136 of file StaticValueUtils.cpp.

References getConstantIntValue().

Referenced by areConstantIntValues(), getThreadIdBuilder(), rewriteOneForallCommonImpl(), and verifyGpuMapping().

◆ getControlFlowPredecessors()

std::optional< SmallVector< Value > > mlir::getControlFlowPredecessors ( Value  value)

Computes a vector of all control predecessors of value.

Relies on RegionBranchOpInterface, BranchOpInterface, and SelectLikeOpInterface to determine predecessors. Returns nullopt if value has no predecessors or when the relevant operations are missing the interface implementations.

Definition at line 106 of file SliceWalk.cpp.

References getBlockPredecessorOperands(), mlir::Block::getParentOp(), getRegionPredecessorOperands(), and mlir::Block::isEntryBlock().

Referenced by getUnderlyingObjectSet().

◆ getEffectsRecursively()

std::optional< llvm::SmallVector< MemoryEffects::EffectInstance > > mlir::getEffectsRecursively ( Operation rootOp)

Returns the side effects of an operation.

If the operation has RecursiveMemoryEffects, include all side effects of child operations.

std::nullopt indicates that an option did not have a memory effect interface and so no result could be obtained. An empty vector indicates that there were no memory effects found (but every operation implemented the memory effect interface or has RecursiveMemoryEffects). If the vector contains multiple effects, these effects may be duplicates.

Definition at line 335 of file SideEffectInterfaces.cpp.

References mlir::Operation::getRegions(), and mlir::Operation::hasTrait().

◆ getElementTypeOrSelf() [1/3]

Type mlir::getElementTypeOrSelf ( Attribute  attr)

Return the element type or return the type itself.

Definition at line 33 of file TypeUtilities.cpp.

References getElementTypeOrSelf().

◆ getElementTypeOrSelf() [2/3]

Type mlir::getElementTypeOrSelf ( Type  type)

◆ getElementTypeOrSelf() [3/3]

Type mlir::getElementTypeOrSelf ( Value  val)

Definition at line 29 of file TypeUtilities.cpp.

References getElementTypeOrSelf(), and mlir::Value::getType().

◆ getEnclosingRepetitiveRegion() [1/2]

Region * mlir::getEnclosingRepetitiveRegion ( Operation op)

Return the first enclosing region of the given op that may be executed repetitively as per RegionBranchOpInterface or nullptr if no such region exists.

Definition at line 343 of file ControlFlowInterfaces.cpp.

References mlir::Region::getParentOp(), mlir::Operation::getParentRegion(), and mlir::Region::getRegionNumber().

◆ getEnclosingRepetitiveRegion() [2/2]

Region * mlir::getEnclosingRepetitiveRegion ( Value  value)

Return the first enclosing region of the given Value that may be executed repetitively as per RegionBranchOpInterface or nullptr if no such region exists.

Definition at line 353 of file ControlFlowInterfaces.cpp.

References mlir::Region::getParentOp(), mlir::Operation::getParentRegion(), mlir::Value::getParentRegion(), and mlir::Region::getRegionNumber().

◆ getFlattenedAffineExpr()

LogicalResult mlir::getFlattenedAffineExpr ( AffineExpr  expr,
unsigned  numDims,
unsigned  numSymbols,
SmallVectorImpl< int64_t > *  flattenedExpr,
FlatLinearConstraints cst = nullptr,
bool  addConservativeSemiAffineBounds = false 
)

Flattens 'expr' into 'flattenedExpr', which contains the coefficients of the dimensions, symbols, and additional variables that represent floor divisions of dimensions, symbols, and in turn other floor divisions.

Returns failure if 'expr' could not be flattened (i.e., an unhandled semi-affine was found). 'cst' contains constraints that connect newly introduced local variables to existing dimensional and symbolic variables. See documentation for AffineExprFlattener on how mod's and div's are flattened.

Definition at line 178 of file FlatLinearValueConstraints.cpp.

References getFlattenedAffineExprs().

◆ getFlattenedAffineExprs() [1/2]

LogicalResult mlir::getFlattenedAffineExprs ( AffineMap  map,
std::vector< SmallVector< int64_t, 8 >> *  flattenedExprs,
FlatLinearConstraints localVarCst = nullptr,
bool  addConservativeSemiAffineBounds = false 
)

Flattens the result expressions of the map to their corresponding flattened forms and set in 'flattenedExprs'.

Flattens the expressions in map.

Returns failure if any expression in the map could not be flattened (i.e., an unhandled semi-affine was found). 'cst' contains constraints that connect newly introduced local variables to existing dimensional and / symbolic variables. See documentation for AffineExprFlattener on how mod's and div's are flattened. For all affine expressions that share the same operands (like those of an affine map), this method should be used instead of repeatedly calling getFlattenedAffineExpr since local variables added to deal with div's and mod's will be reused across expressions.

Returns failure if 'expr' was unable to be flattened (i.e., an unhandled semi-affine was found).

Definition at line 192 of file FlatLinearValueConstraints.cpp.

References getFlattenedAffineExprs(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), and mlir::AffineMap::getResults().

Referenced by mlir::FlatLinearValueConstraints::FlatLinearValueConstraints(), mlir::FlatLinearConstraints::flattenAlignedMapAndMergeLocals(), getFlattenedAffineExpr(), getMultiAffineFunctionFromMap(), and mlir::affine::getRelationFromMap().

◆ getFlattenedAffineExprs() [2/2]

LogicalResult mlir::getFlattenedAffineExprs ( IntegerSet  set,
std::vector< SmallVector< int64_t, 8 >> *  flattenedExprs,
FlatLinearConstraints cst = nullptr 
)

◆ getFlattenedTypes()

SmallVector< Type, 10 > mlir::getFlattenedTypes ( TupleType  t)

Get the types within a nested Tuple.

A helper for the class method that handles storage concerns, which is tricky to do in tablegen.

Definition at line 39 of file TypeUtilities.cpp.

◆ getForwardSlice() [1/2]

void mlir::getForwardSlice ( Operation op,
SetVector< Operation * > *  forwardSlice,
const ForwardSliceOptions options = {} 
)

Fills forwardSlice with the computed forward slice (i.e.

all the transitive uses of op), without including that operation.

This additionally takes a TransitiveFilter which acts as a frontier: when looking at uses transitively, an operation that does not pass the filter is never propagated through. This allows in particular to carve out the scope within a ForOp or the scope within an IfOp.

The implementation traverses the use chains in postorder traversal for efficiency reasons: if an operation is already in forwardSlice, no need to traverse its uses again. Since use-def chains form a DAG, this terminates.

Upon return to the root call, forwardSlice is filled with a postorder list of uses (i.e. a reverse topological order). To get a proper topological order, we just reverse the order in forwardSlice before returning.

Example starting from node 0

          0

___________|___________ 1 2 3 4 |_______| |______| | | | | 5 6 |___|_____________| | | 7 8 |_______________| | 9

Assuming all local orders match the numbering order:

  1. after getting back to the root getForwardSlice, forwardSlice may contain: {9, 7, 8, 5, 1, 2, 6, 3, 4}
  2. reversing the result of 1. gives: {4, 3, 6, 2, 1, 5, 8, 7, 9}

Definition at line 55 of file SliceAnalysis.cpp.

References getForwardSliceImpl(), and options.

Referenced by computeDestructuringInfo(), getSlice(), getSliceContract(), hoistOpsBetween(), mlir::linalg::hoistRedundantVectorTransfers(), and promoteSingleIterReductionLoop().

◆ getForwardSlice() [2/2]

void mlir::getForwardSlice ( Value  root,
SetVector< Operation * > *  forwardSlice,
const ForwardSliceOptions options = {} 
)

Value-rooted version of getForwardSlice.

Return the union of all forward slices for the uses of the value root.

Definition at line 71 of file SliceAnalysis.cpp.

References getForwardSliceImpl(), mlir::Value::getUsers(), and options.

◆ getI64SubArray()

SmallVector< int64_t > mlir::getI64SubArray ( ArrayAttr  arrayAttr,
unsigned  dropFront = 0,
unsigned  dropBack = 0 
)

◆ getInnermostParallelLoops()

bool mlir::getInnermostParallelLoops ( Operation rootOp,
SmallVectorImpl< scf::ParallelOp > &  result 
)

Get a list of innermost parallel loops contained in rootOp.

Innermost parallel loops are those that do not contain further parallel loops themselves.

Definition at line 246 of file Utils.cpp.

References mlir::Operation::getRegions().

◆ getLinearizedDimensions()

llvm::SmallBitVector mlir::getLinearizedDimensions ( ArrayRef< ReassociationIndices reassociationIndices)

Determine which dimensions are linearized by a tensor.collapse_shape op by inspecting its reassociation indices.

Definition at line 286 of file ReshapeOpsUtils.cpp.

References mlir::detail::enumerate().

Referenced by mlir::tensor::ExtractSliceFromCollapseHelper::create().

◆ getMaxDimAndSymbol()

template<typename AffineExprContainer >
static void mlir::getMaxDimAndSymbol ( ArrayRef< AffineExprContainer >  exprsList,
int64_t &  maxDim,
int64_t &  maxSym 
)
static

Calculates maximum dimension and symbol positions from the expressions in exprsLists and stores them in maxDim and maxSym respectively.

Definition at line 697 of file AffineMap.h.

References max().

Referenced by inferFromExprList(), and willBeValidAffineMap().

◆ getMixedValues()

SmallVector<OpFoldResult> mlir::getMixedValues ( ArrayRef< int64_t >  staticValues,
ValueRange  dynamicValues,
Builder b 
)

Return a vector of OpFoldResults with the same size a staticValues, but all elements for which ShapedType::isDynamic is true, will be replaced by dynamicValues.

Definition at line 193 of file StaticValueUtils.cpp.

References mlir::Builder::getI64IntegerAttr().

Referenced by inferExpandShapeOutputShape(), mlir::ComposeExpandOfCollapseOp< ExpandOpTy, CollapseOpTy >::matchAndRewrite(), and mlir::ComposeReassociativeReshapeOps< ReshapeOpTy, opKind >::matchAndRewrite().

◆ getMultiAffineFunctionFromMap()

LogicalResult mlir::getMultiAffineFunctionFromMap ( AffineMap  map,
presburger::MultiAffineFunction multiAff 
)

◆ getOffsetsSizesAndStrides()

std::tuple< SmallVector< OpFoldResult >, SmallVector< OpFoldResult >, SmallVector< OpFoldResult > > mlir::getOffsetsSizesAndStrides ( ArrayRef< Range ranges)

Given an array of Range values, return a tuple of (offset vector, sizes vector, and strides vector) formed by separating out the individual elements of each range.

Definition at line 29 of file StaticValueUtils.cpp.

◆ getOrCreateRanges()

SmallVector< Range, 8 > mlir::getOrCreateRanges ( OffsetSizeAndStrideOpInterface  op,
OpBuilder b,
Location  loc 
)

Return the list of Range (i.e.

offset, size, stride). Each Range entry contains either the dynamic value or a ConstantIndexOp constructed with b at location loc.

Definition at line 3034 of file MemRefOps.cpp.

References mlir::OpBuilder::create().

◆ getPerfectlyNestedLoops()

void mlir::getPerfectlyNestedLoops ( SmallVectorImpl< scf::ForOp > &  nestedLoops,
scf::ForOp  root 
)

Get perfectly nested sequence of loops starting at root of loop nest (the first op being another AffineFor, and the second op - a terminator).

A loop is perfectly nested iff: the first op in the loop's body is another AffineForOp, and the second op is a terminator).

Definition at line 1317 of file Utils.cpp.

References getPerfectlyNestedLoopsImpl().

Referenced by coalescePerfectlyNestedSCFForLoops().

◆ getPositionsOfShapeOne()

llvm::SmallBitVector mlir::getPositionsOfShapeOne ( unsigned  rank,
ArrayRef< int64_t >  shape 
)

Definition at line 91 of file Utils.cpp.

◆ getProjectedMap()

AffineMap mlir::getProjectedMap ( AffineMap  map,
const llvm::SmallBitVector &  projectedDimensions,
bool  compressDimsFlag = true,
bool  compressSymbolsFlag = true 
)

Calls projectDims(map, projectedDimensions, compressDimsFlag).

If compressSymbolsFlag is true, additionally call compressUnusedSymbols.

Definition at line 920 of file AffineMap.cpp.

References compressUnusedSymbols(), and projectDims().

◆ getPrunedAttributeList()

SmallVector< NamedAttribute > mlir::getPrunedAttributeList ( Operation op,
ArrayRef< StringRef >  elidedAttrs 
)

Definition at line 220 of file StructuredOpsUtils.cpp.

References mlir::Operation::getAttrs().

Referenced by mlir::tensor::bubbleUpPadSlice().

◆ getReassociationAttrName()

constexpr StringRef mlir::getReassociationAttrName ( )
constexpr

Attribute name for the ArrayAttr which encodes reassociation indices.

Definition at line 31 of file ReshapeOpsUtils.h.

◆ getReassociationIndicesAttribute()

ArrayAttr mlir::getReassociationIndicesAttribute ( OpBuilder b,
ArrayRef< ReassociationIndices reassociation 
)

Wraps a list of reassociations in an ArrayAttr.

Definition at line 160 of file ReshapeOpsUtils.cpp.

References mlir::Builder::getArrayAttr(), and mlir::Builder::getI64ArrayAttr().

◆ getReassociationIndicesForCollapse()

std::optional< SmallVector< ReassociationIndices > > mlir::getReassociationIndicesForCollapse ( ArrayRef< int64_t >  sourceShape,
ArrayRef< int64_t >  targetShape 
)

Returns the reassociation maps to collapse sourceShape to targetShape if possible.

Definition at line 32 of file ReshapeOpsUtils.cpp.

Referenced by getReassociationIndicesForReshape().

◆ getReassociationIndicesForReshape()

std::optional< SmallVector< ReassociationIndices > > mlir::getReassociationIndicesForReshape ( ShapedType  sourceType,
ShapedType  targetType 
)

Return the reassociations maps to use to reshape given the source type and the target type when possible.

Return std::nullopt when this computation failed.

Definition at line 20 of file ReshapeOpsUtils.cpp.

References getReassociationIndicesForCollapse().

◆ getSCFMinMaxExpr()

std::optional<std::pair<AffineExpr, AffineExpr> > mlir::getSCFMinMaxExpr ( Value  value,
SmallVectorImpl< Value > &  dims,
SmallVectorImpl< Value > &  symbols,
llvm::function_ref< bool(Operation *)>  loopFilter = nullptr 
)

Return the min/max expressions for value if it is an induction variable from scf.for or scf.parallel loop.

if loopFilter is passed, the filter determines which loop to consider. Other induction variables are ignored.

◆ getSimplifiedOfrAndStaticSizePair()

std::pair< int64_t, OpFoldResult > mlir::getSimplifiedOfrAndStaticSizePair ( OpFoldResult  ofr,
Builder b 
)

Given OpFoldResult representing dim size value (*), generates a pair of sizes:

  • 1st result, static value, contains an int64_t dim size that can be used to build ShapedType (ShapedType::kDynamic is used for truly dynamic dims),
  • 2nd result, dynamic value, contains OpFoldResult encapsulating the actual dim size (either original or updated input value). For input sizes for which it is possible to extract a constant Attribute, replaces the original size value with an integer attribute (unless it's already a constant Attribute). The 1st return value also becomes the actual integer size (as opposed ShapedType::kDynamic).

(*) This hook is usually used when, given input sizes as OpFoldResult, it's required to generate two vectors:

  • sizes as int64_t to generate a shape,
  • sizes as OpFoldResult for sizes-like attribute. Please update this comment if you identify other use cases.

Definition at line 62 of file StaticValueUtils.cpp.

References getConstantIntValue(), and mlir::Builder::getIndexAttr().

Referenced by mlir::linalg::DecomposeOuterUnitDimsPackOpPattern::matchAndRewrite().

◆ getSinglyExecutedRegionsToSink()

void mlir::getSinglyExecutedRegionsToSink ( RegionBranchOpInterface  branch,
SmallVectorImpl< Region * > &  regions 
)

Populates regions with regions of the provided region branch op that are executed at most once at that are reachable given the current operands of the op.

These regions can be passed to controlFlowSink to perform sinking on the regions of the operation.

Definition at line 135 of file ControlFlowSinkUtils.cpp.

References mlir::detail::enumerate(), mlir::InvocationBounds::getUpperBound(), m_Constant(), and matchPattern().

◆ getSlice()

SetVector< Operation * > mlir::getSlice ( Operation op,
const BackwardSliceOptions backwardSliceOptions = {},
const ForwardSliceOptions forwardSliceOptions = {} 
)

Iteratively computes backward slices and forward slices until a fixed point is reached.

Returns an SetVector<Operation *> which includes the original operation.

This allows building a slice (i.e. multi-root DAG where everything that is reachable from an Value in forward and backward direction is contained in the slice). This is the abstraction we need to materialize all the operations for supervectorization without worrying about orderings and Value replacements.

Example starting from any node

1 2 3 4 |_______| |______| | | | | | 5 6___| |___|_____________| | | | | 7 8 | |_______________| | | | 9 10

Return the whole DAG in some topological order.

The implementation works by just filling up a worklist with iterative alternate calls to getBackwardSlice and getForwardSlice.

The following section describes some additional implementation considerations for a potentially more efficient implementation but they are just an intuition without proof, we still use a worklist for now.

Additional implementation considerations

Consider the defs-op-uses hourglass.


\ / defs (in some topological order) \/ op /\ / \ uses (in some topological order) /____\

We want to iteratively apply getSlice to construct the whole list of Operation that are reachable by (use|def)+ from op. We want the resulting slice in topological order. Ideally we would like the ordering to be maintained in-place to avoid copying Operation at each step. Keeping this ordering by construction seems very unclear, so we list invariants in the hope of seeing whether useful properties pop up.

In the following: we use |= for set inclusion; we use << for set topological ordering (i.e. each pair is ordered).

Assumption:

We wish to maintain the following property by a recursive argument: """ defs << {op} <<uses are in topological order. """ The property clearly holds for 0 and 1-sized uses and defs;

Invariants:

  1. defs and uses are in topological order internally, by construction;
  2. for any {x} |= defs, defs(x) |= defs; because all go through op
  3. for any {x} |= uses, defs |= defs(x); because all go through op
  4. for any {x} |= defs, uses |= uses(x); because all go through op
  5. for any {x} |= uses, uses(x) |= uses; because all go through op

Intuitively, we should be able to recurse like: preorder(defs) - op - postorder(uses) and keep things ordered but this is still hand-wavy and not worth the trouble for now: punt to a simple worklist-based solution.

Definition at line 161 of file SliceAnalysis.cpp.

References getBackwardSlice(), getForwardSlice(), and topologicalSort().

◆ getSlicedDimensions()

llvm::SmallBitVector mlir::getSlicedDimensions ( ArrayRef< OpFoldResult sliceInputShape,
ArrayRef< Range sliceParams 
)

The input parameters offsets, sizes, strides specify a rectangular non rank-reducing slice of the collapse_shape output.

Try to find which dimensions have been sliced and which dimensions are not sliced (offset = 0, size = dim, size = 1). Note that this conservative as it cannot detect if a dynamic size corresponds to the full tensor dimension or not.

Definition at line 269 of file ReshapeOpsUtils.cpp.

References getConstantIntValue(), and isEqualConstantIntOrValue().

Referenced by mlir::tensor::ExtractSliceFromCollapseHelper::create().

◆ getStridesAndOffset() [1/2]

std::pair< SmallVector< int64_t >, int64_t > mlir::getStridesAndOffset ( MemRefType  t)

Wrapper around getStridesAndOffset(MemRefType, SmallVectorImpl<int64_t>, int64_t) that will assert if the logical result is not succeeded.

Definition at line 834 of file BuiltinTypes.cpp.

References getStridesAndOffset().

◆ getStridesAndOffset() [2/2]

LogicalResult mlir::getStridesAndOffset ( MemRefType  t,
SmallVectorImpl< int64_t > &  strides,
int64_t &  offset 
)

Returns the strides of the MemRef if the layout map is in strided form.

MemRefs with a layout map in strided form include:

  1. empty or identity layout map, in which case the stride information is the canonical form computed from sizes;
  2. a StridedLayoutAttr layout;
  3. any other layout that be converted into a single affine map layout of the form K + k0 * d0 + ... kn * dn, where K and ki's are constants or symbols.

A stride specification is a list of integer values that are either static or dynamic (encoded with ShapedType::kDynamic). Strides encode the distance in the number of elements between successive entries along a particular dimension.

Definition at line 804 of file BuiltinTypes.cpp.

Referenced by mlir::MemRefDescriptor::bufferPtr(), mlir::LLVMTypeConverter::canConvertToBarePtr(), mlir::nvgpu::canLowerToWarpMatrixOperation(), mlir::bufferization::castOrReallocMemRefValue(), computeCollapsedLayoutMap(), computeExpandedLayoutMap(), computeMemRefRankReductionMask(), mlir::MemRefDescriptor::fromStaticShape(), getCastCompatibleMemRefType(), getConstantOffset(), getConstantStrides(), getFlatOffsetAndStrides(), mlir::spirv::getOpenCLElementPtr(), getStaticallyKnownRowStride(), getStridesAndOffset(), mlir::spirv::getVulkanElementPtr(), hasFullyDynamicLayoutMap(), haveCompatibleOffsets(), haveCompatibleStrides(), inferTransposeResultType(), isLastMemrefDimUnitStride(), mlir::memref::isStaticShapeAndContiguousRowMajor(), isStrided(), mlirMemRefTypeGetStridesAndOffset(), SubViewReturnTypeCanonicalizer::operator()(), mlir::memref::populateMemRefNarrowTypeEmulationConversions(), staticallyOutOfBounds(), and trailingNDimsContiguous().

◆ getSymbolLessAffineMaps()

SmallVector< AffineMap, 4 > mlir::getSymbolLessAffineMaps ( ArrayRef< ReassociationExprs reassociation)

Constructs affine maps out of Array<Array<AffineExpr>>.

Definition at line 184 of file ReshapeOpsUtils.cpp.

References mlir::AffineMap::get(), and getContext().

◆ getType()

Type mlir::getType ( OpFoldResult  ofr)

Returns the int type of the integer in ofr.

Other attribute types are not supported.

Definition at line 305 of file Utils.cpp.

Referenced by mlir::sparse_tensor::allocaBuffer(), buildCostGraph(), collectReductionInfo(), convertElementwiseOp(), createFullPartialVectorTransferWrite(), mlir::LLVM::detail::createIntrinsicCall(), createSingleExitingLatch(), denormalizeInductionVariable(), mlir::spirv::Deserializer::processOp< spirv::FunctionCallOp >(), mlir::spirv::Deserializer::processOp< spirv::GenericCastToPtrExplicitOp >(), mlir::linalg::dropUnitDims(), emitNormalizedLoopBounds(), fuse(), mlir::affine::AffineDmaStartOp::getDstMemorySpace(), mlir::affine::AffineDmaStartOp::getDstMemRefRank(), mlir::affine::AffineDmaStartOp::getDstMemRefType(), mlir::sparse_tensor::getMemRefType(), getProductOfIntsOrIndexes(), mlir::sparse_tensor::getRankedTensorType(), mlir::affine::AffineDmaStartOp::getSrcMemorySpace(), mlir::affine::AffineDmaStartOp::getSrcMemRefType(), mlir::affine::AffineDmaStartOp::getTagMemRefRank(), mlir::affine::AffineDmaWaitOp::getTagMemRefRank(), mlir::affine::AffineDmaStartOp::getTagMemRefType(), mlir::affine::AffineDmaWaitOp::getTagMemRefType(), mlir::pdll::ast::RangeExpr::getType(), mlir::pdll::ast::TupleExpr::getType(), handleMultidimensionalVectors(), isContiguousXferOp(), mlirLLVMDISubprogramAttrGetType(), mlirTransformParamTypeGetType(), mlirTupleTypeGetType(), mlirValueGetType(), mlir::linalg::rewriteInIm2Col(), useOperandGroup(), verifyArithmeticExtendedBinaryOp(), mlir::detail::verifyBranchSuccessorOperands(), mlir::affine::AffineDmaStartOp::verifyInvariantsImpl(), mlir::affine::AffineDmaWaitOp::verifyInvariantsImpl(), and mlir::detail::verifyLoopLikeOpInterface().

◆ getUnusedDimsBitVector()

llvm::SmallBitVector mlir::getUnusedDimsBitVector ( ArrayRef< AffineMap maps)

Definition at line 930 of file AffineMap.cpp.

Referenced by compressUnusedDims(), and verifyOutputShape().

◆ getUnusedSymbolsBitVector()

llvm::SmallBitVector mlir::getUnusedSymbolsBitVector ( ArrayRef< AffineMap maps)

Definition at line 942 of file AffineMap.cpp.

Referenced by compressUnusedSymbols().

◆ getUsedValuesDefinedAbove() [1/2]

void mlir::getUsedValuesDefinedAbove ( MutableArrayRef< Region regions,
SetVector< Value > &  values 
)

Fill values with a list of values used within any of the regions provided but defined in one of the ancestors.

Definition at line 74 of file RegionUtils.cpp.

References getUsedValuesDefinedAbove().

◆ getUsedValuesDefinedAbove() [2/2]

void mlir::getUsedValuesDefinedAbove ( Region region,
Region limit,
SetVector< Value > &  values 
)

◆ getValueOrCreateCastToIndexLike()

Value mlir::getValueOrCreateCastToIndexLike ( OpBuilder b,
Location  loc,
Type  targetType,
Value  value 
)

Create a cast from an index-like value (index or integer) to another index-like value.

If the value type and the target type are the same, it returns the original value.

Definition at line 120 of file Utils.cpp.

References mlir::OpBuilder::create(), mlir::Value::getType(), and mlir::Type::isIndex().

◆ getValueOrCreateConstantIndexOp() [1/2]

SmallVector< Value > mlir::getValueOrCreateConstantIndexOp ( OpBuilder b,
Location  loc,
ArrayRef< OpFoldResult valueOrAttrVec 
)

Similar to the other overload, but converts multiple OpFoldResults into Values.

Definition at line 263 of file Utils.cpp.

References getValueOrCreateConstantIndexOp().

◆ getValueOrCreateConstantIndexOp() [2/2]

Value mlir::getValueOrCreateConstantIndexOp ( OpBuilder b,
Location  loc,
OpFoldResult  ofr 
)

Converts an OpFoldResult to a Value.

Returns the fold result if it casts to a Value or creates a ConstantIndexOp if it casts to an Integer Attribute. Other attribute types are not supported.

Definition at line 112 of file Utils.cpp.

References mlir::OpBuilder::create().

Referenced by mlir::tensor::bubbleUpPadSlice(), HopperBuilder::buildAndInitBarrierInSharedMemory(), HopperBuilder::buildBarrierArriveTx(), HopperBuilder::buildGlobalMemRefDescriptor(), buildLinearId(), calculateExpandedAccessIndices(), mlir::linalg::collapseOpIterationDims(), mlir::linalg::computeContinuousTileSizes(), mlir::linalg::computeMultiTileSizes(), mlir::tensor::ExtractSliceFromCollapseHelper::create(), createInBoundsCond(), mlir::affine::delinearizeIndex(), denormalizeInductionVariableForIndexType(), denormalizeIndVar(), dynamicallyInsertSubVector(), emulatedVectorLoad(), genBuffers(), generateLoopNestUsingForOp(), getBoundedTileSize(), getCompressedMaskOp(), getIndicesForLoadOrStore(), getOffsetForBitwidth(), getProductOfIntsOrIndexes(), getValueOrCreateConstantIndexOp(), mlir::scf::lowerToLoopsUsingSCFForOp(), InsertSliceVectorizePattern::matchAndRewrite(), mlir::memref::multiBuffer(), mlir::linalg::offsetIndices(), mlir::linalg::promoteSubviewAsNewBuffer(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), resolveSourceIndicesCollapseShape(), resolveSourceIndicesExpandShape(), PadOpVectorizationWithInsertSlicePattern::rewriteUser(), mlir::linalg::tileReductionUsingForall(), and unpackRanges().

◆ getValueOrCreateConstantIntOp()

Value mlir::getValueOrCreateConstantIntOp ( OpBuilder b,
Location  loc,
OpFoldResult  ofr 
)

Converts an OpFoldResult to a Value.

Returns the fold result if it casts to a Value or creates a ConstantOp if it casts to an Integer Attribute. Other attribute types are not supported.

Definition at line 103 of file Utils.cpp.

References mlir::OpBuilder::create(), and mlir::Builder::getIntegerAttr().

Referenced by coalesceLoops(), collapseParallelLoops(), denormalizeInductionVariable(), and emitNormalizedLoopBounds().

◆ getValuesSortedByKey() [1/3]

SmallVector<int64_t> mlir::getValuesSortedByKey ( ArrayRef< Attribute keys,
ArrayRef< int64_t >  values,
llvm::function_ref< bool(Attribute, Attribute)>  compare 
)

◆ getValuesSortedByKey() [2/3]

SmallVector< OpFoldResult > mlir::getValuesSortedByKey ( ArrayRef< Attribute keys,
ArrayRef< OpFoldResult values,
llvm::function_ref< bool(Attribute, Attribute)>  compare 
)

◆ getValuesSortedByKey() [3/3]

SmallVector< Value > mlir::getValuesSortedByKey ( ArrayRef< Attribute keys,
ArrayRef< Value values,
llvm::function_ref< bool(Attribute, Attribute)>  compare 
)

Helper to sort values according to matching keys.

Definition at line 244 of file StaticValueUtils.cpp.

References mlir::presburger::compare(), and getValuesSortedByKeyImpl().

Referenced by rewriteOneForallCommonImpl().

◆ getValuesSortedByKeyImpl()

template<typename K , typename V >
static SmallVector<V> mlir::getValuesSortedByKeyImpl ( ArrayRef< K >  keys,
ArrayRef< V >  values,
llvm::function_ref< bool(K, K)>  compare 
)
static

Helper to sort values according to matching keys.

Definition at line 228 of file StaticValueUtils.cpp.

Referenced by getValuesSortedByKey().

◆ hasEffect() [1/3]

template<typename... EffectTys>
bool mlir::hasEffect ( Operation op)

Returns true if op has an effect of type EffectTy.

Definition at line 211 of file SideEffectInterfaces.cpp.

References mlir::SideEffects::EffectInstance< EffectT >::getEffect().

◆ hasEffect() [2/3]

template<typename... EffectTys>
bool mlir::hasEffect ( Operation op,
Value  value 
)

Returns true if op has an effect of type EffectTy on value.

Definition at line 229 of file SideEffectInterfaces.cpp.

References mlir::SideEffects::EffectInstance< EffectT >::getEffect(), and mlir::SideEffects::EffectInstance< EffectT >::getValue().

◆ hasEffect() [3/3]

template<typename ValueTy , typename... EffectTys>
bool mlir::hasEffect ( Operation op,
ValueTy  value 
)

Returns true if op has an effect of type EffectTy on value of type ValueTy.

Definition at line 251 of file SideEffectInterfaces.cpp.

References mlir::SideEffects::EffectInstance< EffectT >::getEffect(), and mlir::SideEffects::EffectInstance< EffectT >::getEffectValue().

◆ hash_value() [1/12]

inline ::llvm::hash_code mlir::hash_value ( AffineExpr  arg)

◆ hash_value() [2/12]

inline ::llvm::hash_code mlir::hash_value ( AffineMap  arg)

Definition at line 425 of file AffineMap.h.

◆ hash_value() [3/12]

inline ::llvm::hash_code mlir::hash_value ( Attribute  arg)

Definition at line 198 of file Attributes.h.

◆ hash_value() [4/12]

llvm::hash_code mlir::hash_value ( const AsmDialectResourceHandle param)
inline

Definition at line 96 of file OpImplementation.h.

References mlir::AsmDialectResourceHandle::getResource().

◆ hash_value() [5/12]

inline ::llvm::hash_code mlir::hash_value ( const NamedAttribute arg)

Definition at line 256 of file Attributes.h.

◆ hash_value() [6/12]

inline ::llvm::hash_code mlir::hash_value ( IntegerSet  arg)

Definition at line 124 of file IntegerSet.h.

◆ hash_value() [7/12]

inline ::llvm::hash_code mlir::hash_value ( Location  arg)

Definition at line 129 of file Location.h.

◆ hash_value() [8/12]

llvm::hash_code mlir::hash_value ( OperationName  arg)
inline

Definition at line 515 of file OperationSupport.h.

References mlir::OperationName::getAsOpaquePointer().

◆ hash_value() [9/12]

inline ::llvm::hash_code mlir::hash_value ( Type  arg)

Definition at line 326 of file Types.h.

◆ hash_value() [10/12]

inline ::llvm::hash_code mlir::hash_value ( TypeID  id)

Enable hashing TypeID.

Definition at line 149 of file TypeID.h.

◆ hash_value() [11/12]

inline ::llvm::hash_code mlir::hash_value ( TypeRange  arg)

Make TypeRange hashable.

Definition at line 72 of file TypeRange.h.

Referenced by llvm::DenseMapInfo< mlir::TypeRange >::getHashValue().

◆ hash_value() [12/12]

inline ::llvm::hash_code mlir::hash_value ( Value  arg)

Make Value hashable.

Definition at line 490 of file Value.h.

◆ hasNonIdentityLayout()

bool mlir::hasNonIdentityLayout ( Type  type)

◆ hasSingleEffect() [1/3]

template<typename EffectTy >
bool mlir::hasSingleEffect ( Operation op)

Returns true if op has only an effect of type EffectTy.

Definition at line 107 of file SideEffectInterfaces.cpp.

◆ hasSingleEffect() [2/3]

template<typename EffectTy >
bool mlir::hasSingleEffect ( Operation op,
Value  value 
)

Returns true if op has only an effect of type EffectTy (and of no other type) on value.

Definition at line 129 of file SideEffectInterfaces.cpp.

◆ hasSingleEffect() [3/3]

template<typename ValueTy , typename EffectTy >
bool mlir::hasSingleEffect ( Operation op,
ValueTy  value 
)

Returns true if op has only an effect of type EffectTy (and of no other type) on value of type ValueTy.

Definition at line 158 of file SideEffectInterfaces.cpp.

◆ hasValidSizesOffsets()

bool mlir::hasValidSizesOffsets ( SmallVector< int64_t >  sizesOrOffsets)

Helper function to check whether the passed in sizes or offsets are valid.

This can be used to re-check whether dimensions are still valid after constant folding the dynamic dimensions.

Definition at line 281 of file StaticValueUtils.cpp.

◆ hasValidStrides()

bool mlir::hasValidStrides ( SmallVector< int64_t >  strides)

Helper function to check whether the passed in strides are valid.

This can be used to re-check whether dimensions are still valid after constant folding the dynamic dimensions.

Definition at line 287 of file StaticValueUtils.cpp.

◆ hoistLoopInvariantSubsets()

LoopLikeOpInterface mlir::hoistLoopInvariantSubsets ( RewriterBase rewriter,
LoopLikeOpInterface  loopLike 
)

Hoist loop-invariant tensor subsets (subset extraction and subset insertion ops) from loop-like ops.

Extraction ops are moved before the loop. Insertion ops are moved after the loop. The loop body operates on newly added region iter_args (one per extraction-insertion pair).

A subset extraction op (SubsetExtractionOpInterface) extracts from a tensor value at a subset. The result of the op may have an arbitrary type, i.e., not necessarily a tensor type. Example: "tensor.extract_slice".

A subset insertion op (SubsetInsertionOpInterface) inserts into a tensor value ("destination") at a subset. Example: "tensor.insert_slice".

Matching extraction-insertion subset ops can be hoisted from a loop if there are no other ops within the loop that operate on the same or on an overlapping subset. In particular, non-subset ops can prevent hoisting because the analysis does not know what subset they operate on.

Example:

%r = scf.for ... iter_args(%t = %a) -> (tensor<?xf32>) {
%0 = tensor.extract_slice %t[0][5][1] : tensor<?xf32> to tensor<5xf32>
%1 = "test.foo"(%0) : (tensor<5xf32>) -> (tensor<5xf32>)
%2 = tensor.insert_slice %1 into %t[0][5][1]
: tensor<5xf32> into tensor<?xf32>
scf.yield %2 : tensor<?xf32>
}

Is rewritten to:

%0 = tensor.extract_slice %a[0][5][1] : tensor<?xf32> to tensor<5xf32>
%new_loop:2 = scf.for ... iter_args(%t = %a, %h = %0) -> (tensor<?xf32>) {
%1 = "test.foo"(%h) : (tensor<5xf32>) -> (tensor<5xf32>)
scf.yield %t, %2 : tensor<?xf32>, tensor<5xf32>
}
%r = tensor.insert_slice %new_loop#1 into %new_loop#0
: tensor<5xf32> into tensor<?xf32>

Definition at line 392 of file LoopInvariantCodeMotionUtils.cpp.

References hoistSubsetAtIterArg().

◆ inferExpandShapeOutputShape()

std::optional< SmallVector< OpFoldResult > > mlir::inferExpandShapeOutputShape ( OpBuilder b,
Location  loc,
ShapedType  expandedType,
ArrayRef< ReassociationIndices reassociation,
ArrayRef< OpFoldResult inputShape 
)

Infer the output shape for a {memref|tensor}.expand_shape when it is possible to do so.

Note: This should only be used to implement ExpandShapeOp::inferOutputShape in both the memref and tensor namespaces. If you need to infer the output shape you should use the static method of ExpandShapeOp instead of calling this.

inputShape is the shape of the tensor or memref being expanded as a sequence of SSA values or constants. expandedType is the output shape of the expand_shape operation. reassociation is the reassociation denoting the output dims each input dim is mapped to.

Returns the output shape in outputShape and staticOutputShape, following the conventions for the output_shape and static_output_shape inputs to the expand_shape ops.

Definition at line 24 of file Utils.cpp.

References mlir::OpBuilder::create(), mlir::OpBuilder::createOrFold(), mlir::detail::enumerate(), and getMixedValues().

Referenced by resolveSourceIndicesExpandShape().

◆ inlineCall()

LogicalResult mlir::inlineCall ( InlinerInterface interface,
CallOpInterface  call,
CallableOpInterface  callable,
Region src,
bool  shouldCloneInlinedRegion = true 
)

This function inlines a given region, 'src', of a callable operation, 'callable', into the location defined by the given call operation.

This function returns failure if inlining is not possible, success otherwise. On failure, no changes are made to the module. 'shouldCloneInlinedRegion' corresponds to whether the source region should be cloned into the 'call' or spliced directly.

Definition at line 443 of file InliningUtils.cpp.

References mlir::Region::empty(), mlir::Region::front(), mlir::Value::getDefiningOp(), mlir::DialectInterfaceCollection< InterfaceType >::getInterfaceFor(), mlir::Value::getType(), inlineRegionImpl(), mlir::InlinerInterface::isLegalToInline(), mlir::IRMapping::map(), materializeConversion(), mlir::Value::replaceAllUsesWith(), mlir::Operation::replaceUsesOfWith(), and mlir::OpBuilder::setInsertionPointAfter().

◆ inlineRegion() [1/4]

LogicalResult mlir::inlineRegion ( InlinerInterface interface,
Region src,
Block inlineBlock,
Block::iterator  inlinePoint,
IRMapping mapper,
ValueRange  resultsToReplace,
TypeRange  regionResultTypes,
std::optional< Location inlineLoc = std::nullopt,
bool  shouldCloneInlinedRegion = true 
)

Definition at line 381 of file InliningUtils.cpp.

References inlineRegionImpl().

◆ inlineRegion() [2/4]

LogicalResult mlir::inlineRegion ( InlinerInterface interface,
Region src,
Block inlineBlock,
Block::iterator  inlinePoint,
ValueRange  inlinedOperands,
ValueRange  resultsToReplace,
std::optional< Location inlineLoc = std::nullopt,
bool  shouldCloneInlinedRegion = true 
)

Definition at line 403 of file InliningUtils.cpp.

References inlineRegionImpl().

◆ inlineRegion() [3/4]

LogicalResult mlir::inlineRegion ( InlinerInterface interface,
Region src,
Operation inlinePoint,
IRMapping mapper,
ValueRange  resultsToReplace,
TypeRange  regionResultTypes,
std::optional< Location inlineLoc = std::nullopt,
bool  shouldCloneInlinedRegion = true 
)

This function inlines a region, 'src', into another.

This function returns failure if it is not possible to inline this function. If the function returned failure, then no changes to the module have been made.

The provided 'inlinePoint' must be within a region, and corresponds to the location where the 'src' region should be inlined. 'mapping' contains any remapped operands that are used within the region, and must include remappings for the entry arguments to the region. 'resultsToReplace' corresponds to any results that should be replaced by terminators within the inlined region. 'regionResultTypes' specifies the expected return types of the terminators in the region. 'inlineLoc' is an optional Location that, if provided, will be used to update the inlined operations' location information. 'shouldCloneInlinedRegion' corresponds to whether the source region should be cloned into the 'inlinePoint' or spliced directly.

Definition at line 371 of file InliningUtils.cpp.

References mlir::Operation::getBlock().

Referenced by inlineRegion().

◆ inlineRegion() [4/4]

LogicalResult mlir::inlineRegion ( InlinerInterface interface,
Region src,
Operation inlinePoint,
ValueRange  inlinedOperands,
ValueRange  resultsToReplace,
std::optional< Location inlineLoc = std::nullopt,
bool  shouldCloneInlinedRegion = true 
)

This function is an overload of the above 'inlineRegion' that allows for providing the set of operands ('inlinedOperands') that should be used in-favor of the region arguments when inlining.

Definition at line 393 of file InliningUtils.cpp.

References mlir::Operation::getBlock(), and inlineRegion().

◆ insertTypesInto()

TypeRange mlir::insertTypesInto ( TypeRange  oldTypes,
ArrayRef< unsigned >  indices,
TypeRange  newTypes,
SmallVectorImpl< Type > &  storage 
)

Insert a set of newTypes into oldTypes at the given indices.

If any types are inserted, storage is used to hold the new type list. The new type list is returned. indices must be sorted by increasing index.

Definition at line 176 of file TypeUtilities.cpp.

◆ insideMutuallyExclusiveRegions()

bool mlir::insideMutuallyExclusiveRegions ( Operation a,
Operation b 
)

Return true if a and b are in mutually exclusive regions as per RegionBranchOpInterface.

Return true if a and b are in mutually exclusive regions.

  1. Find the first common of a and b (ancestor) that implements RegionBranchOpInterface.
  2. Determine the regions regionA and regionB in which a and b are contained.
  3. Check if regionA and regionB are mutually exclusive. They are mutually exclusive if they are not reachable from each other as per RegionBranchOpInterface::getSuccessorRegions.

Definition at line 284 of file ControlFlowInterfaces.cpp.

References mlir::Operation::getParentOfType().

◆ inverseAndBroadcastProjectedPermutation()

AffineMap mlir::inverseAndBroadcastProjectedPermutation ( AffineMap  map)

Return the reverse map of a projected permutation where the projected dimensions are transformed into 0s.

Prerequisites: map must be a projected permutation.

Example 1:

affine_map<(d0, d1, d2, d3) -> (d2, d0)>

returns:

affine_map<(d0, d1) -> (d1, 0, d0, 0)>

Example 2:

affine_map<(d0, d1, d2, d3) -> (d0, d3)>

returns:

affine_map<(d0, d1) -> (d0, 0, 0, d1)>

Example 3:

affine_map<(d0, d1, d2, d3) -> (d2)>

returns:

affine_map<(d0) -> (0, 0, d0, 0)>

Example 4:

affine_map<(d0, d1, d2) -> (d0, 0)>

returns:

affine_map<(d0, d1) -> (d0, 0, 0)>

Definition at line 815 of file AffineMap.cpp.

References mlir::AffineMap::get(), getAffineConstantExpr(), getAffineDimExpr(), mlir::AffineMap::getContext(), mlir::AffineMap::getDimPosition(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getResult(), and mlir::AffineMap::isProjectedPermutation().

◆ inversePermutation()

AffineMap mlir::inversePermutation ( AffineMap  map)

Returns a map of codomain to domain dimensions such that the first codomain dimension for a particular domain dimension is selected.

Returns an empty map if the input map is empty. Returns null map (not empty map) if map is not invertible (i.e. map does not contain a subset that is a permutation of full domain rank).

Prerequisites:

  1. map has no symbols.

Example 1:

(d0, d1, d2) -> (d1, d1, d0, d2, d1, d2, d1, d0)
0 2 3

returns:

(d0, d1, d2, d3, d4, d5, d6, d7) -> (d2, d0, d3)

Example 2:

(d0, d1, d2) -> (d1, d0 + d1, d0, d2, d1, d2, d1, d0)
0 2 3

returns:

(d0, d1, d2, d3, d4, d5, d6, d7) -> (d2, d0, d3)

Definition at line 791 of file AffineMap.cpp.

References mlir::detail::enumerate(), mlir::AffineMap::get(), getAffineDimExpr(), mlir::AffineMap::getContext(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResults(), and mlir::AffineMap::isEmpty().

Referenced by mlir::linalg::detail::canOpOperandsBeDroppedImpl(), mlir::linalg::dropUnitDims(), mlir::linalg::fuseElementwiseOps(), getIndexingMapOfProducerOperandsInCoordinatesOfFusedOp(), mlir::sparse_tensor::inferLvlToDim(), mlir::vector::inferTransferOpMaskType(), mlir::linalg::interchangeGenericOp(), interchangeGenericOpPrecondition(), isOpOperandCanBeDroppedAfterFusedLinalgs(), mlir::linalg::rewriteInIm2Col(), tileLinalgOpImpl(), and mlir::scf::tileUsingSCF().

◆ invertPermutationVector()

SmallVector< int64_t > mlir::invertPermutationVector ( ArrayRef< int64_t >  permutation)

◆ isBatchMatvec()

bool mlir::isBatchMatvec ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a batch matrix vector multiplication.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 172 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().

◆ isBatchVecmat()

bool mlir::isBatchVecmat ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a batch vector matrix multiplication.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 123 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().

◆ isBytecode()

bool mlir::isBytecode ( llvm::MemoryBufferRef  buffer)

Returns true if the given buffer starts with the magic bytes that signal MLIR bytecode.

Definition at line 2563 of file BytecodeReader.cpp.

Referenced by readBytecodeFileImpl().

◆ isColumnMajorMatmul()

bool mlir::isColumnMajorMatmul ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a column major matmul.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 46 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().

◆ isConstantIntValue()

bool mlir::isConstantIntValue ( OpFoldResult  ofr,
int64_t  value 
)

◆ isEqualConstantIntOrValue()

bool mlir::isEqualConstantIntOrValue ( OpFoldResult  ofr1,
OpFoldResult  ofr2 
)

Return true if ofr1 and ofr2 are the same integer constant attribute values or the same SSA value.

Ignore integer bitwitdh and type mismatch that come from the fact there is no IndexAttr and that IndexType have no bitwidth.

Ignore integer bitwidth and type mismatch that come from the fact there is no IndexAttr and that IndexType has no bitwidth.

Definition at line 171 of file StaticValueUtils.cpp.

References getConstantIntValue().

Referenced by mlir::bufferization::Ownership::getCombined(), getSlicedDimensions(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), haveSameTiles(), and isEqualConstantIntOrValueArray().

◆ isEqualConstantIntOrValueArray()

bool mlir::isEqualConstantIntOrValueArray ( ArrayRef< OpFoldResult ofrs1,
ArrayRef< OpFoldResult ofrs2 
)

Definition at line 180 of file StaticValueUtils.cpp.

References isEqualConstantIntOrValue().

◆ isIdentityPermutation()

bool mlir::isIdentityPermutation ( ArrayRef< int64_t >  permutation)

Returns true if permutation is an identity permutation.

Definition at line 215 of file IndexingUtils.cpp.

Referenced by hasSameInnerOuterAttribute().

◆ isLastMemrefDimUnitStride()

bool mlir::isLastMemrefDimUnitStride ( MemRefType  type)

Return "true" if the last dimension of the given type has a static unit stride.

Also return "true" for types with no strides.

Definition at line 961 of file BuiltinTypes.cpp.

References getStridesAndOffset().

Referenced by isContiguousXferOp(), isMemRefTypeSupported(), and trailingNDimsContiguous().

◆ isLegalForBranchOpInterfaceTypeConversionPattern()

bool mlir::isLegalForBranchOpInterfaceTypeConversionPattern ( Operation op,
const TypeConverter converter 
)

Return true if op is a BranchOpInterface op whose operands are all legal according to converter.

Definition at line 143 of file FuncConversions.cpp.

References mlir::Operation::getBlock(), mlir::Block::getNumSuccessors(), and mlir::TypeConverter::isLegal().

◆ isLegalForReturnOpTypeConversionPattern()

bool mlir::isLegalForReturnOpTypeConversionPattern ( Operation op,
const TypeConverter converter,
bool  returnOpAlwaysLegal = false 
)

For ReturnLike ops (except return), return True.

If op is a return && returnOpAlwaysLegal is false, legalize op according to converter. Otherwise, return false.

Definition at line 164 of file FuncConversions.cpp.

References mlir::Operation::hasTrait(), and mlir::TypeConverter::isLegal().

◆ isMatvec()

bool mlir::isMatvec ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a matrix vector multiplication.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 148 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().

◆ isMemoryEffectFree()

bool mlir::isMemoryEffectFree ( Operation op)

Returns true if the given operation is free of memory effects.

An operation is free of memory effects if its implementation of MemoryEffectOpInterface indicates that it has no memory effects. For example, it may implement NoMemoryEffect in ODS. Alternatively, if the operation has the HasRecursiveMemoryEffects trait, then it is free of memory effects if all of its nested operations are free of memory effects.

If the operation has both, then it is free of memory effects if both conditions are satisfied.

Definition at line 309 of file SideEffectInterfaces.cpp.

References mlir::Operation::getRegions(), and mlir::Operation::hasTrait().

Referenced by canBeHoisted(), checkTransformationPreconditions(), hasSideEffects(), hoistOpsBetween(), mlir::affine::MemRefDependenceGraph::init(), mlir::affine::isLoopMemoryParallel(), isOpLoopInvariant(), isPure(), matchReduction(), mlir::scf::naivelyFuseParallelOps(), noAliasingUseInLoop(), replaceOpWithPredicatedOp(), mlir::dataflow::LivenessAnalysis::visitBranchOperand(), and mlir::dataflow::LivenessAnalysis::visitOperation().

◆ isNotBranchOpInterfaceOrReturnLikeOp()

bool mlir::isNotBranchOpInterfaceOrReturnLikeOp ( Operation op)

Return true if op is neither BranchOpInterface nor ReturnLike.

TODO Try to get rid of this function and invert the meaning of isLegalForBranchOpInterfaceTypeConversionPattern and isLegalForReturnOpTypeConversionPattern.

Definition at line 177 of file FuncConversions.cpp.

References mlir::Block::back(), mlir::Operation::getBlock(), mlir::Operation::getParentOp(), and mlir::Operation::mightHaveTrait().

◆ isOpaqueTypeWithName()

bool mlir::isOpaqueTypeWithName ( Type  type,
StringRef  dialect,
StringRef  typeData 
)

Return true if the specified type is an opaque type with the specified dialect and typeData.

Definition at line 47 of file TypeUtilities.cpp.

◆ isOpTriviallyDead()

bool mlir::isOpTriviallyDead ( Operation op)

Return true if the given operation is unused, and has no side effects on memory that prevent erasing.

Definition at line 35 of file SideEffectInterfaces.cpp.

References mlir::Operation::use_empty(), and wouldOpBeTriviallyDead().

Referenced by mlir::arm_sme::eraseTriviallyDeadTileOps().

◆ isPermutationVector()

bool mlir::isPermutationVector ( ArrayRef< int64_t >  interchange)

◆ isPure()

bool mlir::isPure ( Operation op)

Returns true if the given operation is pure, i.e., is speculatable that does not touch memory.

The implementation of this function replicates the def Pure : TraitList in SideEffectInterfaces.td and has to be kept in sync manually.

This function is the C++ equivalent of the Pure trait.

Definition at line 392 of file SideEffectInterfaces.cpp.

References isMemoryEffectFree(), and isSpeculatable().

Referenced by mlir::arm_sme::isTriviallyCloneableTileOp().

◆ isRankReducedType()

SliceVerificationResult mlir::isRankReducedType ( ShapedType  originalType,
ShapedType  candidateReducedType 
)

Check if originalType can be rank reduced to candidateReducedType type by dropping some dimensions with static size 1.

Return SliceVerificationResult::Success on success or an appropriate error code.

Definition at line 457 of file BuiltinTypes.cpp.

References computeRankReductionMask(), ElemTypeMismatch, RankTooLarge, SizeMismatch, and Success.

Referenced by mlir::linalg::lowerPack(), and verifyInsertSliceOp().

◆ isReassociationValid()

bool mlir::isReassociationValid ( ArrayRef< AffineMap reassociation,
int *  invalidIndex = nullptr 
)

Return true if the reassociation specification is valid, false otherwise.

When false, the invalidIndex integer pointer is optionally filled with the index of the offending reassociation map.

Definition at line 197 of file ReshapeOpsUtils.cpp.

References mlir::detail::enumerate().

Referenced by verifyReshapeLikeTypes().

◆ isRowMajorBatchMatmul()

bool mlir::isRowMajorBatchMatmul ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a row major batch matmul.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 72 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().

◆ isRowMajorMatmul()

bool mlir::isRowMajorMatmul ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a row major matmul.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 20 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::getNumInputs(), and mlir::AffineMap::getNumResults().

◆ isSpeculatable()

bool mlir::isSpeculatable ( Operation op)

Returns true if the given operation is speculatable, i.e.

has no undefined behavior or other side effects.

An operation can indicate that it is speculatable by implementing the getSpeculatability hook in the ConditionallySpeculatable op interface.

Definition at line 366 of file SideEffectInterfaces.cpp.

References mlir::Operation::getRegions(), mlir::Speculation::NotSpeculatable, mlir::Speculation::RecursivelySpeculatable, and mlir::Speculation::Speculatable.

Referenced by isPure().

◆ isStrided()

bool mlir::isStrided ( MemRefType  t)

Return "true" if the layout for t is compatible with strided semantics.

Definition at line 954 of file BuiltinTypes.cpp.

References getStridesAndOffset().

Referenced by mlir::affine::AffineDmaStartOp::parse(), and mlir::affine::AffineDmaStartOp::print().

◆ isVecmat()

bool mlir::isVecmat ( ArrayAttr  indexingMaps)

Tests whether the given maps describe a vector matrix multiplication.

The test is permutation-invariant. Note that this only checks the affine maps from an operation, so does not perform any checks on the math being performed within the reduction.

Definition at line 99 of file StructuredOpsUtils.cpp.

References mlir::AffineMap::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().

◆ isZeroIndex()

bool mlir::isZeroIndex ( OpFoldResult  v)

Return true if v is an IntegerAttr with value 0 of a ConstantIndexOp with attribute with value 0.

Definition at line 18 of file StaticValueUtils.cpp.

References getConstantIntValue().

Referenced by mlir::linalg::computeTileOffsets(), mlir::linalg::computeTileSizes(), generateLoopNest(), getCollapsedIndices(), mlir::linalg::rewriteInDestinationPassingStyle(), and mlir::scf::tileUsingSCF().

◆ JitRunnerMain()

int mlir::JitRunnerMain ( int  argc,
char **  argv,
const DialectRegistry registry,
JitRunnerConfig  config = {} 
)

Entry point for all CPU runners.

Expects the common argc/argv arguments for standard C++ main functions. The supplied dialect registry is expected to contain any registers that appear in the input IR, they will be loaded on-demand by the parser.

Expects the common argc/argv arguments for standard C++ main functions.

Definition at line 300 of file JitRunner.cpp.

References getCommandLineOptLevel(), and options.

◆ linearize() [1/3]

int64_t mlir::linearize ( ArrayRef< int64_t >  offsets,
ArrayRef< int64_t >  basis 
)

Return the linearized index of 'offsets' w.r.t.

'basis'.

basis elements are asserted to be non-negative.

Definition at line 100 of file IndexingUtils.cpp.

References linearizeImpl().

Referenced by foldExtractFromShapeCast(), linearize(), and resolveSourceIndicesExpandShape().

◆ linearize() [2/3]

AffineExpr mlir::linearize ( MLIRContext ctx,
ArrayRef< AffineExpr offsets,
ArrayRef< AffineExpr basis 
)

Return the linearized index of 'offsets' w.r.t.

'basis'.

Assuming offsets is [o0, .. on] and basis is [b0, .. bn], return the AffineExpr o0 * b0 + .. + on * bn.

It is the caller's responsibility to pass proper AffineExpr kind that result in valid AffineExpr (i.e. cannot multiply 2 AffineDimExpr or divide by an AffineDimExpr).

basis elements are expected to bind to non-negative values.

Definition at line 175 of file IndexingUtils.cpp.

References getAffineConstantExpr(), and linearizeImpl().

◆ linearize() [3/3]

AffineExpr mlir::linearize ( MLIRContext ctx,
ArrayRef< AffineExpr offsets,
ArrayRef< int64_t >  basis 
)

Definition at line 181 of file IndexingUtils.cpp.

References getAffineConstantExprs(), and linearize().

◆ LLVM_DEPRECATED()

mlir::LLVM_DEPRECATED ( "Use applyOpPatternsGreedily() instead"  ,
"applyOpPatternsGreedily"   
)

Same as applyOpPatternsGreedily with folding.

FIXME: Remove this once transition to above is complieted.

◆ LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()

mlir::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE ( )

Enable Bitmask enums for OperationEquivalence::Flags.

◆ loopUnrollByFactor()

FailureOr< UnrolledLoopInfo > mlir::loopUnrollByFactor ( scf::ForOp  forOp,
uint64_t  unrollFactor,
function_ref< void(unsigned, Operation *, OpBuilder)>  annotateFn = nullptr 
)

Unrolls this for operation by the specified unroll factor.

Unrolls 'forOp' by 'unrollFactor', returns the unrolled main loop and the eplilog loop, if the loop is unrolled.

Returns the unrolled main loop and the eplilog loop, if the loop is unrolled. Otherwise returns failure if the loop cannot be unrolled either due to restrictions or due to invalid unroll factors. Requires positive loop bounds and step. If specified, annotates the Ops in each unrolled iteration by applying annotateFn.

Definition at line 377 of file Utils.cpp.

References ceilDivPositive(), mlir::OpBuilder::clone(), mlir::OpBuilder::create(), mlir::UnrolledLoopInfo::epilogueLoopOp, generateUnrolledLoop(), getConstantIntValue(), getConstantTripCount(), mlir::Builder::getIntegerAttr(), mlir::Value::getType(), mlir::UnrolledLoopInfo::mainLoopOp, and mlir::OpBuilder::setInsertionPointAfter().

◆ loopUnrollJamByFactor()

LogicalResult mlir::loopUnrollJamByFactor ( scf::ForOp  forOp,
uint64_t  unrollFactor 
)

Unrolls and jams this scf.for operation by the specified unroll factor.

Unrolls and jams this loop by the specified factor.

Returns failure if the loop cannot be unrolled either due to restrictions or due to invalid unroll factors. In case of unroll factor of 1, the function bails out without doing anything (returns success). Currently, only constant trip count that are divided by the unroll factor is supported. Currently, for operations with results are not supported.

Definition at line 515 of file Utils.cpp.

References areInnerBoundsInvariant(), mlir::OpBuilder::clone(), mlir::OpBuilder::createOrFold(), getConstantTripCount(), mlir::Builder::getIndexAttr(), LDBG, mlir::OpBuilder::setInsertionPoint(), mlir::JamBlockGatherer< OpTy >::subBlocks, mlir::Value::use_empty(), and mlir::JamBlockGatherer< OpTy >::walk().

◆ lowerAffineLowerBound()

Value mlir::lowerAffineLowerBound ( affine::AffineForOp  op,
OpBuilder builder 
)

Emit code that computes the lower bound of the given affine loop using standard arithmetic operations.

Referenced by getOrEmitLowerBound().

◆ lowerAffineUpperBound()

Value mlir::lowerAffineUpperBound ( affine::AffineForOp  op,
OpBuilder builder 
)

Emit code that computes the upper bound of the given affine loop using standard arithmetic operations.

Referenced by getOrEmitUpperBound().

◆ m_AnyZeroFloat()

detail::constant_float_predicate_matcher mlir::m_AnyZeroFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float (both positive and negative) zero.

Definition at line 399 of file Matchers.h.

Referenced by isDefinedAsZero(), and isZeroValue().

◆ m_Attr() [1/2]

detail::AttrOpMatcher mlir::m_Attr ( StringRef  attrName)
inline

Matches a named attribute operation.

Definition at line 374 of file Matchers.h.

◆ m_Attr() [2/2]

template<typename AttrT >
detail::AttrOpBinder<AttrT> mlir::m_Attr ( StringRef  attrName,
AttrT *  bindValue 
)
inline

Matches a named attribute operation and writes the value to bind_value.

Definition at line 392 of file Matchers.h.

◆ m_Constant() [1/2]

detail::constant_op_matcher mlir::m_Constant ( )
inline

◆ m_Constant() [2/2]

template<typename AttrT >
detail::constant_op_binder<AttrT> mlir::m_Constant ( AttrT *  bind_value)
inline

Matches a value from a constant foldable operation and writes the value to bind_value.

Definition at line 386 of file Matchers.h.

◆ m_ConstantFloat()

detail::constant_float_value_binder mlir::m_ConstantFloat ( FloatAttr::ValueType *  bind_value)
inline

Matches a constant holding a scalar/vector/tensor float (splat) and writes the float value to bind_value.

Definition at line 520 of file Matchers.h.

◆ m_ConstantInt()

detail::constant_int_value_binder mlir::m_ConstantInt ( IntegerAttr::ValueType *  bind_value)
inline

◆ m_IntRangeWithoutNegOneS()

detail::constant_int_range_predicate_matcher mlir::m_IntRangeWithoutNegOneS ( )
inline

Matches a constant scalar / vector splat / tensor splat integer or a signed integer range that does not contain minus one.

Note that this matcher interprets the target value as a signed integer.

Definition at line 471 of file Matchers.h.

Referenced by getDivSISpeculatability().

◆ m_IntRangeWithoutZeroS()

detail::constant_int_range_predicate_matcher mlir::m_IntRangeWithoutZeroS ( )
inline

Matches a constant scalar / vector splat / tensor splat integer or a signed integer range that does not contain zero.

Note that this matcher interprets the target value as a signed integer.

Definition at line 462 of file Matchers.h.

Referenced by getDivSISpeculatability().

◆ m_IntRangeWithoutZeroU()

detail::constant_int_range_predicate_matcher mlir::m_IntRangeWithoutZeroU ( )
inline

Matches a constant scalar / vector splat / tensor splat integer or a unsigned integer range that does not contain zero.

Note that this matcher interprets the target value as an unsigned integer.

Definition at line 455 of file Matchers.h.

Referenced by getDivUISpeculatability().

◆ m_NaNFloat()

detail::constant_float_predicate_matcher mlir::m_NaNFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float ones.

Definition at line 421 of file Matchers.h.

◆ m_NegInfFloat()

detail::constant_float_predicate_matcher mlir::m_NegInfFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float negative infinity.

Definition at line 435 of file Matchers.h.

◆ m_NegZeroFloat()

detail::constant_float_predicate_matcher mlir::m_NegZeroFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float negative zero.

Definition at line 409 of file Matchers.h.

◆ m_NonZero()

detail::constant_int_predicate_matcher mlir::m_NonZero ( )
inline

Matches a constant scalar / vector splat / tensor splat integer that is any non-zero value.

Definition at line 448 of file Matchers.h.

◆ m_One()

Matches a constant scalar / vector splat / tensor splat integer one.

Definition at line 478 of file Matchers.h.

Referenced by SelectToExtUI::matchAndRewrite(), FoldLaunchArguments::matchAndRewrite(), and UMulExtendedOpXOne::matchAndRewrite().

◆ m_OneFloat()

detail::constant_float_predicate_matcher mlir::m_OneFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float ones.

Definition at line 414 of file Matchers.h.

◆ m_Op() [1/3]

template<typename OpClass >
detail::op_matcher<OpClass> mlir::m_Op ( )
inline

Matches the given OpClass.

Definition at line 484 of file Matchers.h.

◆ m_Op() [2/3]

template<typename OpType , typename... Matchers>
auto mlir::m_Op ( Matchers...  matchers)

Definition at line 532 of file Matchers.h.

◆ m_Op() [3/3]

detail::NameOpMatcher mlir::m_Op ( StringRef  opName)
inline

Matches a named operation.

Definition at line 379 of file Matchers.h.

◆ m_PosInfFloat()

detail::constant_float_predicate_matcher mlir::m_PosInfFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float positive infinity.

Definition at line 427 of file Matchers.h.

◆ m_PosZeroFloat()

detail::constant_float_predicate_matcher mlir::m_PosZeroFloat ( )
inline

Matches a constant scalar / vector splat / tensor splat float positive zero.

Definition at line 404 of file Matchers.h.

◆ m_Zero()

detail::constant_int_predicate_matcher mlir::m_Zero ( )
inline

Matches a constant scalar / vector splat / tensor splat integer zero.

Definition at line 442 of file Matchers.h.

Referenced by isDefinedAsZero(), isZeroValue(), SelectToExtUI::matchAndRewrite(), MulExtendedFold< MulOp, IsSigned >::matchAndRewrite(), and IAddCarryFold::matchAndRewrite().

◆ makeCanonicalStridedLayoutExpr() [1/2]

AffineExpr mlir::makeCanonicalStridedLayoutExpr ( ArrayRef< int64_t >  sizes,
ArrayRef< AffineExpr exprs,
MLIRContext context 
)

Given MemRef sizes that are either static or dynamic, returns the canonical "contiguous" strides AffineExpr.

Strides are multiplicative and once a dynamic dimension is encountered, all canonical strides become dynamic and need to be encoded with a different symbol. For canonical strides expressions, the offset is always 0 and the fastest varying stride is always 1.

Examples:

  • memref<3x4x5xf32> has canonical stride expression 20*exprs[0] + 5*exprs[1] + exprs[2].
  • memref<3x?x5xf32> has canonical stride expression s0*exprs[0] + 5*exprs[1] + exprs[2].
  • memref<3x4x?xf32> has canonical stride expression s1*exprs[0] + s0*exprs[1] + exprs[2].

Definition at line 913 of file BuiltinTypes.cpp.

References getAffineConstantExpr(), getAffineSymbolExpr(), mlir::AffineMap::inferFromExprList(), and simplifyAffineExpr().

Referenced by makeCanonicalStridedLayoutExpr().

◆ makeCanonicalStridedLayoutExpr() [2/2]

AffineExpr mlir::makeCanonicalStridedLayoutExpr ( ArrayRef< int64_t >  sizes,
MLIRContext context 
)

Return the result of makeCanonicalStrudedLayoutExpr for the common case where exprs is {d0, d1, .., d_(sizes.size()-1)}.

Definition at line 945 of file BuiltinTypes.cpp.

References getAffineDimExpr(), and makeCanonicalStridedLayoutExpr().

◆ makeOptimizingTransformer()

std::function<llvm::Error(llvm::Module *)> mlir::makeOptimizingTransformer ( unsigned  optLevel,
unsigned  sizeLevel,
llvm::TargetMachine *  targetMachine 
)

Create a module transformer function for MLIR ExecutionEngine that runs LLVM IR passes corresponding to the given speed and size optimization levels (e.g.

-O2 or -Os). If not null, targetMachine is used to initialize passes that provide target-specific information to the LLVM optimizer. targetMachine must outlive the returned std::function.

Referenced by mlirExecutionEngineCreate(), and mlir::LLVM::ModuleToObject::optimizeModule().

◆ makeRegionIsolatedFromAbove()

SmallVector< Value > mlir::makeRegionIsolatedFromAbove ( RewriterBase rewriter,
Region region,
llvm::function_ref< bool(Operation *)>  cloneOperationIntoRegion = [](Operation *) { return false; } 
)

Make a region isolated from above.

  • Capture the values that are defined above the region and used within it.
  • Append to the entry block arguments that represent the captured values (one per captured value).
  • Replace all uses within the region of the captured values with the newly added arguments.
  • cloneOperationIntoRegion is a callback that allows caller to specify if the operation defining an OpOperand needs to be cloned into the region. Then the operands of this operation become part of the captured values set (unless the operations that define the operands themeselves are to be cloned). The cloned operations are added to the entry block of the region. Return the set of captured values for the operation.

Definition at line 84 of file RegionUtils.cpp.

References mlir::Region::begin(), mlir::OpBuilder::clone(), computeTopologicalSorting(), mlir::OpBuilder::createBlock(), mlir::Region::front(), mlir::Block::getArguments(), mlir::Block::getArgumentTypes(), mlir::Value::getDefiningOp(), mlir::Block::getNumArguments(), mlir::Operation::getOperands(), mlir::Operation::getResults(), getUsedValuesDefinedAbove(), mlir::IRMapping::map(), mlir::RewriterBase::mergeBlocks(), mlir::RewriterBase::replaceOpUsesWithIf(), mlir::RewriterBase::replaceUsesWithIf(), and mlir::OpBuilder::setInsertionPointToStart().

◆ makeReproducer()

std::string mlir::makeReproducer ( StringRef  anchorName,
const llvm::iterator_range< OpPassManager::pass_iterator > &  passes,
Operation op,
StringRef  outputFile,
bool  disableThreads = false,
bool  verifyPasses = false 
)

◆ makeStridedLinearLayoutMap()

AffineMap mlir::makeStridedLinearLayoutMap ( ArrayRef< int64_t >  strides,
int64_t  offset,
MLIRContext context 
)

Given a list of strides (in which ShapedType::kDynamic represents a dynamic value), return the single result AffineMap which represents the linearized strided layout map.

Dimensions correspond to the offset followed by the strides in order. Symbols are inserted for each dynamic dimension in order. A stride is always positive.

Examples:

  1. For offset: 0 strides: ?, ?, 1 return (i, j, k)[M, N]->(M * i + N * j + k)
  2. For offset: 3 strides: 32, ?, 16 return (i, j, k)[M]->(3 + 32 * i + M * j + 16 * k)
  3. For offset: ? strides: ?, ?, ? return (i, j, k)[off, M, N, P]->(off + M * i + N * j + P * k)

Definition at line 1800 of file BuiltinAttributes.cpp.

References mlir::detail::enumerate(), mlir::AffineMap::get(), getAffineConstantExpr(), getAffineDimExpr(), and getAffineSymbolExpr().

◆ matchConstantIndex()

detail::op_matcher< arith::ConstantIndexOp > mlir::matchConstantIndex ( )

Matches a ConstantIndexOp.

TODO: This should probably just be a general matcher that uses matchConstant and checks the operation for an index type.

Definition at line 87 of file Utils.cpp.

◆ matchPattern() [1/3]

template<typename Pattern >
bool mlir::matchPattern ( Attribute  attr,
const Pattern pattern 
)
inline

Entry point for matching a pattern over an Attribute.

Returns false when attr is null.

Definition at line 508 of file Matchers.h.

◆ matchPattern() [2/3]

template<typename Pattern >
bool mlir::matchPattern ( Operation op,
const Pattern pattern 
)
inline

Entry point for matching a pattern over an Operation.

Definition at line 500 of file Matchers.h.

◆ matchPattern() [3/3]

template<typename Pattern >
bool mlir::matchPattern ( Value  value,
const Pattern pattern 
)
inline

Entry point for matching a pattern over a Value.

Definition at line 490 of file Matchers.h.

References mlir::Value::getDefiningOp().

Referenced by mlir::LocalAliasAnalysis::aliasImpl(), allocateSubviewGPUMemoryInAddressSpace(), canonicalizeAssociativeCommutativeBinaryOp(), canonicalizeMapOrSetAndOperands(), mlir::linalg::collapseOpIterationDims(), convertFPowIOp(), createNewAliasScopesFromNoAliasParameter(), destructureIndices(), mlir::Operation::fold(), foldDynamicIndexList(), foldLoopBounds(), getAsOpFoldResult(), getAttributeIndexFromIndexOperands(), getConstantIntValue(), getConstantIntValue(), getConstantUint32(), getDivSISpeculatability(), getDivUISpeculatability(), getIntOrSplatIntValue(), getKnownLaunchDim(), mlir::shape::getShapeVec(), getSinglyExecutedRegionsToSink(), mlir::ValueShapeRange::getValueAsShape(), handleInlinedAllocas(), mlir::OperationFolder::insertKnownConstant(), integerConstants(), isDefinedAsZero(), isDefinedOutsideOrConstant(), isLikelyAnIndexComputation(), isSplatWriteConsistentWithMaskedRead(), mlir::affine::isValidSymbol(), isZeroValue(), mlir::affine::makeComposedFoldedAffineApply(), makeComposedFoldedMinMax(), mlir::linalg::makeComposedPadHighOp(), SelectToExtUI::matchAndRewrite(), CmpFIntToFPConst::matchAndRewrite(), FoldLaunchArguments::matchAndRewrite(), MulExtendedFold< MulOp, IsSigned >::matchAndRewrite(), IAddCarryFold::matchAndRewrite(), UModSimplification::matchAndRewrite(), UMulExtendedOpXOne::matchAndRewrite(), TransposeIsReshape::matchAndRewrite(), mlir::LLVM::ModuleImport::matchFloatAttr(), mlir::LLVM::ModuleImport::matchIntegerAttr(), materializeConstant(), maybeConstantDimsAttr(), movePaddingToFillOrGenericOp(), mlir::OperationFolder::notifyRemoval(), remainsLegalAfterInline(), simplifyConstSwitchValue(), mlir::OpBuilder::tryFold(), tryFoldTensors(), and vectorizePackOpPrecondition().

◆ matchReduction()

Value mlir::matchReduction ( ArrayRef< BlockArgument iterCarriedArgs,
unsigned  redPos,
SmallVectorImpl< Operation * > &  combinerOps 
)

Utility to match a generic reduction given a list of iteration-carried arguments, iterCarriedArgs and the position of the potential reduction argument within the list, redPos.

If a reduction is matched, returns the reduced value and the topologically-sorted list of combiner operations involved in the reduction. Otherwise, returns a null value.

The matching algorithm relies on the following invariants, which are subject to change:

  1. The first combiner operation must be a binary operation with the iteration-carried value and the reduced value as operands.
  2. The iteration-carried value and combiner operations must be side effect-free, have single result and a single use.
  3. Combiner operations must be immediately nested in the region op performing the reduction.
  4. Reduction def-use chain must end in a terminator op that yields the next iteration/output values in the same order as the iteration-carried values in iterCarriedArgs.
  5. iterCarriedArgs must contain all the iteration-carried/output values of the region op performing the reduction.

This utility is generic enough to detect reductions involving multiple combiner operations (disabled for now) across multiple dialects, including Linalg, Affine and SCF. For the sake of genericity, it does not return specific enum values for the combiner operations since its goal is also matching reductions without pre-defined semantics in core MLIR. It's up to each client to make sense out of the list of combiner operations. It's also up to each client to check for additional invariants on the expected reductions not covered by this generic matching.

Definition at line 241 of file SliceAnalysis.cpp.

References dependsOnCarriedVals(), mlir::Operation::getNumOperands(), mlir::Operation::getNumResults(), mlir::Operation::getOperand(), mlir::Operation::getParentOp(), mlir::Operation::getUsers(), mlir::Value::getUsers(), mlir::Operation::hasOneUse(), mlir::Value::hasOneUse(), isMemoryEffectFree(), and mlir::Operation::mightHaveTrait().

Referenced by mlir::linalg::getCombinerOp(), getSupportedReduction(), matchLinalgReduction(), matchSimpleReduction(), mlir::linalg::splitReduction(), and mlir::linalg::splitReductionByScaling().

◆ mayBeGraphRegion()

bool mlir::mayBeGraphRegion ( Region region)

Return "true" if the given region may be a graph region without SSA dominance.

This function returns "true" in case the owner op is an unregistered op. It returns "false" if it is a registered op that does not implement the RegionKindInterface.

Definition at line 27 of file RegionKindInterface.cpp.

References mlir::Region::getParentOp(), mlir::Region::getRegionNumber(), and mlir::Operation::isRegistered().

◆ mayHaveSSADominance()

bool mlir::mayHaveSSADominance ( Region region)

Return "true" if the given region may have SSA dominance.

This function also returns "true" in case the owner op is an unregistered op or an op that does not implement the RegionKindInterface.

Definition at line 20 of file RegionKindInterface.cpp.

References mlir::Region::getParentOp(), and mlir::Region::getRegionNumber().

Referenced by mlir::ForwardDominanceIterator< NoGraphRegions >::makeIterable(), and mlir::ReverseDominanceIterator< NoGraphRegions >::makeIterable().

◆ MlirLspServerMain()

LogicalResult mlir::MlirLspServerMain ( int  argc,
char **  argv,
DialectRegistry registry 
)

Implementation for tools like mlir-lsp-server.

  • registry should contain all the dialects that can be parsed in source IR passed to the server.

Definition at line 21 of file MlirLspServerMain.cpp.

References mlir::lsp::Logger::Debug, mlir::lsp::Delimited, mlir::lsp::Logger::Error, mlir::lsp::Logger::Info, mlir::lsp::URIForFile::registerSupportedScheme(), mlir::lsp::runMlirLSPServer(), mlir::lsp::Logger::setLogLevel(), and mlir::lsp::Standard.

◆ MlirOptMain() [1/3]

LogicalResult mlir::MlirOptMain ( int  argc,
char **  argv,
llvm::StringRef  inputFilename,
llvm::StringRef  outputFilename,
DialectRegistry registry 
)

Implementation for tools like mlir-opt.

This function can be used with registerAndParseCLIOptions so that CLI options can be accessed before running MlirOptMain.

  • inputFilename is the name of the input mlir file.
  • outputFilename is the name of the output file.
  • registry should contain all the dialects that can be parsed in the source.

Definition at line 633 of file MlirOptMain.cpp.

References config, mlir::MlirOptMainConfig::createFromCLOptions(), MlirOptMain(), openInputFile(), openOutputFile(), printRegisteredDialects(), and printRegisteredPassesAndReturn().

◆ MlirOptMain() [2/3]

LogicalResult mlir::MlirOptMain ( int  argc,
char **  argv,
llvm::StringRef  toolName,
DialectRegistry registry 
)

Implementation for tools like mlir-opt.

  • toolName is used for the header displayed by --help.
  • registry should contain all the dialects that can be parsed in the source.

Definition at line 677 of file MlirOptMain.cpp.

References MlirOptMain(), and registerAndParseCLIOptions().

◆ MlirOptMain() [3/3]

LogicalResult mlir::MlirOptMain ( llvm::raw_ostream &  outputStream,
std::unique_ptr< llvm::MemoryBuffer >  buffer,
DialectRegistry registry,
const MlirOptMainConfig config 
)

Perform the core processing behind mlir-opt.

  • outputStream is the stream where the resulting IR is printed.
  • buffer is the in-memory file to parser and process.
  • registry should contain all the dialects that can be parsed in the source.
  • config contains the configuration options for the tool.

Definition at line 599 of file MlirOptMain.cpp.

References config, printRegisteredDialects(), and printRegisteredPassesAndReturn().

Referenced by MlirOptMain().

◆ MlirPdllLspServerMain()

LogicalResult mlir::MlirPdllLspServerMain ( int  argc,
char **  argv 
)

◆ mlirQueryMain()

llvm::LogicalResult mlir::mlirQueryMain ( int  argc,
char **  argv,
MLIRContext context,
const mlir::query::matcher::Registry matcherRegistry 
)

◆ mlirReduceMain()

LogicalResult mlir::mlirReduceMain ( int  argc,
char **  argv,
MLIRContext context 
)

◆ MlirTblgenMain()

int mlir::MlirTblgenMain ( int  argc,
char **  argv 
)

Main Program for tools like 'mlir-tblgen' with custom backends.

To add a new backend, simply create a new 'mlir::GenRegistration' global variable. See its documentation for more info.

The 'argc' and 'argv' arguments are simply forwarded from a main function. The return value is the exit code from llvm::TableGenMain.

Definition at line 140 of file MlirTblgenMain.cpp.

References actionOnDeprecatedValue, Error, generator, mlirTableGenMain(), None, and Warn.

◆ mlirTranslateMain()

LogicalResult mlir::mlirTranslateMain ( int  argc,
char **  argv,
StringRef  toolName 
)

Translate to/from an MLIR module from/to an external representation (e.g.

LLVM IR, SPIRV binary, ...). This is the entry point for the implementation of tools like mlir-translate. The translation to perform is parsed from the command line. The toolName argument is used for the header displayed by --help.

◆ moveLoopInvariantCode() [1/2]

size_t mlir::moveLoopInvariantCode ( ArrayRef< Region * >  regions,
function_ref< bool(Value, Region *)>  isDefinedOutsideRegion,
function_ref< bool(Operation *, Region *)>  shouldMoveOutOfRegion,
function_ref< void(Operation *, Region *)>  moveOutOfRegion 
)

Given a list of regions, perform loop-invariant code motion.

An operation is loop-invariant if it depends only of values defined outside of the loop. LICM moves these operations out of the loop body so that they are not computed more than once.

Example:

affine.for %arg0 = 0 to 10 {
affine.for %arg1 = 0 to 10 {
%v0 = arith.addi %arg0, %arg0 : i32
%v1 = arith.addi %v0, %arg1 : i32
}
}

After LICM:

affine.for %arg0 = 0 to 10 {
%v0 = arith.addi %arg0, %arg0 : i32
affine.for %arg1 = 0 to 10 {
%v1 = arith.addi %v0, %arg1 : i32
}
}

Users must supply three callbacks.

  • isDefinedOutsideRegion returns true if the given value is invariant with respect to the given region. A common implementation might be: value.getParentRegion()->isProperAncestor(region).
  • shouldMoveOutOfRegion returns true if the provided operation can be moved of the given region, e.g. if it is side-effect free.
  • moveOutOfRegion moves the operation out of the given region. A common implementation might be: op->moveBefore(region->getParentOp()).

An operation is moved if all of its operands satisfy isDefinedOutsideRegion and it satisfies shouldMoveOutOfRegion.

Returns the number of operations moved.

Definition at line 59 of file LoopInvariantCodeMotionUtils.cpp.

References canBeHoisted(), mlir::Operation::getParentRegion(), and mlir::Operation::getUsers().

Referenced by mlir::linalg::hoistRedundantVectorBroadcasts(), mlir::linalg::hoistRedundantVectorTransfers(), and moveLoopInvariantCode().

◆ moveLoopInvariantCode() [2/2]

size_t mlir::moveLoopInvariantCode ( LoopLikeOpInterface  loopLike)

Move side-effect free loop invariant code out of a loop-like op using methods provided by the interface.

Definition at line 106 of file LoopInvariantCodeMotionUtils.cpp.

References moveLoopInvariantCode().

◆ normalizeForallOp()

FailureOr< scf::ForallOp > mlir::normalizeForallOp ( RewriterBase rewriter,
scf::ForallOp  forallOp 
)

Normalize an scf.forall operation.

Returns failure()if normalization fails. newly created operation with all uses of the original operation replaced with results of the new operation.

Definition at line 1466 of file Utils.cpp.

References mlir::OpBuilder::create(), emitNormalizedLoopBounds(), mlir::RewriterBase::inlineRegionBefore(), isConstantIntValue(), mlir::Range::offset, mlir::RewriterBase::replaceAllOpUsesWith(), mlir::Range::size, and mlir::Range::stride.

◆ openInputFile() [1/2]

std::unique_ptr< llvm::MemoryBuffer > mlir::openInputFile ( llvm::StringRef  inputFilename,
llvm::Align  alignment,
std::string *  errorMessage = nullptr 
)

Open the file specified by its name for reading, with the given buffer alignment constraint.

Write the error message to errorMessage if errors occur and errorMessage is not nullptr.

Definition at line 43 of file FileUtilities.cpp.

References openInputFileImpl().

◆ openInputFile() [2/2]

std::unique_ptr<llvm::MemoryBuffer> mlir::openInputFile ( llvm::StringRef  inputFilename,
std::string *  errorMessage = nullptr 
)

Open the file specified by its name for reading.

Write the error message to errorMessage if errors occur and errorMessage is not nullptr.

Referenced by loadIRDLDialects(), loadModule(), MlirOptMain(), mlirQueryMain(), parseMLIRInput(), and mlir::transform::detail::parseTransformModuleFromFile().

◆ openOutputFile()

std::unique_ptr<llvm::ToolOutputFile> mlir::openOutputFile ( llvm::StringRef  outputFilename,
std::string *  errorMessage = nullptr 
)

Open the file specified by its name for writing.

Write the error message to errorMessage if errors occur and errorMessage is not nullptr.

Referenced by createTreePrinterOutputPath(), mlir::SimpleObjectCache::dumpToObjectFile(), generateLocationsFromIR(), mlir::tracing::InstallDebugHandler::Impl::Impl(), makeReproducerStreamFactory(), MlirOptMain(), and mlirReduceMain().

◆ operator!=() [1/6]

bool mlir::operator!= ( OpState  lhs,
OpState  rhs 
)
inline

Definition at line 261 of file OpDefinition.h.

References mlir::OpState::getOperation().

◆ operator!=() [2/6]

bool mlir::operator!= ( RegionBranchPoint  lhs,
RegionBranchPoint  rhs 
)
inline

Definition at line 251 of file ControlFlowInterfaces.h.

◆ operator!=() [3/6]

bool mlir::operator!= ( StringAttr  lhs,
std::nullptr_t   
)
inline

Definition at line 1058 of file BuiltinAttributes.h.

◆ operator!=() [4/6]

bool mlir::operator!= ( StringAttr  lhs,
StringAttr  rhs 
)
inline

Definition at line 1064 of file BuiltinAttributes.h.

◆ operator!=() [5/6]

bool mlir::operator!= ( StringAttr  lhs,
StringRef  rhs 
)
inline

Definition at line 1070 of file BuiltinAttributes.h.

◆ operator!=() [6/6]

bool mlir::operator!= ( StringRef  lhs,
StringAttr  rhs 
)
inline

Definition at line 1074 of file BuiltinAttributes.h.

◆ operator&()

ChangeResult mlir::operator& ( ChangeResult  lhs,
ChangeResult  rhs 
)
inline

Definition at line 47 of file DataFlowFramework.h.

References NoChange.

◆ operator*()

AffineExpr mlir::operator* ( int64_t  val,
AffineExpr  expr 
)
inline

Definition at line 265 of file AffineExpr.h.

◆ operator+()

AffineExpr mlir::operator+ ( int64_t  val,
AffineExpr  expr 
)
inline

Definition at line 264 of file AffineExpr.h.

◆ operator-()

AffineExpr mlir::operator- ( int64_t  val,
AffineExpr  expr 
)
inline

Definition at line 266 of file AffineExpr.h.

◆ operator<<() [1/38]

template<typename AsmPrinterT , typename ElementT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
ArrayRef< ElementT >  types 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [2/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
Attribute  attr 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [3/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
bool  value 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [4/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
const APFloat &  value 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [5/38]

template<typename AsmPrinterT , typename T , std::enable_if_t<!std::is_convertible< T &, Value & >::value &&!std::is_convertible< T &, Type & >::value &&!std::is_convertible< T &, Attribute & >::value &&!std::is_convertible< T &, ValueRange >::value &&!std::is_convertible< T &, APFloat & >::value &&!llvm::is_one_of< T, bool, float, double >::value, T > * = nullptr>
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
const T &  other 
)
inlinedelete

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [6/38]

template<typename AsmPrinterT , typename T >
std::enable_if_t<std::is_same<AsmPrinter, AsmPrinterT>::value && std::is_convertible<T &, ValueRange>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
const T &  other 
)
inlinedelete

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [7/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
const TypeRange types 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [8/38]

template<typename AsmPrinterT , typename ValueRangeT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
const ValueTypeRange< ValueRangeT > &  types 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [9/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
double  value 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [10/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
float  value 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [11/38]

template<typename AsmPrinterT >
std::enable_if_t<std::is_base_of<AsmPrinter, AsmPrinterT>::value, AsmPrinterT &> mlir::operator<< ( AsmPrinterT &  p,
Type  type 
)
inline

Definition at line 96 of file OpImplementation.h.

◆ operator<<() [12/38]

OpAsmPrinter& mlir::operator<< ( OpAsmPrinter p,
Block value 
)
inline

Definition at line 534 of file OpImplementation.h.

References mlir::OpAsmPrinter::printSuccessor().

◆ operator<<() [13/38]

template<typename T , std::enable_if_t< std::is_convertible< T &, ValueRange >::value &&!std::is_convertible< T &, Value & >::value, T > * = nullptr>
OpAsmPrinter& mlir::operator<< ( OpAsmPrinter p,
const T &  values 
)
inline

Definition at line 529 of file OpImplementation.h.

References mlir::OpAsmPrinter::printOperands().

◆ operator<<() [14/38]

OpAsmPrinter& mlir::operator<< ( OpAsmPrinter p,
Value  value 
)
inline

Definition at line 520 of file OpImplementation.h.

References mlir::OpAsmPrinter::printOperand().

◆ operator<<() [15/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
Block block 
)

Definition at line 4061 of file AsmPrinter.cpp.

References mlir::Block::print().

◆ operator<<() [16/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
const ConstantIntRanges range 
)

◆ operator<<() [17/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
const IntegerValueRange range 
)

Definition at line 144 of file InferIntRangeInterface.cpp.

References mlir::IntegerValueRange::print().

◆ operator<<() [18/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
AffineExpr  expr 
)

Definition at line 1038 of file AffineExpr.cpp.

References mlir::AffineExpr::print().

◆ operator<<() [19/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
AffineMap  map 
)
inline

Definition at line 664 of file AffineMap.h.

References mlir::AffineMap::print().

◆ operator<<() [20/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
Attribute  attr 
)
inline

Definition at line 168 of file Attributes.h.

References mlir::Attribute::print().

◆ operator<<() [21/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const AliasResult result 
)
inline

Definition at line 78 of file AliasAnalysis.h.

References mlir::AliasResult::print().

◆ operator<<() [22/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const AnalysisState state 
)
inline

Definition at line 649 of file DataFlowFramework.h.

◆ operator<<() [23/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const Diagnostic diag 
)
inline

Definition at line 302 of file Diagnostics.h.

References diag().

◆ operator<<() [24/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const DiagnosticArgument arg 
)
inline

Definition at line 143 of file Diagnostics.h.

References mlir::DiagnosticArgument::print().

◆ operator<<() [25/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const IRUnit unit 
)

◆ operator<<() [26/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const Location loc 
)
inline

Definition at line 123 of file Location.h.

References mlir::Location::print().

◆ operator<<() [27/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const ModRefResult result 
)
inline

Definition at line 165 of file AliasAnalysis.h.

References mlir::ModRefResult::print().

◆ operator<<() [28/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const Operation op 
)
inline

Definition at line 1101 of file Operation.h.

References print(), and mlir::OpPrintingFlags::useLocalScope().

◆ operator<<() [29/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
const Range range 
)

Definition at line 3026 of file MemRefOps.cpp.

References mlir::Range::offset, mlir::Range::size, and mlir::Range::stride.

◆ operator<<() [30/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
const TypeRange types 
)
inline

Emit a type range to the given output stream.

Definition at line 77 of file TypeRange.h.

◆ operator<<() [31/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
LatticeAnchor  anchor 
)
inline

Definition at line 654 of file DataFlowFramework.h.

References mlir::LatticeAnchor::print().

◆ operator<<() [32/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
OperationName  info 
)
inline

Definition at line 509 of file OperationSupport.h.

References mlir::OperationName::print().

◆ operator<<() [33/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
OpFoldResult  ofr 
)
inline

Allow printing to a stream.

Definition at line 302 of file OpDefinition.h.

◆ operator<<() [34/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
OpState  op 
)
inline

Allow printing to a stream.

Definition at line 310 of file OpDefinition.h.

References mlir::OpState::print().

◆ operator<<() [35/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
ProgramPoint  point 
)
inline

Definition at line 149 of file DataFlowFramework.h.

References mlir::ProgramPoint::print().

◆ operator<<() [36/38]

raw_ostream & mlir::operator<< ( raw_ostream &  os,
SymbolTable::Visibility  visibility 
)

◆ operator<<() [37/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
Type  type 
)
inline

Definition at line 261 of file Types.h.

References mlir::Type::print().

◆ operator<<() [38/38]

raw_ostream& mlir::operator<< ( raw_ostream &  os,
Value  value 
)
inline

Definition at line 256 of file Value.h.

References mlir::Value::print().

◆ operator==() [1/6]

template<typename RangeT >
bool mlir::operator== ( ArrayRef< Type lhs,
const ValueTypeRange< RangeT > &  rhs 
)
inline

Definition at line 163 of file TypeRange.h.

◆ operator==() [2/6]

bool mlir::operator== ( OpState  lhs,
OpState  rhs 
)
inline

Definition at line 258 of file OpDefinition.h.

References mlir::OpState::getOperation().

◆ operator==() [3/6]

bool mlir::operator== ( StringAttr  lhs,
std::nullptr_t   
)
inline

Define comparisons for StringAttr against nullptr and itself to avoid the StringRef overloads from being chosen when not desirable.

Definition at line 1057 of file BuiltinAttributes.h.

Referenced by mlir::ValueBoundsConstraintSet::BoundBuilder::operator==().

◆ operator==() [4/6]

bool mlir::operator== ( StringAttr  lhs,
StringAttr  rhs 
)
inline

Definition at line 1061 of file BuiltinAttributes.h.

◆ operator==() [5/6]

bool mlir::operator== ( StringAttr  lhs,
StringRef  rhs 
)
inline

Allow direct comparison with StringRef.

Definition at line 1067 of file BuiltinAttributes.h.

◆ operator==() [6/6]

bool mlir::operator== ( StringRef  lhs,
StringAttr  rhs 
)
inline

Definition at line 1071 of file BuiltinAttributes.h.

◆ operator|()

ChangeResult mlir::operator| ( ChangeResult  lhs,
ChangeResult  rhs 
)
inline

Definition at line 40 of file DataFlowFramework.h.

References Change.

◆ operator|=()

ChangeResult& mlir::operator|= ( ChangeResult lhs,
ChangeResult  rhs 
)
inline

Definition at line 43 of file DataFlowFramework.h.

◆ outlineIfOp()

LogicalResult mlir::outlineIfOp ( RewriterBase b,
scf::IfOp  ifOp,
func::FuncOp *  thenFn,
StringRef  thenFnName,
func::FuncOp *  elseFn,
StringRef  elseFnName 
)

Outline the then and/or else regions of ifOp as follows:

  • if thenFn is not null, thenFnName must be specified and the then region is inlined into a new FuncOp that is captured by the pointer.
  • if elseFn is not null, elseFnName must be specified and the else region is inlined into a new FuncOp that is captured by the pointer. Creates new FuncOps and thus cannot be used in a FuncOp pass. The client is responsible for providing a unique thenFnName/elseFnName that will not collide with another FuncOp name.

Definition at line 223 of file Utils.cpp.

References outlineSingleBlockRegion().

◆ outlineKernelFunc()

gpu::GPUFuncOp mlir::outlineKernelFunc ( gpu::LaunchOp  launchOp,
StringRef  kernelFnName,
llvm::SmallVectorImpl< Value > &  operands 
)

Get a gpu.func created from outlining the region of a gpu.launch op with the given kernelFnName.

The region of the launchOp can use values from above. These need to be captured and passed as arguments to the generated gpu.func. The generated function has arguments

  • corresponding to the values passed in as operands, in that order.
  • any additional values that might be used within the region of the launchOp and defined above it. These captured values are appended to the operands list.

Definition at line 265 of file KernelOutlining.cpp.

References outlineKernelFuncImpl().

◆ outlineSingleBlockRegion()

FailureOr< func::FuncOp > mlir::outlineSingleBlockRegion ( RewriterBase rewriter,
Location  loc,
Region region,
StringRef  funcName,
func::CallOp *  callOp = nullptr 
)

Outline a region with a single block into a new FuncOp.

Assumes the FuncOp result types is the type of the yielded operands of the single block. This constraint makes it easy to determine the result. This method also clones the arith::ConstantIndexOp at the start of outlinedFuncBody to alloc simple canonicalizations. Creates a new FuncOp and thus cannot be used in a FuncOp pass. The client is responsible for providing a unique funcName that will not collide with another FuncOp name. If callOp is provided, it will be set to point to the operation that calls the outlined function.

Assumes the FuncOp result types is the type of the yielded operands of the single block. This constraint makes it easy to determine the result. This method also clones the arith::ConstantIndexOp at the start of outlinedFuncBody to alloc simple canonicalizations. If callOp is provided, it will be set to point to the operation that calls the outlined function.

Definition at line 119 of file Utils.cpp.

References mlir::Region::begin(), mlir::OpBuilder::clone(), mlir::OpBuilder::create(), mlir::OpBuilder::createBlock(), mlir::RewriterBase::eraseOp(), mlir::Region::front(), get(), mlir::Block::getArguments(), mlir::Region::getArguments(), mlir::Builder::getContext(), mlir::Value::getDefiningOp(), mlir::Block::getNumArguments(), mlir::Operation::getOperands(), mlir::Operation::getOperandTypes(), mlir::detail::IROperandBase::getOwner(), mlir::Region::getParentOfType(), mlir::Operation::getResult(), mlir::Operation::getResultTypes(), mlir::Block::getTerminator(), getUsedValuesDefinedAbove(), mlir::Region::hasOneBlock(), mlir::IRMapping::map(), mlir::RewriterBase::mergeBlocks(), mlir::Value::replaceUsesWithIf(), mlir::OpBuilder::setInsertionPoint(), mlir::OpBuilder::setInsertionPointToEnd(), and mlir::OpBuilder::setInsertionPointToStart().

Referenced by outlineIfOp().

◆ parallelFor()

template<typename FuncT >
void mlir::parallelFor ( MLIRContext context,
size_t  begin,
size_t  end,
FuncT &&  func 
)

Invoke the given function on the elements between [begin, end) asynchronously.

Diagnostics emitted during processing are ordered relative to the element's position within [begin, end). If the provided context does not have multi-threading enabled, this function always processes elements sequentially.

Definition at line 141 of file Threading.h.

References parallelForEach().

◆ parallelForEach() [1/2]

template<typename IteratorT , typename FuncT >
void mlir::parallelForEach ( MLIRContext context,
IteratorT  begin,
IteratorT  end,
FuncT &&  func 
)

Invoke the given function on the elements between [begin, end) asynchronously.

Diagnostics emitted during processing are ordered relative to the element's position within [begin, end). If the provided context does not have multi-threading enabled, this function always processes elements sequentially.

Definition at line 117 of file Threading.h.

References failableParallelForEach().

Referenced by parallelFor(), and parallelForEach().

◆ parallelForEach() [2/2]

template<typename RangeT , typename FuncT >
void mlir::parallelForEach ( MLIRContext context,
RangeT &&  range,
FuncT &&  func 
)

Invoke the given function on the elements in the provided range asynchronously.

Diagnostics emitted during processing are ordered relative to the element's position within the range. If the provided context does not have multi-threading enabled, this function always processes elements sequentially.

Definition at line 130 of file Threading.h.

References parallelForEach().

◆ parseAffineMap()

AffineMap mlir::parseAffineMap ( llvm::StringRef  str,
MLIRContext context 
)

This parses a single IntegerSet/AffineMap to an MLIR context if it was valid.

If not, an error message is emitted through a new SourceMgrDiagnosticHandler constructed from a new SourceMgr with a single MemoryBuffer wrapping str. If the passed str has additional tokens that were not part of the IntegerSet/AffineMap, a failure is returned.

◆ parseAsmSourceFile()

LogicalResult mlir::parseAsmSourceFile ( const llvm::SourceMgr &  sourceMgr,
Block block,
const ParserConfig config,
AsmParserState asmState = nullptr,
AsmParserCodeCompleteContext codeCompleteContext = nullptr 
)

This parses the file specified by the indicated SourceMgr and appends parsed operations to the given block.

If the block is non-empty, the operations are placed before the current terminator. If parsing is successful, success is returned. Otherwise, an error message is emitted through the error handler registered in the context, and failure is returned. If sourceFileLoc is non-null, it is populated with a file location representing the start of the source file that is being parsed. If asmState is non-null, it is populated with detailed information about the parsed IR (including exact locations for SSA uses and definitions). asmState should only be provided if this detailed information is desired. If codeCompleteContext is non-null, it is used to signal tracking of a code completion event (generally only ever useful for LSP or other high level language tooling).

Definition at line 2840 of file Parser.cpp.

References config, and mlir::FileLineColLoc::get().

◆ parseAttribute()

Attribute mlir::parseAttribute ( llvm::StringRef  attrStr,
MLIRContext context,
Type  type = {},
size_t *  numRead = nullptr,
bool  isKnownNullTerminated = false 
)

This parses a single MLIR attribute to an MLIR context if it was valid.

If not, an error diagnostic is emitted to the context and a null value is returned. If numRead is provided, it is set to the number of consumed characters on succesful parse. Otherwise, parsing fails if the entire string is not consumed. Some internal copying can be skipped if the source string is known to be null terminated.

Referenced by mlirAttributeParseGet().

◆ parseDimensionList()

ParseResult mlir::parseDimensionList ( OpAsmParser parser,
DenseI64ArrayAttr dimensions 
)

◆ parseDynamicIndexList() [1/5]

ParseResult mlir::parseDynamicIndexList ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  values,
DenseI64ArrayAttr integers,
AsmParser::Delimiter  delimiter 
)
inline

Definition at line 155 of file ViewLikeInterface.h.

References parseDynamicIndexList().

◆ parseDynamicIndexList() [2/5]

ParseResult mlir::parseDynamicIndexList ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  values,
DenseI64ArrayAttr integers,
DenseBoolArrayAttr scalableVals,
SmallVectorImpl< Type > *  valueTypes = nullptr,
AsmParser::Delimiter  delimiter = AsmParser::Delimiter::Square 
)

Parser hook for custom directive in assemblyFormat.

custom<DynamicIndexList>($values, $integers) custom<DynamicIndexList>($values, $integers, type($values))

where values is of ODS type Variadic<*> and integers is of ODS type I64ArrayAttr. Parse a mixed list with either (1) static integer values or (2) SSA values. Fill integers with the integer ArrayAttr, where kDynamic encodes the position of SSA values. Add the parsed SSA values to values in-order. If valueTypes is non-null, fill it with types corresponding to values; otherwise the caller must handle the types.

E.g. after parsing "[%arg0 : index, 7, 42, %arg42 : i32]":

  1. result is filled with the i64 ArrayAttr "[`kDynamic`, 7, 42, `kDynamic`]"
  2. ssa is filled with "[%arg0, %arg1]".

Indices can be scalable. For example, "4" in "[2, [4], 8]" is scalable. This notation is similar to how scalable dims are marked when defining Vectors. For each value in integers, the corresponding bool in scalableVals encodes whether it's a scalable index.

Definition at line 148 of file ViewLikeInterface.cpp.

References mlir::AsmParser::emitError(), mlir::AsmParser::getBuilder(), mlir::Builder::getDenseBoolArrayAttr(), mlir::Builder::getDenseI64ArrayAttr(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseInteger(), mlir::AsmParser::parseOptionalLSquare(), mlir::OpAsmParser::parseOptionalOperand(), and mlir::AsmParser::parseOptionalRSquare().

Referenced by parseDynamicIndexList(), and mlir::transform::parsePackedOrDynamicIndexList().

◆ parseDynamicIndexList() [3/5]

ParseResult mlir::parseDynamicIndexList ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  values,
DenseI64ArrayAttr integers,
SmallVectorImpl< Type > &  valueTypes,
AsmParser::Delimiter  delimiter = AsmParser::Delimiter::Square 
)
inline

Definition at line 172 of file ViewLikeInterface.h.

References parseDynamicIndexList().

◆ parseDynamicIndexList() [4/5]

ParseResult mlir::parseDynamicIndexList ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  values,
DenseI64ArrayAttr integers,
SmallVectorImpl< Type > &  valueTypes,
DenseBoolArrayAttr scalableVals,
AsmParser::Delimiter  delimiter = AsmParser::Delimiter::Square 
)
inline

Definition at line 181 of file ViewLikeInterface.h.

References parseDynamicIndexList().

◆ parseDynamicIndexList() [5/5]

ParseResult mlir::parseDynamicIndexList ( OpAsmParser parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > &  values,
DenseI64ArrayAttr integers,
SmallVectorImpl< Type > *  valueTypes = nullptr,
AsmParser::Delimiter  delimiter = AsmParser::Delimiter::Square 
)
inline

Definition at line 163 of file ViewLikeInterface.h.

References parseDynamicIndexList().

◆ parseIntegerSet()

IntegerSet mlir::parseIntegerSet ( llvm::StringRef  str,
MLIRContext context 
)

◆ parsePassPipeline() [1/2]

LogicalResult mlir::parsePassPipeline ( StringRef  pipeline,
OpPassManager pm,
raw_ostream &  errorStream = llvm::errs() 
)

Parse the textual representation of a pass pipeline, adding the result to 'pm' on success.

Returns failure if the given pipeline was invalid. 'errorStream' is the output stream used to emit errors found during parsing.

Definition at line 767 of file PassRegistry.cpp.

Referenced by mlir::PassPipelineCLParser::addToPipeline(), mlir::PassReproducerOptions::apply(), mlirOpPassManagerAddPipeline(), mlirParsePassPipeline(), and parsePassPipeline().

◆ parsePassPipeline() [2/2]

FailureOr< OpPassManager > mlir::parsePassPipeline ( StringRef  pipeline,
raw_ostream &  errorStream = llvm::errs() 
)

Parse the given textual representation of a pass pipeline, and return the parsed pipeline on success.

The given pipeline string should be wrapped with the desired type of operation to root the created operation, i.e. builtin.module(cse) over cse. Returns failure if the given pipeline was invalid. 'errorStream' is the output stream used to emit errors found during parsing.

Definition at line 781 of file PassRegistry.cpp.

References parsePassPipeline().

◆ parseSemiFunctionType() [1/2]

ParseResult mlir::parseSemiFunctionType ( OpAsmParser parser,
Type argumentType,
SmallVectorImpl< Type > &  resultTypes 
)

◆ parseSemiFunctionType() [2/2]

ParseResult mlir::parseSemiFunctionType ( OpAsmParser parser,
Type argumentType,
Type resultType,
bool  resultOptional = true 
)

Parses a single non-function type or a function type with at least one argument.

This allows for the following syntax:

  • type: just the argument type;
  • ( type ) -> type: one argument and one result type;
  • ( type ) -> ( comma-separated-type-list ): one argument and multiple result types.

Unlike FunctionType, this allows and requires one to omit the parens around the argument type in absence of result types, and does not accept the trailing -> () construct, which makes the syntax nicer for operations.

Definition at line 14 of file Syntax.cpp.

References mlir::AsmParser::parseArrow(), mlir::AsmParser::parseLParen(), mlir::AsmParser::parseOptionalLParen(), mlir::AsmParser::parseRParen(), and mlir::AsmParser::parseType().

◆ parseSourceFile() [1/10]

LogicalResult mlir::parseSourceFile ( const llvm::SourceMgr &  sourceMgr,
Block block,
const ParserConfig config,
LocationAttr sourceFileLoc = nullptr 
)

This parses the file specified by the indicated SourceMgr and appends parsed operations to the given block.

If the block is non-empty, the operations are placed before the current terminator. If parsing is successful, success is returned. Otherwise, an error message is emitted through the error handler registered in the context, and failure is returned. If sourceFileLoc is non-null, it is populated with a file location representing the start of the source file that is being parsed.

Definition at line 20 of file Parser.cpp.

Referenced by mlir::lsp::MLIRServer::convertFromBytecode(), mlirQueryMain(), and parseSourceFileForTool().

◆ parseSourceFile() [2/10]

template<typename ContainerOpT = Operation *>
OwningOpRef<ContainerOpT> mlir::parseSourceFile ( const llvm::SourceMgr &  sourceMgr,
const ParserConfig config 
)
inline

This parses the file specified by the indicated SourceMgr.

If the source IR contained a single instance of ContainerOpT, it is returned. Otherwise, a new instance of ContainerOpT is constructed containing all of the parsed operations. If parsing was not successful, null is returned and an error message is emitted through the error handler registered in the context, and failure is returned. ContainerOpT is required to have a single region containing a single block, and must implement the SingleBlockImplicitTerminator trait.

Definition at line 177 of file Parser.h.

References config.

◆ parseSourceFile() [3/10]

LogicalResult mlir::parseSourceFile ( const std::shared_ptr< llvm::SourceMgr > &  sourceMgr,
Block block,
const ParserConfig config,
LocationAttr sourceFileLoc = nullptr 
)

An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR).

This is useful, for example, to avoid copying some large resources into the MLIRContext and instead referencing the data directly from the input buffers.

Definition at line 34 of file Parser.cpp.

References mlir::pdll::ast::Context::getDiagEngine().

◆ parseSourceFile() [4/10]

template<typename ContainerOpT = Operation *>
OwningOpRef<ContainerOpT> mlir::parseSourceFile ( const std::shared_ptr< llvm::SourceMgr > &  sourceMgr,
const ParserConfig config 
)
inline

An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR).

This is useful, for example, to avoid copying some large resources into the MLIRContext and instead referencing the data directly from the input buffers.

Definition at line 187 of file Parser.h.

References config.

◆ parseSourceFile() [5/10]

LogicalResult mlir::parseSourceFile ( llvm::StringRef  filename,
Block block,
const ParserConfig config,
LocationAttr sourceFileLoc = nullptr 
)

This parses the file specified by the indicated filename and appends parsed operations to the given block.

If the block is non-empty, the operations are placed before the current terminator. If parsing is successful, success is returned. Otherwise, an error message is emitted through the error handler registered in the context, and failure is returned. If sourceFileLoc is non-null, it is populated with a file location representing the start of the source file that is being parsed.

Definition at line 49 of file Parser.cpp.

◆ parseSourceFile() [6/10]

LogicalResult mlir::parseSourceFile ( llvm::StringRef  filename,
const std::shared_ptr< llvm::SourceMgr > &  sourceMgr,
Block block,
const ParserConfig config,
LocationAttr sourceFileLoc = nullptr 
)

An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR).

This is useful, for example, to avoid copying some large resources into the MLIRContext and instead referencing the data directly from the input buffers.

Definition at line 82 of file Parser.cpp.

◆ parseSourceFile() [7/10]

template<typename ContainerOpT = Operation *>
OwningOpRef<ContainerOpT> mlir::parseSourceFile ( llvm::StringRef  filename,
const std::shared_ptr< llvm::SourceMgr > &  sourceMgr,
const ParserConfig config 
)
inline

An overload with a source manager that may have references taken during the parsing process, and whose lifetime can be freely extended (such that the source manager is not destroyed before the parsed IR).

This is useful, for example, to avoid copying some large resources into the MLIRContext and instead referencing the data directly from the input buffers.

Definition at line 227 of file Parser.h.

References config.

◆ parseSourceFile() [8/10]

LogicalResult mlir::parseSourceFile ( llvm::StringRef  filename,
llvm::SourceMgr &  sourceMgr,
Block block,
const ParserConfig config,
LocationAttr sourceFileLoc = nullptr 
)

This parses the file specified by the indicated filename using the provided SourceMgr and appends parsed operations to the given block.

If the block is non-empty, the operations are placed before the current terminator. If parsing is successful, success is returned. Otherwise, an error message is emitted through the error handler registered in the context, and failure is returned. If sourceFileLoc is non-null, it is populated with a file location representing the start of the source file that is being parsed.

Definition at line 74 of file Parser.cpp.

◆ parseSourceFile() [9/10]

template<typename ContainerOpT = Operation *>
OwningOpRef<ContainerOpT> mlir::parseSourceFile ( llvm::StringRef  filename,
llvm::SourceMgr &  sourceMgr,
const ParserConfig config 
)
inline

This parses the file specified by the indicated filename using the provided SourceMgr.

If the source IR contained a single instance of ContainerOpT, it is returned. Otherwise, a new instance of ContainerOpT is constructed containing all of the parsed operations. If parsing was not successful, null is returned and an error message is emitted through the error handler registered in the context, and failure is returned. ContainerOpT is required to have a single region containing a single block, and must implement the SingleBlockImplicitTerminator trait.

Definition at line 215 of file Parser.h.

References config.

◆ parseSourceFile() [10/10]

template<typename ContainerOpT = Operation *>
OwningOpRef<ContainerOpT> mlir::parseSourceFile ( StringRef  filename,
const ParserConfig config 
)
inline

This parses the file specified by the indicated filename.

If the source IR contained a single instance of ContainerOpT, it is returned. Otherwise, a new instance of ContainerOpT is constructed containing all of the parsed operations. If parsing was not successful, null is returned and an error message is emitted through the error handler registered in the context, and failure is returned. ContainerOpT is required to have a single region containing a single block, and must implement the SingleBlockImplicitTerminator trait.

Definition at line 201 of file Parser.h.

References config.

◆ parseSourceFileForTool()

OwningOpRef<Operation *> mlir::parseSourceFileForTool ( const std::shared_ptr< llvm::SourceMgr > &  sourceMgr,
const ParserConfig config,
bool  insertImplicitModule 
)
inline

This parses the file specified by the indicated SourceMgr.

If parsing was not successful, null is returned and an error message is emitted through the error handler registered in the context. If 'insertImplicitModule' is true a top-level 'builtin.module' op will be inserted that contains the parsed IR, unless one exists already.

Definition at line 27 of file ParseUtilities.h.

References config, and parseSourceFile().

Referenced by loadModule(), parseMLIRInput(), and performActions().

◆ parseSourceString() [1/2]

LogicalResult mlir::parseSourceString ( llvm::StringRef  sourceStr,
Block block,
const ParserConfig config,
StringRef  sourceName = "",
LocationAttr sourceFileLoc = nullptr 
)

This parses the IR string and appends parsed operations to the given block.

If the block is non-empty, the operations are placed before the current terminator. If parsing is successful, success is returned. Otherwise, an error message is emitted through the error handler registered in the context, and failure is returned. sourceName is used as the file name of the source; any IR without locations will get a FileLineColLoc location with sourceName as the file name. If sourceFileLoc is non-null, it is populated with a file location representing the start of the source file that is being parsed.

Definition at line 90 of file Parser.cpp.

Referenced by mlirOperationCreateParse(), and parseSourceString().

◆ parseSourceString() [2/2]

template<typename ContainerOpT = Operation *>
OwningOpRef<ContainerOpT> mlir::parseSourceString ( llvm::StringRef  sourceStr,
const ParserConfig config,
StringRef  sourceName = "" 
)
inline

This parses the provided string containing MLIR.

If the source IR contained a single instance of ContainerOpT, it is returned. Otherwise, a new instance of ContainerOpT is constructed containing all of the parsed operations. If parsing was not successful, null is returned and an error message is emitted through the error handler registered in the context, and failure is returned. ContainerOpT is required to have a single region containing a single block, and must implement the SingleBlockImplicitTerminator trait. sourceName is used as the file name of the source; any IR without locations will get a FileLineColLoc location with sourceName as the file name.

Definition at line 245 of file Parser.h.

References config, and parseSourceString().

◆ parseType()

Type mlir::parseType ( llvm::StringRef  typeStr,
MLIRContext context,
size_t *  numRead = nullptr,
bool  isKnownNullTerminated = false 
)

This parses a single MLIR type to an MLIR context if it was valid.

If not, an error diagnostic is emitted to the context. If numRead is provided, it is set to the number of consumed characters on succesful parse. Otherwise, parsing fails if the entire string is not consumed. Some internal copying can be skipped if the source string is known to be null terminated.

Referenced by mlirTypeParseGet(), parseExtTypeParams(), and mlir::AsmParser::parseTypeList().

◆ populateAffineToStdConversionPatterns()

void mlir::populateAffineToStdConversionPatterns ( RewritePatternSet patterns)

Collect a set of patterns to convert from the Affine dialect to the Standard dialect, in particular convert structured affine control flow into CFG branch-based control flow.

Definition at line 528 of file AffineToStandard.cpp.

References patterns.

◆ populateAffineToVectorConversionPatterns()

void mlir::populateAffineToVectorConversionPatterns ( RewritePatternSet patterns)

Collect a set of patterns to convert vector-related Affine ops to the Vector dialect.

Definition at line 546 of file AffineToStandard.cpp.

References patterns.

◆ populateAMDGPUToROCDLConversionPatterns()

void mlir::populateAMDGPUToROCDLConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns,
amdgpu::Chipset  chipset 
)

Note: The ROCDL target does not support the LLVM bfloat type at this time and so this function will add conversions to change all bfloat uses to i16.

Definition at line 1042 of file AMDGPUToROCDL.cpp.

References patterns.

◆ populateAMXLegalizeForLLVMExportPatterns()

void mlir::populateAMXLegalizeForLLVMExportPatterns ( LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to lower AMX ops to ops that map to LLVM intrinsics.

Definition at line 211 of file LegalizeForLLVMExport.cpp.

References mlir::TypeConverter::addConversion(), get(), mlir::LLVMTypeConverter::getContext(), and patterns.

◆ populateAnyFunctionOpInterfaceTypeConversionPattern()

void mlir::populateAnyFunctionOpInterfaceTypeConversionPattern ( RewritePatternSet patterns,
const TypeConverter converter 
)

Definition at line 3165 of file DialectConversion.cpp.

References patterns.

◆ populateArithToEmitCPatterns()

void mlir::populateArithToEmitCPatterns ( TypeConverter typeConverter,
RewritePatternSet patterns 
)

Definition at line 742 of file ArithToEmitC.cpp.

References patterns, and populateEmitCSizeTTypeConversions().

◆ populateArmSMEToLLVMConversionPatterns()

void mlir::populateArmSMEToLLVMConversionPatterns ( LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Populate the given list with patterns that convert from the ArmSME dialect to LLVM intrinsics.

Definition at line 978 of file ArmSMEToLLVM.cpp.

References mlir::TypeConverter::addConversion(), mlir::arm_sme::isValidSMETileVectorType(), and patterns.

◆ populateArmSMEToSCFConversionPatterns()

void mlir::populateArmSMEToSCFConversionPatterns ( RewritePatternSet patterns)

Collect a set of patterns to convert from the ArmSME dialect to SCF.

Definition at line 392 of file ArmSMEToSCF.cpp.

References patterns.

◆ populateArmSVELegalizeForLLVMExportPatterns()

void mlir::populateArmSVELegalizeForLLVMExportPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to lower ArmSVE ops to ops that map to LLVM intrinsics.

Populate the given list with patterns that convert from ArmSVE to LLVM.

Definition at line 202 of file LegalizeForLLVMExport.cpp.

References mlir::LLVMTypeConverter::getContext(), and patterns.

◆ populateAsyncFuncToAsyncRuntimeConversionPatterns()

void mlir::populateAsyncFuncToAsyncRuntimeConversionPatterns ( RewritePatternSet patterns,
ConversionTarget target 
)

◆ populateAsyncStructuralTypeConversionsAndLegality()

void mlir::populateAsyncStructuralTypeConversionsAndLegality ( TypeConverter typeConverter,
RewritePatternSet patterns,
ConversionTarget target 
)

Populates patterns for async structural type conversions.

A "structural" type conversion is one where the underlying ops are completely agnostic to the actual types involved and simply need to update their types. An example of this is async.execute – the async.execute op and the corresponding async.yield ops need to update their types accordingly to the TypeConverter, but otherwise don't care what type conversions are happening.

Definition at line 1149 of file AsyncToLLVM.cpp.

References mlir::TypeConverter::addConversion(), mlir::ConversionTarget::addDynamicallyLegalOp(), mlir::TypeConverter::convertType(), get(), mlir::TypeConverter::isLegal(), and patterns.

◆ populateBranchOpInterfaceTypeConversionPattern()

void mlir::populateBranchOpInterfaceTypeConversionPattern ( RewritePatternSet patterns,
const TypeConverter converter,
function_ref< bool(BranchOpInterface branchOp, int idx)>  shouldConvertBranchOperand = nullptr 
)

Add a pattern to the given pattern list to rewrite branch operations to use operands that have been legalized by the conversion framework.

This can only be done if the branch operation implements the BranchOpInterface. Only needed for partial conversions.

If for some branch ops, we need to convert/legalize only a sub-set of the op's operands, such filtering behavior can be specified in shouldConvertBranchOperand. This callback should return true if branchOp's operand at index idx should be converted.

◆ populateBuiltinFuncToSPIRVPatterns()

void mlir::populateBuiltinFuncToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating the builtin func op to the SPIR-V dialect.

These patterns do not handle shader interface/ABI; they convert function parameters to be of SPIR-V allowed types.

Definition at line 1585 of file SPIRVConversion.cpp.

References patterns.

◆ populateCallOpTypeConversionPattern()

void mlir::populateCallOpTypeConversionPattern ( RewritePatternSet patterns,
const TypeConverter converter 
)

Add a pattern to the given pattern list to convert the operand and result types of a CallOp with the given type converter.

Definition at line 67 of file FuncConversions.cpp.

References patterns.

Referenced by mlir::arith::populateArithNarrowTypeEmulationPatterns(), and mlir::arith::populateArithWideIntEmulationPatterns().

◆ populateCommutativityUtilsPatterns()

void mlir::populateCommutativityUtilsPatterns ( RewritePatternSet patterns)

Populates the commutativity utility patterns.

Definition at line 312 of file CommutativityUtils.cpp.

References patterns.

◆ populateComplexToLibmConversionPatterns()

void mlir::populateComplexToLibmConversionPatterns ( RewritePatternSet patterns,
PatternBenefit  benefit 
)

Populate the given list with patterns that convert from Complex to Libm calls.

Definition at line 100 of file ComplexToLibm.cpp.

References patterns.

◆ populateComplexToLLVMConversionPatterns()

void mlir::populateComplexToLLVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Populate the given list with patterns that convert from Complex to LLVM.

Definition at line 325 of file ComplexToLLVM.cpp.

References patterns.

◆ populateComplexToSPIRVPatterns()

void mlir::populateComplexToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating Complex ops to SPIR-V ops.

Definition at line 105 of file ComplexToSPIRV.cpp.

References patterns.

◆ populateComplexToStandardConversionPatterns()

void mlir::populateComplexToStandardConversionPatterns ( RewritePatternSet patterns)

Populate the given list with patterns that convert from Complex to Standard.

Definition at line 1221 of file ComplexToStandard.cpp.

References patterns.

◆ populateConversionTargetFromOperation()

void mlir::populateConversionTargetFromOperation ( Operation op,
ConversionTarget target,
LLVMTypeConverter typeConverter,
RewritePatternSet patterns 
)

Recursively walk the IR and collect all dialects implementing the interface, and populate the conversion patterns.

Definition at line 16 of file ToLLVMInterface.cpp.

References mlir::Operation::getDialect(), patterns, and mlir::Operation::walk().

◆ populateConvertArmNeon2dToIntrPatterns()

void mlir::populateConvertArmNeon2dToIntrPatterns ( RewritePatternSet patterns)

Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.

See createConvertArmNeon2dToIntrPass.

Definition at line 69 of file ArmNeon2dToIntr.cpp.

References patterns.

◆ populateConvertShapeConstraintsConversionPatterns()

void mlir::populateConvertShapeConstraintsConversionPatterns ( RewritePatternSet patterns)

Definition at line 44 of file ConvertShapeConstraints.cpp.

References patterns.

◆ populateEmitCSizeTTypeConversions()

void mlir::populateEmitCSizeTTypeConversions ( TypeConverter converter)

◆ populateExpandAcoshPattern()

void mlir::populateExpandAcoshPattern ( RewritePatternSet patterns)

Definition at line 667 of file ExpandPatterns.cpp.

References convertAcoshOp(), and patterns.

◆ populateExpandAsinhPattern()

void mlir::populateExpandAsinhPattern ( RewritePatternSet patterns)

Definition at line 663 of file ExpandPatterns.cpp.

References convertAsinhOp(), and patterns.

◆ populateExpandAtanhPattern()

void mlir::populateExpandAtanhPattern ( RewritePatternSet patterns)

Definition at line 671 of file ExpandPatterns.cpp.

References convertAtanhOp(), and patterns.

◆ populateExpandCeilFPattern()

void mlir::populateExpandCeilFPattern ( RewritePatternSet patterns)

Definition at line 679 of file ExpandPatterns.cpp.

References convertCeilOp(), and patterns.

◆ populateExpandCoshPattern()

void mlir::populateExpandCoshPattern ( RewritePatternSet patterns)

Definition at line 651 of file ExpandPatterns.cpp.

References convertCoshOp(), and patterns.

◆ populateExpandCtlzPattern()

void mlir::populateExpandCtlzPattern ( RewritePatternSet patterns)

Definition at line 643 of file ExpandPatterns.cpp.

References convertCtlzOp(), and patterns.

◆ populateExpandExp2FPattern()

void mlir::populateExpandExp2FPattern ( RewritePatternSet patterns)

Definition at line 683 of file ExpandPatterns.cpp.

References convertExp2fOp(), and patterns.

◆ populateExpandFloorFPattern()

void mlir::populateExpandFloorFPattern ( RewritePatternSet patterns)

Definition at line 699 of file ExpandPatterns.cpp.

References convertFloorOp(), and patterns.

◆ populateExpandFmaFPattern()

void mlir::populateExpandFmaFPattern ( RewritePatternSet patterns)

Definition at line 675 of file ExpandPatterns.cpp.

References convertFmaFOp(), and patterns.

◆ populateExpandFPowIPattern()

void mlir::populateExpandFPowIPattern ( RewritePatternSet patterns)

Definition at line 691 of file ExpandPatterns.cpp.

References convertFPowIOp(), and patterns.

◆ populateExpandPowFPattern()

void mlir::populateExpandPowFPattern ( RewritePatternSet patterns)

Definition at line 687 of file ExpandPatterns.cpp.

References convertPowfOp(), and patterns.

◆ populateExpandRoundEvenPattern()

void mlir::populateExpandRoundEvenPattern ( RewritePatternSet patterns)

Definition at line 703 of file ExpandPatterns.cpp.

References convertRoundEvenOp(), and patterns.

◆ populateExpandRoundFPattern()

void mlir::populateExpandRoundFPattern ( RewritePatternSet patterns)

Definition at line 695 of file ExpandPatterns.cpp.

References convertRoundOp(), and patterns.

◆ populateExpandRsqrtPattern()

void mlir::populateExpandRsqrtPattern ( RewritePatternSet patterns)

Definition at line 707 of file ExpandPatterns.cpp.

References convertRsqrtOp(), and patterns.

◆ populateExpandSinhPattern()

void mlir::populateExpandSinhPattern ( RewritePatternSet patterns)

Definition at line 647 of file ExpandPatterns.cpp.

References convertSinhOp(), and patterns.

◆ populateExpandTanhPattern()

void mlir::populateExpandTanhPattern ( RewritePatternSet patterns)

Definition at line 659 of file ExpandPatterns.cpp.

References convertTanhOp(), and patterns.

◆ populateExpandTanPattern()

void mlir::populateExpandTanPattern ( RewritePatternSet patterns)

Definition at line 655 of file ExpandPatterns.cpp.

References convertTanOp(), and patterns.

◆ populateFinalizeMemRefToLLVMConversionPatterns()

void mlir::populateFinalizeMemRefToLLVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to convert memory-related operations from the MemRef dialect to the LLVM dialect.

Definition at line 1662 of file MemRefToLLVM.cpp.

References mlir::LowerToLLVMOptions::AlignedAlloc, mlir::LowerToLLVMOptions::allocLowering, mlir::LLVMTypeConverter::getOptions(), mlir::LowerToLLVMOptions::Malloc, and patterns.

◆ populateFuncOpVectorRewritePatterns()

void mlir::populateFuncOpVectorRewritePatterns ( RewritePatternSet patterns)

Definition at line 1590 of file SPIRVConversion.cpp.

References patterns.

Referenced by mlir::spirv::unrollVectorsInSignatures().

◆ populateFunctionOpInterfaceTypeConversionPattern() [1/2]

template<typename FuncOpT >
void mlir::populateFunctionOpInterfaceTypeConversionPattern ( RewritePatternSet patterns,
const TypeConverter converter 
)

◆ populateFunctionOpInterfaceTypeConversionPattern() [2/2]

void mlir::populateFunctionOpInterfaceTypeConversionPattern ( StringRef  functionLikeOpName,
RewritePatternSet patterns,
const TypeConverter converter 
)

Add a pattern to the given pattern list to convert the signature of a FunctionOpInterface op with the given type converter.

This only supports ops which use FunctionType to represent their type.

Definition at line 3158 of file DialectConversion.cpp.

References patterns.

Referenced by populateFunctionOpInterfaceTypeConversionPattern().

◆ populateFuncToEmitCPatterns()

void mlir::populateFuncToEmitCPatterns ( RewritePatternSet patterns)

Definition at line 115 of file FuncToEmitC.cpp.

References patterns.

◆ populateFuncToLLVMConversionPatterns()

void mlir::populateFuncToLLVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns,
const SymbolTable symbolTable = nullptr 
)

Collect the patterns to convert from the Func dialect to LLVM.

The conversion patterns capture the LLVMTypeConverter and the LowerToLLVMOptions by reference meaning the references have to remain alive during the entire pattern lifetime.

The symbolTable parameter can be used to speed up function lookups in the module. It's good to provide it, but only if we know that the patterns will be applied to a single module and the symbols referenced by the symbol table will not be removed and new symbols will not be added during the usage of the patterns. If provided, the lookups will have O(calls) cumulative runtime, otherwise O(calls * functions). The symbol table is currently not needed if converter.getOptions().useBarePtrCallConv is true, but it's not an error to provide it anyway.

Definition at line 733 of file FuncToLLVM.cpp.

References patterns, and populateFuncToLLVMFuncOpConversionPattern().

◆ populateFuncToLLVMFuncOpConversionPattern()

void mlir::populateFuncToLLVMFuncOpConversionPattern ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect the default pattern to convert a FuncOp to the LLVM dialect.

If emitCWrappers is set, the pattern will also produce functions that pass memref descriptors by pointer-to-structure in addition to the default unpacked form.

Definition at line 728 of file FuncToLLVM.cpp.

References patterns.

Referenced by populateFuncToLLVMConversionPatterns().

◆ populateFuncToSPIRVPatterns()

void mlir::populateFuncToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating Func ops to SPIR-V ops.

Also adds the patterns to legalize ops not directly translated to SPIR-V dialect.

Definition at line 90 of file FuncToSPIRV.cpp.

References patterns.

◆ populateFuncTypeConversionPatterns()

void mlir::populateFuncTypeConversionPatterns ( const TypeConverter typeConverter,
RewritePatternSet patterns 
)

Definition at line 75 of file OneToNFuncConversions.cpp.

References patterns.

◆ populateGpuAllReducePatterns()

void mlir::populateGpuAllReducePatterns ( RewritePatternSet patterns)

Collect a set of patterns to rewrite all-reduce ops within the GPU dialect.

Definition at line 379 of file AllReduceLowering.cpp.

References patterns.

Referenced by populateGpuRewritePatterns().

◆ populateGpuBreakDownSubgroupReducePatterns()

void mlir::populateGpuBreakDownSubgroupReducePatterns ( RewritePatternSet patterns,
unsigned  maxShuffleBitwidth = 32,
PatternBenefit  benefit = 1 
)

Collect a set of patterns to break down subgroup_reduce ops into smaller ones supported by the target of size <= maxShuffleBitwidth, where size is the subgroup_reduce value bitwidth.

Definition at line 367 of file SubgroupReduceLowering.cpp.

References patterns.

◆ populateGpuDecomposeMemrefsPatterns()

void mlir::populateGpuDecomposeMemrefsPatterns ( RewritePatternSet patterns)

Collect a set of patterns to decompose memrefs ops.

Definition at line 237 of file DecomposeMemRefs.cpp.

References patterns.

◆ populateGpuEliminateBarriersPatterns()

void mlir::populateGpuEliminateBarriersPatterns ( RewritePatternSet patterns)

Erase barriers that do not enforce conflicting memory side effects.

Definition at line 641 of file EliminateBarriers.cpp.

References patterns.

◆ populateGpuGlobalIdPatterns()

void mlir::populateGpuGlobalIdPatterns ( RewritePatternSet patterns)

Collect a set of patterns to rewrite GlobalIdOp op within the GPU dialect.

Definition at line 43 of file GlobalIdRewriter.cpp.

References patterns.

Referenced by populateGpuRewritePatterns().

◆ populateGpuLowerClusteredSubgroupReduceToShufflePatterns()

void mlir::populateGpuLowerClusteredSubgroupReduceToShufflePatterns ( RewritePatternSet patterns,
unsigned  subgroupSize,
unsigned  shuffleBitwidth = 32,
PatternBenefit  benefit = 1 
)

Disjoint counterpart of populateGpuLowerSubgroupReduceToShufflePatterns that only matches gpu.subgroup_reduce ops with a cluster_size.

Definition at line 383 of file SubgroupReduceLowering.cpp.

References patterns.

◆ populateGpuLowerSubgroupReduceToShufflePatterns()

void mlir::populateGpuLowerSubgroupReduceToShufflePatterns ( RewritePatternSet patterns,
unsigned  subgroupSize,
unsigned  shuffleBitwidth = 32,
PatternBenefit  benefit = 1 
)

Collect a set of patterns to lower gpu.subgroup_reduce into gpu.shuffle ops over shuffleBitwidth scalar types.

Assumes that the subgroup has subgroupSize lanes. Uses the butterfly shuffle algorithm.

The patterns populated by this function will ignore ops with the cluster_size attribute. populateGpuLowerClusteredSubgroupReduceToShufflePatterns is the opposite.

Definition at line 375 of file SubgroupReduceLowering.cpp.

References patterns.

◆ populateGpuMemorySpaceAttributeConversions() [1/2]

void mlir::populateGpuMemorySpaceAttributeConversions ( TypeConverter typeConverter)

Populates memory space attribute conversion rules for lowering gpu.address_space to integer values.

Definition at line 490 of file GPUToLLVMSPV.cpp.

References populateGpuMemorySpaceAttributeConversions().

◆ populateGpuMemorySpaceAttributeConversions() [2/2]

void mlir::populateGpuMemorySpaceAttributeConversions ( TypeConverter typeConverter,
const MemorySpaceMapping mapping 
)

Populates memory space attribute conversion rules for lowering gpu.address_space to integer values.

Definition at line 785 of file GPUOpsLowering.cpp.

References mlir::TypeConverter::addTypeAttributeConversion(), and wrapNumericMemorySpace().

Referenced by configureGpuToNVVMTypeConverter(), and populateGpuMemorySpaceAttributeConversions().

◆ populateGpuRewritePatterns()

void mlir::populateGpuRewritePatterns ( RewritePatternSet patterns)
inline

Collect all patterns to rewrite ops within the GPU dialect.

Definition at line 91 of file Passes.h.

References patterns, populateGpuAllReducePatterns(), populateGpuGlobalIdPatterns(), and populateGpuShufflePatterns().

◆ populateGpuShufflePatterns()

void mlir::populateGpuShufflePatterns ( RewritePatternSet patterns)

Collect a set of patterns to rewrite shuffle ops within the GPU dialect.

Definition at line 97 of file ShuffleRewriter.cpp.

References patterns.

Referenced by populateGpuRewritePatterns().

◆ populateGpuSubgroupReduceOpLoweringPattern()

void mlir::populateGpuSubgroupReduceOpLoweringPattern ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Populate GpuSubgroupReduce pattern to NVVM.

It generates a specific nvvm op that is not available on every GPU.

Definition at line 351 of file LowerGpuOpsToNVVMOps.cpp.

References patterns.

◆ populateGpuToLLVMConversionPatterns()

void mlir::populateGpuToLLVMConversionPatterns ( LLVMTypeConverter converter,
RewritePatternSet patterns,
bool  kernelBarePtrCallConv = false 
)

Collect a set of patterns to convert from the GPU dialect to LLVM and populate converter for gpu types.

Definition at line 1738 of file GPUToLLVMConversion.cpp.

References patterns.

◆ populateGpuToLLVMSPVConversionPatterns()

void mlir::populateGpuToLLVMSPVConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Definition at line 461 of file GPUToLLVMSPV.cpp.

References mlir::LLVMTypeConverter::getContext(), and patterns.

◆ populateGpuToNVVMConversionPatterns()

void mlir::populateGpuToNVVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to convert from the GPU dialect to NVVM.

Definition at line 356 of file LowerGpuOpsToNVVMOps.cpp.

References get(), mlir::LLVMTypeConverter::getContext(), mlir::NVVM::kSharedMemoryAlignmentBit, kSharedMemorySpace, and patterns.

◆ populateGpuToROCDLConversionPatterns()

void mlir::populateGpuToROCDLConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns,
gpu::amd::Runtime  runtime 
)

Collect a set of patterns to convert from the GPU dialect to ROCDL.

If runtime is Unknown, gpu.printf will not be lowered The resulting pattern set should be run over a gpu.module op

Definition at line 359 of file LowerGpuOpsToROCDLOps.cpp.

◆ populateGPUToSPIRVPatterns()

void mlir::populateGPUToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating GPU Ops to SPIR-V ops.

For a gpu.func to be converted, it should have a spirv.entry_point_abi attribute.

Definition at line 732 of file GPUToSPIRV.cpp.

References patterns.

◆ populateGpuWMMAToNVVMConversionPatterns()

void mlir::populateGpuWMMAToNVVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM.

Definition at line 390 of file WmmaOpsToNvvm.cpp.

References patterns.

◆ populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns()

void mlir::populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Collect a set of patterns to convert WMMA ops from GPU dialect to SPIRV, using the KHR Cooperative Matrix extension.

Definition at line 295 of file WmmaOpsToSPIRV.cpp.

References patterns.

◆ populateLowerForeachToSCFPatterns()

void mlir::populateLowerForeachToSCFPatterns ( RewritePatternSet patterns)

Definition at line 1593 of file SparseTensorRewriting.cpp.

References patterns.

◆ populateLowerSparseIterationToSCFPatterns()

void mlir::populateLowerSparseIterationToSCFPatterns ( const TypeConverter converter,
RewritePatternSet patterns 
)

Definition at line 435 of file SparseIterationToScf.cpp.

References patterns.

◆ populateLowerSparseOpsToForeachPatterns()

void mlir::populateLowerSparseOpsToForeachPatterns ( RewritePatternSet patterns,
bool  enableRT,
bool  enableConvert 
)

Definition at line 1577 of file SparseTensorRewriting.cpp.

References patterns.

◆ populateMathAlgebraicSimplificationPatterns()

void mlir::populateMathAlgebraicSimplificationPatterns ( RewritePatternSet patterns)

Definition at line 224 of file AlgebraicSimplification.cpp.

References patterns.

◆ populateMathPolynomialApproximationPatterns()

void mlir::populateMathPolynomialApproximationPatterns ( RewritePatternSet patterns,
const MathPolynomialApproximationOptions options = {} 
)

Definition at line 1670 of file PolynomialApproximation.cpp.

References options, and patterns.

◆ populateMathToLibmConversionPatterns()

void mlir::populateMathToLibmConversionPatterns ( RewritePatternSet patterns)

Populate the given list with patterns that convert from Math to Libm calls.

If log1pBenefit is present, use it instead of benefit for the Log1p op.

Definition at line 162 of file MathToLibm.cpp.

References patterns.

◆ populateMathToLLVMConversionPatterns()

void mlir::populateMathToLLVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns,
bool  approximateLog1p = true 
)

Definition at line 301 of file MathToLLVM.cpp.

References patterns.

◆ populateMathToROCDLConversionPatterns()

void mlir::populateMathToROCDLConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Populate the given list with patterns that convert from Math to ROCDL calls.

Definition at line 48 of file MathToROCDL.cpp.

References patterns.

◆ populateMathToSPIRVPatterns()

void mlir::populateMathToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating Math ops to SPIR-V ops.

Definition at line 488 of file MathToSPIRV.cpp.

References patterns.

◆ populateMemRefToEmitCConversionPatterns()

void mlir::populateMemRefToEmitCConversionPatterns ( RewritePatternSet patterns,
const TypeConverter converter 
)

Definition at line 184 of file MemRefToEmitC.cpp.

References patterns.

◆ populateMemRefToEmitCTypeConversion()

void mlir::populateMemRefToEmitCTypeConversion ( TypeConverter typeConverter)

◆ populateMemRefToSPIRVPatterns()

void mlir::populateMemRefToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating MemRef ops to SPIR-V ops.

Definition at line 929 of file MemRefToSPIRV.cpp.

References patterns.

◆ populateMMAToSPIRVCoopMatrixTypeConversion()

void mlir::populateMMAToSPIRVCoopMatrixTypeConversion ( mlir::SPIRVTypeConverter typeConverter)

Adds MMAMatrixType conversions to SPIR-V cooperative matrix KHR type conversion to the type converter.

Definition at line 307 of file WmmaOpsToSPIRV.cpp.

References mlir::TypeConverter::addConversion(), get(), mlir::gpu::MMAMatrixType::getElementType(), mlir::gpu::MMAMatrixType::getOperand(), and mlir::gpu::MMAMatrixType::getShape().

◆ populateNVGPUToNVVMConversionPatterns()

void mlir::populateNVGPUToNVVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Definition at line 1704 of file NVGPUToNVVM.cpp.

References patterns.

◆ populateNVVMToLLVMConversionPatterns()

void mlir::populateNVVMToLLVMConversionPatterns ( RewritePatternSet patterns)

Definition at line 111 of file NVVMToLLVM.cpp.

References patterns.

◆ populateOneToNFunctionOpInterfaceTypeConversionPattern() [1/2]

template<typename FuncOpT >
void mlir::populateOneToNFunctionOpInterfaceTypeConversionPattern ( const TypeConverter converter,
RewritePatternSet patterns 
)

◆ populateOneToNFunctionOpInterfaceTypeConversionPattern() [2/2]

void mlir::populateOneToNFunctionOpInterfaceTypeConversionPattern ( StringRef  functionLikeOpName,
const TypeConverter converter,
RewritePatternSet patterns 
)

Add a pattern to the given pattern list to convert the signature of a FunctionOpInterface op with the given type converter.

This only supports ops which use FunctionType to represent their type. This is intended to be used with the 1:N dialect conversion.

Definition at line 452 of file OneToNTypeConversion.cpp.

References patterns.

Referenced by populateOneToNFunctionOpInterfaceTypeConversionPattern().

◆ populateOpConvertToLLVMConversionPatterns()

void mlir::populateOpConvertToLLVMConversionPatterns ( Operation op,
ConversionTarget target,
LLVMTypeConverter typeConverter,
RewritePatternSet patterns 
)

Helper function for populating LLVM conversion patterns.

If op implements the ConvertToLLVMOpInterface interface, then the LLVM conversion pattern attributes provided by the interface will be used to configure the conversion target, type converter, and the pattern set.

Definition at line 34 of file ToLLVMInterface.cpp.

References mlir::Operation::getParentOfType(), and patterns.

◆ populateOpenACCToSCFConversionPatterns()

void mlir::populateOpenACCToSCFConversionPatterns ( RewritePatternSet patterns)

Collect the patterns to convert from the OpenACC dialect to OpenACC with SCF dialect.

Definition at line 61 of file OpenACCToSCF.cpp.

References patterns.

◆ populateOpenMPToLLVMConversionPatterns()

void mlir::populateOpenMPToLLVMConversionPatterns ( LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Populate the given list with patterns that convert from OpenMP to LLVM.

Definition at line 251 of file OpenMPToLLVM.cpp.

References mlir::TypeConverter::addConversion(), and patterns.

◆ populateParallelLoopToGPUPatterns()

void mlir::populateParallelLoopToGPUPatterns ( RewritePatternSet patterns)

Adds the conversion pattern from scf.parallel to gpu.launch to the provided pattern list.

Definition at line 675 of file SCFToGPU.cpp.

References patterns.

◆ populatePolynomialApproximateErfPattern()

void mlir::populatePolynomialApproximateErfPattern ( RewritePatternSet patterns)

Definition at line 1665 of file PolynomialApproximation.cpp.

References patterns.

◆ populatePolynomialApproximateTanhPattern()

void mlir::populatePolynomialApproximateTanhPattern ( RewritePatternSet patterns)

Definition at line 1660 of file PolynomialApproximation.cpp.

References patterns.

◆ populatePrepareVectorToMMAPatterns()

void mlir::populatePrepareVectorToMMAPatterns ( RewritePatternSet patterns,
bool  useNvGpu = false 
)

Patterns to transform vector ops into a canonical form to convert to MMA matrix operations.

If useNvGpu is true, then the patterns will populated will prepare for conversion to nvgpu mma operations rather than the gpu dialect WMMA operations.

Definition at line 1231 of file VectorToGPU.cpp.

References patterns, and mlir::vector::populateVectorContractCanonicalizeMatmulToMMT().

◆ populatePreSparsificationRewriting()

void mlir::populatePreSparsificationRewriting ( RewritePatternSet patterns)

Definition at line 1570 of file SparseTensorRewriting.cpp.

References patterns.

◆ populateRemoveShapeConstraintsPatterns()

void mlir::populateRemoveShapeConstraintsPatterns ( RewritePatternSet patterns)

Definition at line 64 of file RemoveShapeConstraints.cpp.

References patterns.

◆ populateReturnOpTypeConversionPattern()

void mlir::populateReturnOpTypeConversionPattern ( RewritePatternSet patterns,
const TypeConverter converter 
)

Add a pattern to the given pattern list to rewrite return ops to use operands that have been legalized by the conversion framework.

Definition at line 159 of file FuncConversions.cpp.

References patterns.

Referenced by mlir::arith::populateArithNarrowTypeEmulationPatterns(), and mlir::arith::populateArithWideIntEmulationPatterns().

◆ populateReturnOpVectorRewritePatterns()

void mlir::populateReturnOpVectorRewritePatterns ( RewritePatternSet patterns)

Definition at line 1594 of file SPIRVConversion.cpp.

References patterns.

Referenced by mlir::spirv::unrollVectorsInSignatures().

◆ populateSCFToControlFlowConversionPatterns()

void mlir::populateSCFToControlFlowConversionPatterns ( RewritePatternSet patterns)

Collect a set of patterns to convert SCF operations to CFG branch-based operations within the ControlFlow dialect.

Definition at line 708 of file SCFToControlFlow.cpp.

References patterns.

◆ populateSCFToEmitCConversionPatterns()

void mlir::populateSCFToEmitCConversionPatterns ( RewritePatternSet patterns)

Collect a set of patterns to convert SCF operations to the EmitC dialect.

Definition at line 245 of file SCFToEmitC.cpp.

References patterns.

◆ populateSCFToSPIRVPatterns()

void mlir::populateSCFToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
ScfToSPIRVContext scfToSPIRVContext,
RewritePatternSet patterns 
)

Collects a set of patterns to lower from scf.for, scf.if, and loop.terminator to CFG operations within the SPIR-V dialect.

Definition at line 439 of file SCFToSPIRV.cpp.

References mlir::ScfToSPIRVContext::getImpl(), and patterns.

◆ populateShapeRewritePatterns()

void mlir::populateShapeRewritePatterns ( RewritePatternSet patterns)

Collects a set of patterns to rewrite ops within the Shape dialect.

Definition at line 81 of file ShapeToShapeLowering.cpp.

References patterns.

◆ populateShapeToStandardConversionPatterns()

void mlir::populateShapeToStandardConversionPatterns ( RewritePatternSet patterns)

Definition at line 708 of file ShapeToStandard.cpp.

References patterns.

◆ populateSparseAssembler()

void mlir::populateSparseAssembler ( RewritePatternSet patterns,
bool  directOut 
)

Definition at line 250 of file SparseAssembler.cpp.

References patterns.

◆ populateSparseBufferRewriting()

void mlir::populateSparseBufferRewriting ( RewritePatternSet patterns,
bool  enableBufferInitialization 
)

Definition at line 1425 of file SparseBufferRewriting.cpp.

References patterns.

◆ populateSparseGPUCodegenPatterns()

void mlir::populateSparseGPUCodegenPatterns ( RewritePatternSet patterns,
unsigned  numThreads 
)

Definition at line 1325 of file SparseGPUCodegen.cpp.

References patterns.

◆ populateSparseGPULibgenPatterns()

void mlir::populateSparseGPULibgenPatterns ( RewritePatternSet patterns,
bool  enableRT 
)

Definition at line 1330 of file SparseGPUCodegen.cpp.

References patterns.

◆ populateSparseReinterpretMap()

void mlir::populateSparseReinterpretMap ( RewritePatternSet patterns,
ReinterpretMapScope  scope 
)

Definition at line 790 of file SparseReinterpretMap.cpp.

References kAll, kExceptGeneric, kGenericOnly, and patterns.

◆ populateSparseTensorCodegenPatterns()

void mlir::populateSparseTensorCodegenPatterns ( const TypeConverter typeConverter,
RewritePatternSet patterns,
bool  createSparseDeallocs,
bool  enableBufferInitialization 
)

Sets up sparse tensor codegen rules.

Populates the given patterns list with conversion rules required for the sparsification of linear algebra operations.

Definition at line 1616 of file SparseTensorCodegen.cpp.

References patterns.

◆ populateSparseTensorConversionPatterns()

void mlir::populateSparseTensorConversionPatterns ( const TypeConverter typeConverter,
RewritePatternSet patterns 
)

Sets up sparse tensor conversion rules.

Populates the given patterns list with conversion rules required for the sparsification of linear algebra operations.

Definition at line 912 of file SparseTensorConversion.cpp.

References patterns.

◆ populateSparseVectorizationPatterns()

void mlir::populateSparseVectorizationPatterns ( RewritePatternSet patterns,
unsigned  vectorLength,
bool  enableVLAVectorization,
bool  enableSIMDIndex32 
)

Populates the given patterns list with vectorization rules.

Definition at line 663 of file SparseVectorization.cpp.

References patterns, and mlir::vector::populateVectorStepLoweringPatterns().

◆ populateSparsificationPatterns()

void mlir::populateSparsificationPatterns ( RewritePatternSet patterns,
const SparsificationOptions options = SparsificationOptions() 
)

Sets up sparsification rewriting rules with the given options.

Populates the given patterns list with rewriting rules required for the sparsification of linear algebra operations.

Definition at line 1486 of file Sparsification.cpp.

References options, and patterns.

◆ populateSPIRVToLLVMConversionPatterns()

void mlir::populateSPIRVToLLVMConversionPatterns ( const LLVMTypeConverter typeConverter,
RewritePatternSet patterns,
spirv::ClientAPI  clientAPIForAddressSpaceMapping = spirv::ClientAPI::Unknown 
)

Populates the given list with patterns that convert from SPIR-V to LLVM.

Definition at line 1809 of file SPIRVToLLVM.cpp.

References patterns.

◆ populateSPIRVToLLVMFunctionConversionPatterns()

void mlir::populateSPIRVToLLVMFunctionConversionPatterns ( const LLVMTypeConverter typeConverter,
RewritePatternSet patterns 
)

Populates the given list with patterns for function conversion from SPIR-V to LLVM.

Definition at line 1975 of file SPIRVToLLVM.cpp.

References patterns.

◆ populateSPIRVToLLVMModuleConversionPatterns()

void mlir::populateSPIRVToLLVMModuleConversionPatterns ( const LLVMTypeConverter typeConverter,
RewritePatternSet patterns 
)

Populates the given patterns for module conversion from SPIR-V to LLVM.

Definition at line 1980 of file SPIRVToLLVM.cpp.

References patterns.

◆ populateSPIRVToLLVMTypeConversion()

void mlir::populateSPIRVToLLVMTypeConversion ( LLVMTypeConverter typeConverter,
spirv::ClientAPI  clientAPIForAddressSpaceMapping = spirv::ClientAPI::Unknown 
)

Populates type conversions with additional SPIR-V types.

Definition at line 1793 of file SPIRVToLLVM.cpp.

References mlir::TypeConverter::addConversion(), convertArrayType(), convertPointerType(), convertRuntimeArrayType(), and convertStructType().

◆ populateStageSparseOperationsPatterns()

void mlir::populateStageSparseOperationsPatterns ( RewritePatternSet patterns)

Sets up StageSparseOperation rewriting rules.

Definition at line 71 of file StageSparseOperations.cpp.

References patterns.

◆ populateStorageSpecifierToLLVMPatterns()

void mlir::populateStorageSpecifierToLLVMPatterns ( const TypeConverter converter,
RewritePatternSet patterns 
)

Definition at line 353 of file SparseStorageSpecifierToLLVM.cpp.

References patterns.

◆ populateTensorToLinalgPatterns()

void mlir::populateTensorToLinalgPatterns ( RewritePatternSet patterns)

Appends to a pattern list additional patterns for translating tensor ops to Linalg ops.

Definition at line 27 of file TensorToLinalg.cpp.

References patterns.

◆ populateTensorToSPIRVPatterns()

void mlir::populateTensorToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
int64_t  byteCountThreshold,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating tensor ops to SPIR-V ops.

Note: Normally tensors will be stored in buffers before converting to SPIR-V, given that is how a large amount of data is sent to the GPU. However, SPIR-V supports converting from tensors directly too. This is for the cases where the tensor just contains a small amount of elements and it makes sense to directly inline them as a small data array in the shader. To handle this, internally the conversion might create new local variables. SPIR-V consumers in GPU drivers may or may not optimize that away. So this has implications over register pressure. Therefore, a threshold is used to control when the patterns should kick in.

Definition at line 106 of file TensorToSPIRV.cpp.

References patterns.

◆ populateUpliftToFMAPatterns()

void mlir::populateUpliftToFMAPatterns ( RewritePatternSet patterns)

Definition at line 76 of file UpliftToFMA.cpp.

References patterns.

◆ populateVectorReductionToSPIRVDotProductPatterns()

void mlir::populateVectorReductionToSPIRVDotProductPatterns ( RewritePatternSet patterns)

Appends patterns to convert vector reduction of the form:

vector.reduction <add>, (muli (ext %lhs), (ext %rhs)), [%acc]

to SPIR-V integer dot product ops.

Definition at line 999 of file VectorToSPIRV.cpp.

References patterns.

◆ populateVectorToArmSMEPatterns()

void mlir::populateVectorToArmSMEPatterns ( RewritePatternSet patterns,
MLIRContext ctx 
)

Collect a set of patterns to lower Vector ops to ArmSME ops that map to LLVM intrinsics.

Definition at line 795 of file VectorToArmSME.cpp.

References patterns.

◆ populateVectorToLLVMConversionPatterns()

void mlir::populateVectorToLLVMConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns,
bool  reassociateFPReductions = false,
bool  force32BitVectorIndices = false 
)

Collect a set of patterns to convert from the Vector dialect to LLVM.

Populate the given list with patterns that convert from Vector to LLVM.

Definition at line 1906 of file ConvertVectorToLLVM.cpp.

References mlir::LLVMTypeConverter::getDialect(), and patterns.

◆ populateVectorToLLVMMatrixConversionPatterns()

void mlir::populateVectorToLLVMMatrixConversionPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to convert from Vector contractions to LLVM Matrix Intrinsics.

To lower to assembly, the LLVM flag -lower-matrix-intrinsics will be needed when invoking LLVM.

Definition at line 1931 of file ConvertVectorToLLVM.cpp.

References patterns.

◆ populateVectorToSCFConversionPatterns()

void mlir::populateVectorToSCFConversionPatterns ( RewritePatternSet patterns,
const VectorTransferToSCFOptions options = VectorTransferToSCFOptions() 
)

Collect a set of patterns to convert from the Vector dialect to SCF + func.

Definition at line 1684 of file VectorToSCF.cpp.

References options, and patterns.

◆ populateVectorToSPIRVPatterns()

void mlir::populateVectorToSPIRVPatterns ( const SPIRVTypeConverter typeConverter,
RewritePatternSet patterns 
)

Appends to a pattern list additional patterns for translating Vector Ops to SPIR-V ops.

Definition at line 975 of file VectorToSPIRV.cpp.

References patterns.

◆ populateVectorToXeGPUConversionPatterns()

void mlir::populateVectorToXeGPUConversionPatterns ( RewritePatternSet patterns)

Collect a set of patterns to convert from the vector to XeGPU ops.

Definition at line 328 of file VectorToXeGPU.cpp.

References patterns.

◆ populateX86VectorLegalizeForLLVMExportPatterns()

void mlir::populateX86VectorLegalizeForLLVMExportPatterns ( const LLVMTypeConverter converter,
RewritePatternSet patterns 
)

Collect a set of patterns to lower X86Vector ops to ops that map to LLVM intrinsics.

Populate the given list with patterns that convert from X86Vector to LLVM.

Definition at line 161 of file LegalizeForLLVMExport.cpp.

References patterns.

◆ printDimensionList()

void mlir::printDimensionList ( OpAsmPrinter printer,
Operation op,
ArrayRef< int64_t >  dimensions 
)

Definition at line 4071 of file AsmPrinter.cpp.

References mlir::AsmPrinter::printDimensionList().

◆ printDynamicIndexList() [1/3]

void mlir::printDynamicIndexList ( OpAsmPrinter printer,
Operation op,
OperandRange  values,
ArrayRef< int64_t >  integers,
ArrayRef< bool >  scalables,
TypeRange  valueTypes = TypeRange(),
AsmParser::Delimiter  delimiter = AsmParser::Delimiter::Square 
)

Printer hook for custom directive in assemblyFormat.

custom<DynamicIndexList>($values, $integers) custom<DynamicIndexList>($values, $integers, type($values))

where values is of ODS type Variadic<*> and integers is of ODS type I64ArrayAttr. Prints a list with either (1) the static integer value in integers is kDynamic or (2) the next value otherwise. If valueTypes is non-empty, it is expected to contain as many elements as values indicating their types. This allows idiomatic printing of mixed value and integer attributes in a list. E.g. [arg0 : index, 7, 42, arg42 : i32].

Indices can be scalable. For example, "4" in "[2, [4], 8]" is scalable. This notation is similar to how scalable dims are marked when defining Vectors. For each value in integers, the corresponding bool in scalables encodes whether it's a scalable index. If scalableVals is empty then assume that all indices are non-scalable.

Definition at line 113 of file ViewLikeInterface.cpp.

References getLeftDelimiter(), and getRightDelimiter().

Referenced by printDynamicIndexList(), and mlir::transform::printPackedOrDynamicIndexList().

◆ printDynamicIndexList() [2/3]

void mlir::printDynamicIndexList ( OpAsmPrinter printer,
Operation op,
OperandRange  values,
ArrayRef< int64_t >  integers,
AsmParser::Delimiter  delimiter 
)
inline

Definition at line 112 of file ViewLikeInterface.h.

References printDynamicIndexList().

◆ printDynamicIndexList() [3/3]

void mlir::printDynamicIndexList ( OpAsmPrinter printer,
Operation op,
OperandRange  values,
ArrayRef< int64_t >  integers,
TypeRange  valueTypes = TypeRange(),
AsmParser::Delimiter  delimiter = AsmParser::Delimiter::Square 
)
inline

Definition at line 119 of file ViewLikeInterface.h.

References printDynamicIndexList().

◆ printRegisteredPasses()

void mlir::printRegisteredPasses ( )

Prints the passes that were previously registered and stored in passRegistry.

Definition at line 73 of file PassRegistry.cpp.

References max(), and passRegistry.

Referenced by printRegisteredPassesAndReturn().

◆ printSemiFunctionType() [1/2]

void mlir::printSemiFunctionType ( OpAsmPrinter printer,
Operation op,
Type  argumentType,
Type  resultType,
bool  resultOptional = true 
)

Definition at line 75 of file Syntax.cpp.

References printSemiFunctionType().

◆ printSemiFunctionType() [2/2]

void mlir::printSemiFunctionType ( OpAsmPrinter printer,
Operation op,
Type  argumentType,
TypeRange  resultType 
)

Prints argument and result types in a syntax similar to that of FunctionType but allowing and requiring one to omit the parens around the argument type in absence of result types, and without the trailing -> ().

Definition at line 59 of file Syntax.cpp.

References mlir::AsmPrinter::getStream().

Referenced by printSemiFunctionType().

◆ projectDims()

AffineMap mlir::projectDims ( AffineMap  map,
const llvm::SmallBitVector &  projectedDimensions,
bool  compressDimsFlag = false 
)

Returns the map that results from projecting out the dimensions specified in projectedDimensions.

The projected dimensions are set to 0.

Example: 1) map : affine_map<(d0, d1, d2) -> (d0, d1)> projected_dimensions : {2} result : affine_map<(d0, d1) -> (d0, d1)>

2) map : affine_map<(d0, d1) -> (d0 + d1)> projected_dimensions : {1} result : affine_map<(d0) -> (d0)>

3) map : affine_map<(d0, d1, d2) -> (d0, d1)> projected_dimensions : {1} result : affine_map<(d0, d1) -> (d0, 0)>

This function also compresses the dims when the boolean flag is true.

Definition at line 906 of file AffineMap.cpp.

Referenced by compressDims(), and getProjectedMap().

◆ projectSymbols()

AffineMap mlir::projectSymbols ( AffineMap  map,
const llvm::SmallBitVector &  projectedSymbols,
bool  compressSymbolsFlag = false 
)

Symbol counterpart of projectDims.

This function also compresses the symbols when the boolean flag is true.

Definition at line 913 of file AffineMap.cpp.

Referenced by compressSymbols().

◆ promoteToWorkgroupMemory()

void mlir::promoteToWorkgroupMemory ( gpu::GPUFuncOp  op,
unsigned  arg 
)

Promotes a function argument to workgroup memory in the given function.

The copies will be inserted in the beginning and in the end of the function.

◆ readBytecodeFile() [1/2]

LogicalResult mlir::readBytecodeFile ( const std::shared_ptr< llvm::SourceMgr > &  sourceMgr,
Block block,
const ParserConfig config 
)

An overload with a source manager whose main file buffer is used for parsing.

The lifetime of the source manager may be freely extended during parsing such that the source manager is not destroyed before the parsed IR.

Definition at line 2592 of file BytecodeReader.cpp.

References config, and readBytecodeFileImpl().

◆ readBytecodeFile() [2/2]

LogicalResult mlir::readBytecodeFile ( llvm::MemoryBufferRef  buffer,
Block block,
const ParserConfig config 
)

Read the operations defined within the given memory buffer, containing MLIR bytecode, into the provided block.

Definition at line 2587 of file BytecodeReader.cpp.

References config, and readBytecodeFileImpl().

◆ readResourceHandle()

template<typename T , typename... Ts>
static LogicalResult mlir::readResourceHandle ( DialectBytecodeReader reader,
FailureOr< T > &  value,
Ts &&...  params 
)
static

Helper for resource handle reading that returns LogicalResult.

Definition at line 494 of file BytecodeImplementation.h.

References mlir::DialectBytecodeReader::readResourceHandle().

◆ reconcileUnrealizedCasts()

void mlir::reconcileUnrealizedCasts ( ArrayRef< UnrealizedConversionCastOp >  castOps,
SmallVectorImpl< UnrealizedConversionCastOp > *  remainingCastOps = nullptr 
)

Try to reconcile all given UnrealizedConversionCastOps and store the left-over ops in remainingCastOps (if provided).

This function processes cast ops in a worklist-driven fashion. For each cast op, if the chain of input casts eventually reaches a cast op where the input types match the output types of the matched op, replace the matched op with the inputs.

Example: %1 = unrealized_conversion_cast %0 : !A to !B %2 = unrealized_conversion_cast %1 : !B to !C %3 = unrealized_conversion_cast %2 : !C to !A

In the above example, %0 can be used instead of %3 and all cast ops are folded away.

Definition at line 2762 of file DialectConversion.cpp.

Referenced by mlir::OperationConverter::convertOperations().

◆ registerAllDialects() [1/2]

void mlir::registerAllDialects ( DialectRegistry registry)
inline

Add all the MLIR dialects to the provided registry.

Definition at line 106 of file InitAllDialects.h.

References mlir::DialectRegistry::insert(), mlir::linalg::registerAllDialectInterfaceImplementations(), mlir::memref::registerAllocationOpInterfaceExternalModels(), mlir::arith::registerBufferDeallocationOpInterfaceExternalModels(), mlir::cf::registerBufferDeallocationOpInterfaceExternalModels(), mlir::gpu::registerBufferDeallocationOpInterfaceExternalModels(), mlir::scf::registerBufferDeallocationOpInterfaceExternalModels(), mlir::arith::registerBufferizableOpInterfaceExternalModels(), mlir::bufferization::func_ext::registerBufferizableOpInterfaceExternalModels(), mlir::cf::registerBufferizableOpInterfaceExternalModels(), mlir::scf::registerBufferizableOpInterfaceExternalModels(), mlir::shape::registerBufferizableOpInterfaceExternalModels(), mlir::sparse_tensor::registerBufferizableOpInterfaceExternalModels(), mlir::tensor::registerBufferizableOpInterfaceExternalModels(), mlir::vector::registerBufferizableOpInterfaceExternalModels(), mlir::ml_program::registerBufferizableOpInterfaceExternalModels(), mlir::arith::registerBufferViewFlowOpInterfaceExternalModels(), mlir::memref::registerBufferViewFlowOpInterfaceExternalModels(), mlir::builtin::registerCastOpInterfaceExternalModels(), mlir::tensor::registerFindPayloadReplacementOpInterfaceExternalModels(), mlir::tensor::registerInferTypeOpInterfaceExternalModels(), mlir::LLVM::registerInlinerInterface(), mlir::memref::registerMemorySlotExternalModels(), mlir::NVVM::registerNVVMTargetInterfaceExternalModels(), mlir::ROCDL::registerROCDLTargetInterfaceExternalModels(), mlir::linalg::registerRuntimeVerifiableOpInterfaceExternalModels(), mlir::memref::registerRuntimeVerifiableOpInterfaceExternalModels(), mlir::tosa::registerShardingInterfaceExternalModels(), mlir::spirv::registerSPIRVTargetInterfaceExternalModels(), mlir::tensor::registerSubsetOpInterfaceExternalModels(), mlir::vector::registerSubsetOpInterfaceExternalModels(), mlir::tensor::registerTilingInterfaceExternalModels(), mlir::affine::registerValueBoundsOpInterfaceExternalModels(), mlir::arith::registerValueBoundsOpInterfaceExternalModels(), mlir::memref::registerValueBoundsOpInterfaceExternalModels(), mlir::scf::registerValueBoundsOpInterfaceExternalModels(), mlir::tensor::registerValueBoundsOpInterfaceExternalModels(), and mlir::vector::registerValueBoundsOpInterfaceExternalModels().

Referenced by mlirRegisterAllDialects(), and registerAllDialects().

◆ registerAllDialects() [2/2]

void mlir::registerAllDialects ( MLIRContext context)
inline

Append all the MLIR dialects to the registry contained in the given context.

Definition at line 197 of file InitAllDialects.h.

References mlir::MLIRContext::appendDialectRegistry(), and registerAllDialects().

◆ registerAllExtensions()

void mlir::registerAllExtensions ( DialectRegistry registry)
inline

This function may be called to register all MLIR dialect extensions with the provided registry.

If you're building a compiler, you generally shouldn't use this: you would individually register the specific extensions that are useful for the pipelines and transformations you are using.

Definition at line 62 of file InitAllExtensions.h.

References mlir::func::registerAllExtensions(), mlir::tensor::registerAllExtensions(), registerConvertAMXToLLVMInterface(), mlir::arith::registerConvertArithToLLVMInterface(), registerConvertComplexToLLVMInterface(), mlir::cf::registerConvertControlFlowToLLVMInterface(), registerConvertFuncToLLVMInterface(), mlir::gpu::registerConvertGpuToLLVMInterface(), mlir::NVVM::registerConvertGpuToNVVMInterface(), mlir::index::registerConvertIndexToLLVMInterface(), registerConvertMathToLLVMInterface(), registerConvertMemRefToLLVMInterface(), registerConvertNVVMToLLVMInterface(), registerConvertOpenMPToLLVMInterface(), mlir::ub::registerConvertUBToLLVMInterface(), mlir::transform::registerDebugExtension(), mlir::transform::registerIRDLExtension(), mlir::transform::registerLoopExtension(), mlir::transform::registerPDLExtension(), mlir::affine::registerTransformDialectExtension(), mlir::bufferization::registerTransformDialectExtension(), mlir::dlti::registerTransformDialectExtension(), mlir::func::registerTransformDialectExtension(), mlir::gpu::registerTransformDialectExtension(), mlir::linalg::registerTransformDialectExtension(), mlir::memref::registerTransformDialectExtension(), mlir::nvgpu::registerTransformDialectExtension(), mlir::scf::registerTransformDialectExtension(), mlir::sparse_tensor::registerTransformDialectExtension(), mlir::tensor::registerTransformDialectExtension(), and mlir::vector::registerTransformDialectExtension().

Referenced by mlirRegisterAllDialects().

◆ registerAllFromLLVMIRTranslations()

static void mlir::registerAllFromLLVMIRTranslations ( DialectRegistry registry)
inlinestatic

Registers all dialects that can be translated from LLVM IR and the corresponding translation interfaces.

Definition at line 78 of file All.h.

References registerLLVMDialectImport(), and registerNVVMDialectImport().

Referenced by registerFromLLVMIRTranslation().

◆ registerAllGPUToLLVMIRTranslations()

static void mlir::registerAllGPUToLLVMIRTranslations ( DialectRegistry registry)
inlinestatic

Registers all the translations to LLVM IR required by GPU passes.

TODO: Remove this function when a safe dialect interface registration mechanism is implemented, see D157703.

Definition at line 63 of file All.h.

References registerBuiltinDialectTranslation(), registerGPUDialectTranslation(), registerLLVMDialectTranslation(), registerNVVMDialectTranslation(), mlir::gpu::registerOffloadingLLVMTranslationInterfaceExternalModels(), registerROCDLDialectTranslation(), and registerSPIRVDialectTranslation().

◆ registerAllPasses()

void mlir::registerAllPasses ( )
inline

◆ registerAllToLLVMIRTranslations()

static void mlir::registerAllToLLVMIRTranslations ( DialectRegistry registry)
inlinestatic

◆ registerAllTranslations()

void mlir::registerAllTranslations ( )
inline

◆ registerAMXDialectTranslation() [1/2]

void mlir::registerAMXDialectTranslation ( DialectRegistry registry)

Register the AMX dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 45 of file AMXToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerAMXDialectTranslation().

◆ registerAMXDialectTranslation() [2/2]

void mlir::registerAMXDialectTranslation ( MLIRContext context)

Register the AMX dialect and the translation from it in the registry associated with the given context.

Definition at line 52 of file AMXToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerAMXDialectTranslation().

◆ registerAndParseCLIOptions()

std::pair< std::string, std::string > mlir::registerAndParseCLIOptions ( int  argc,
char **  argv,
llvm::StringRef  toolName,
DialectRegistry registry 
)

Register and parse command line options.

  • toolName is used for the header displayed by --help.
  • registry should contain all the dialects that can be parsed in the source.
  • return std::pair<std::string, std::string> for inputFilename and outputFilename command line option values.

Definition at line 558 of file MlirOptMain.cpp.

References mlir::DialectRegistry::getDialectNames(), registerAsmPrinterCLOptions(), mlir::tracing::DebugCounter::registerCLOptions(), mlir::MlirOptMainConfig::registerCLOptions(), registerDefaultTimingManagerCLOptions(), registerMLIRContextCLOptions(), and registerPassManagerCLOptions().

Referenced by MlirOptMain().

◆ registerArmNeonDialectTranslation() [1/2]

void mlir::registerArmNeonDialectTranslation ( DialectRegistry registry)

Register the ArmNeon dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 46 of file ArmNeonToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerArmNeonDialectTranslation().

◆ registerArmNeonDialectTranslation() [2/2]

void mlir::registerArmNeonDialectTranslation ( MLIRContext context)

Register the ArmNeon dialect and the translation from it in the registry associated with the given context.

Definition at line 54 of file ArmNeonToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerArmNeonDialectTranslation().

◆ registerArmSMEDialectTranslation() [1/2]

void mlir::registerArmSMEDialectTranslation ( DialectRegistry registry)

Register the ArmSME dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 46 of file ArmSMEToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerArmSMEDialectTranslation().

◆ registerArmSMEDialectTranslation() [2/2]

void mlir::registerArmSMEDialectTranslation ( MLIRContext context)

Register the ArmSME dialect and the translation from it in the registry associated with the given context.

Definition at line 53 of file ArmSMEToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerArmSMEDialectTranslation().

◆ registerArmSVEDialectTranslation() [1/2]

void mlir::registerArmSVEDialectTranslation ( DialectRegistry registry)

Register the ArmSVE dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 45 of file ArmSVEToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerArmSVEDialectTranslation().

◆ registerArmSVEDialectTranslation() [2/2]

void mlir::registerArmSVEDialectTranslation ( MLIRContext context)

Register the ArmSVE dialect and the translation from it in the registry associated with the given context.

Definition at line 52 of file ArmSVEToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerArmSVEDialectTranslation().

◆ registerAsmPrinterCLOptions()

void mlir::registerAsmPrinterCLOptions ( )

Register a set of useful command-line options that can be used to configure various flags within the AsmPrinter.

Definition at line 210 of file AsmPrinter.cpp.

References clOptions.

Referenced by registerAndParseCLIOptions().

◆ registerBuiltinDialectTranslation() [1/2]

void mlir::registerBuiltinDialectTranslation ( DialectRegistry registry)

Register the translation from the builtin dialect to the LLVM IR in the given registry.

Definition at line 36 of file BuiltinToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by mlirExecutionEngineCreate(), registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerBuiltinDialectTranslation().

◆ registerBuiltinDialectTranslation() [2/2]

void mlir::registerBuiltinDialectTranslation ( MLIRContext context)

Register the translation from the builtin dialect in the registry associated with the given context.

Definition at line 42 of file BuiltinToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerBuiltinDialectTranslation().

◆ registerConversionPDLFunctions()

void mlir::registerConversionPDLFunctions ( RewritePatternSet patterns)

Register the dialect conversion PDL functions with the given pattern set.

Definition at line 3348 of file DialectConversion.cpp.

References mlir::TypeConverter::convertType(), mlir::TypeConverter::convertTypes(), mlir::detail::ConversionPatternRewriterImpl::currentTypeConverter, patterns, and pdllConvertValues().

◆ registerConvertAMXToLLVMInterface()

void mlir::registerConvertAMXToLLVMInterface ( DialectRegistry registry)

Register LLVM conversion interface for AMX dialect.

Definition at line 241 of file LegalizeForLLVMExport.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertComplexToLLVMInterface()

void mlir::registerConvertComplexToLLVMInterface ( DialectRegistry registry)

Definition at line 386 of file ComplexToLLVM.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertFuncToLLVMInterface()

void mlir::registerConvertFuncToLLVMInterface ( DialectRegistry registry)

Definition at line 833 of file FuncToLLVM.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertMathToLLVMInterface()

void mlir::registerConvertMathToLLVMInterface ( DialectRegistry registry)

Definition at line 358 of file MathToLLVM.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertMemRefToLLVMInterface()

void mlir::registerConvertMemRefToLLVMInterface ( DialectRegistry registry)

Definition at line 1748 of file MemRefToLLVM.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertNVVMToLLVMInterface()

void mlir::registerConvertNVVMToLLVMInterface ( DialectRegistry registry)

Definition at line 115 of file NVVMToLLVM.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertOpenMPToLLVMInterface()

void mlir::registerConvertOpenMPToLLVMInterface ( DialectRegistry registry)

Registers the ConvertToLLVMPatternInterface interface in the OpenMP dialect.

Definition at line 341 of file OpenMPToLLVM.cpp.

References mlir::DialectRegistry::addExtension().

Referenced by registerAllExtensions().

◆ registerConvertToLLVMDependentDialectLoading()

void mlir::registerConvertToLLVMDependentDialectLoading ( DialectRegistry registry)

Register the extension that will load dependent dialects for LLVM conversion.

This is useful to implement a pass similar to "convert-to-llvm".

Definition at line 279 of file ConvertToLLVMPass.cpp.

References mlir::DialectRegistry::addExtensions().

◆ registerDefaultTimingManagerCLOptions()

void mlir::registerDefaultTimingManagerCLOptions ( )

Register a set of useful command-line options that can be used to configure a DefaultTimingManager.

The values of these options can be applied via the applyDefaultTimingManagerCLOptions method.

Definition at line 614 of file Timing.cpp.

References options.

Referenced by registerAndParseCLIOptions().

◆ registerFromLLVMIRTranslation()

void mlir::registerFromLLVMIRTranslation ( )

◆ registerFromSPIRVTranslation()

void mlir::registerFromSPIRVTranslation ( )

Definition at line 58 of file TranslateRegistration.cpp.

References deserializeModule().

Referenced by registerAllTranslations().

◆ registerGPUDialectTranslation() [1/2]

void mlir::registerGPUDialectTranslation ( DialectRegistry registry)

Register the GPU dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 66 of file GPUToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerGPUDialectTranslation().

◆ registerGPUDialectTranslation() [2/2]

void mlir::registerGPUDialectTranslation ( MLIRContext context)

Register the GPU dialect and the translation from it in the registry associated with the given context.

Definition at line 73 of file GPUToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerGPUDialectTranslation().

◆ registerLLVMDialectImport() [1/2]

void mlir::registerLLVMDialectImport ( DialectRegistry registry)

Registers the LLVM dialect and its import from LLVM IR in the given registry.

Definition at line 434 of file LLVMIRToLLVMTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllFromLLVMIRTranslations(), and registerLLVMDialectImport().

◆ registerLLVMDialectImport() [2/2]

void mlir::registerLLVMDialectImport ( MLIRContext context)

Registers the LLVM dialect and its import from LLVM IR with the given context.

Definition at line 441 of file LLVMIRToLLVMTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerLLVMDialectImport().

◆ registerLLVMDialectTranslation() [1/2]

void mlir::registerLLVMDialectTranslation ( DialectRegistry registry)

Register the LLVM dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 483 of file LLVMToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by mlirExecutionEngineCreate(), registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerLLVMDialectTranslation().

◆ registerLLVMDialectTranslation() [2/2]

void mlir::registerLLVMDialectTranslation ( MLIRContext context)

Register the LLVM dialect and the translation from it in the registry associated with the given context.

Definition at line 490 of file LLVMToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerLLVMDialectTranslation().

◆ registerMLIRContextCLOptions()

void mlir::registerMLIRContextCLOptions ( )

Register a set of useful command-line options that can be used to configure various flags within the MLIRContext.

These flags are used when constructing an MLIR context for initialization.

Definition at line 90 of file MLIRContext.cpp.

References clOptions.

Referenced by registerAndParseCLIOptions().

◆ registerNVVMDialectImport() [1/2]

void mlir::registerNVVMDialectImport ( DialectRegistry registry)

Registers the NVVM dialect and its import from LLVM IR in the given registry.

Definition at line 89 of file LLVMIRToNVVMTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllFromLLVMIRTranslations(), and registerNVVMDialectImport().

◆ registerNVVMDialectImport() [2/2]

void mlir::registerNVVMDialectImport ( MLIRContext context)

Registers the NVVM dialect and its import from LLVM IR with the given context.

Definition at line 96 of file LLVMIRToNVVMTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerNVVMDialectImport().

◆ registerNVVMDialectTranslation() [1/2]

void mlir::registerNVVMDialectTranslation ( DialectRegistry registry)

Register the NVVM dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 311 of file NVVMToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerNVVMDialectTranslation().

◆ registerNVVMDialectTranslation() [2/2]

void mlir::registerNVVMDialectTranslation ( MLIRContext context)

Register the NVVM dialect and the translation from it in the registry associated with the given context.

Definition at line 318 of file NVVMToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerNVVMDialectTranslation().

◆ registerOpenACCDialectTranslation() [1/2]

void mlir::registerOpenACCDialectTranslation ( DialectRegistry registry)

Register the OpenACC dialect and the translation to the LLVM IR in the given registry;.

Definition at line 533 of file OpenACCToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerOpenACCDialectTranslation().

◆ registerOpenACCDialectTranslation() [2/2]

void mlir::registerOpenACCDialectTranslation ( MLIRContext context)

Register the OpenACC dialect and the translation in the registry associated with the given context.

Definition at line 540 of file OpenACCToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerOpenACCDialectTranslation().

◆ registerOpenMPDialectTranslation() [1/2]

void mlir::registerOpenMPDialectTranslation ( DialectRegistry registry)

Register the OpenMP dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 4516 of file OpenMPToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by mlirExecutionEngineCreate(), registerAllToLLVMIRTranslations(), and registerOpenMPDialectTranslation().

◆ registerOpenMPDialectTranslation() [2/2]

void mlir::registerOpenMPDialectTranslation ( MLIRContext context)

Register the OpenMP dialect and the translation from it in the registry associated with the given context.

Definition at line 4523 of file OpenMPToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerOpenMPDialectTranslation().

◆ registerPass()

void mlir::registerPass ( const PassAllocatorFunction function)

Register a specific dialect pass allocator function with the system, typically used through the PassRegistration template.

Definition at line 150 of file PassRegistry.cpp.

References passRegistry, and passRegistryTypeIDs.

Referenced by mlir::PassRegistration< ConcretePass >::PassRegistration().

◆ registerPassManagerCLOptions()

void mlir::registerPassManagerCLOptions ( )

Register a set of useful command-line options that can be used to configure a pass manager.

The values of these options can be applied via the 'applyPassManagerCLOptions' method below.

Definition at line 140 of file PassManagerOptions.cpp.

References options.

Referenced by registerAndParseCLIOptions().

◆ registerPassPipeline()

void mlir::registerPassPipeline ( StringRef  arg,
StringRef  description,
const PassRegistryFunction function,
std::function< void(function_ref< void(const detail::PassOptions &)>)>  optHandler 
)

Register a specific dialect pipeline registry function with the system, typically used through the PassPipelineRegistration template.

Referenced by mlir::PassPipelineRegistration< EmptyPipelineOptions >::PassPipelineRegistration(), and mlir::PassPipelineRegistration< Options >::PassPipelineRegistration().

◆ registerROCDLDialectTranslation() [1/2]

void mlir::registerROCDLDialectTranslation ( DialectRegistry registry)

Register the ROCDL dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 243 of file ROCDLToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerROCDLDialectTranslation().

◆ registerROCDLDialectTranslation() [2/2]

void mlir::registerROCDLDialectTranslation ( MLIRContext context)

Register the ROCDL dialect and the translation from it in the registry associated with the given context.

Definition at line 250 of file ROCDLToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerROCDLDialectTranslation().

◆ registerSPIRVDialectTranslation() [1/2]

void mlir::registerSPIRVDialectTranslation ( DialectRegistry registry)

Register the SPIR-V dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 23 of file SPIRVToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::insert().

Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerSPIRVDialectTranslation().

◆ registerSPIRVDialectTranslation() [2/2]

void mlir::registerSPIRVDialectTranslation ( MLIRContext context)

Register the SPIR-V dialect and the translation from it in the registry associated with the given context.

Definition at line 27 of file SPIRVToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerSPIRVDialectTranslation().

◆ registerTestRoundtripDebugSPIRV()

void mlir::registerTestRoundtripDebugSPIRV ( )

Definition at line 137 of file TranslateRegistration.cpp.

References roundTripModule().

◆ registerTestRoundtripSPIRV()

void mlir::registerTestRoundtripSPIRV ( )

Definition at line 126 of file TranslateRegistration.cpp.

References roundTripModule().

◆ registerToCppTranslation()

void mlir::registerToCppTranslation ( )

Definition at line 26 of file TranslateRegistration.cpp.

References mlir::emitc::translateToCpp().

Referenced by registerAllTranslations().

◆ registerToLLVMIRTranslation()

void mlir::registerToLLVMIRTranslation ( )

◆ registerToSPIRVTranslation()

void mlir::registerToSPIRVTranslation ( )

Definition at line 86 of file TranslateRegistration.cpp.

References serializeModule().

Referenced by registerAllTranslations().

◆ registerTranslationCLOptions()

void mlir::registerTranslationCLOptions ( )

Register command-line options used by the translation registry.

Definition at line 39 of file Translation.cpp.

References clOptions.

◆ registerVCIXDialectTranslation() [1/2]

void mlir::registerVCIXDialectTranslation ( DialectRegistry registry)

Register the VCIX dialect and the translation from it to the LLVM IR in the given registry.

Definition at line 77 of file VCIXToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerVCIXDialectTranslation().

◆ registerVCIXDialectTranslation() [2/2]

void mlir::registerVCIXDialectTranslation ( MLIRContext context)

Register the VCIX dialect and the translation from it in the registry associated with the given context.

Definition at line 84 of file VCIXToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerVCIXDialectTranslation().

◆ registerX86VectorDialectTranslation() [1/2]

void mlir::registerX86VectorDialectTranslation ( DialectRegistry registry)

Register the X86Vector dialect and the translation from it to the LLVM IR in the given registry;.

Definition at line 46 of file X86VectorToLLVMIRTranslation.cpp.

References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().

Referenced by registerAllToLLVMIRTranslations(), and registerX86VectorDialectTranslation().

◆ registerX86VectorDialectTranslation() [2/2]

void mlir::registerX86VectorDialectTranslation ( MLIRContext context)

Register the X86Vector dialect and the translation from it in the registry associated with the given context.

Definition at line 54 of file X86VectorToLLVMIRTranslation.cpp.

References mlir::MLIRContext::appendDialectRegistry(), and registerX86VectorDialectTranslation().

◆ reifyResultShapes()

LogicalResult mlir::reifyResultShapes ( OpBuilder b,
Operation op,
ReifiedRankedShapedTypeDims reifiedReturnShapes 
)

◆ removeDuplicateExprs()

AffineMap mlir::removeDuplicateExprs ( AffineMap  map)

Returns a map with the same dimension and symbol count as map, but whose results are the unique affine expressions of map.

Definition at line 783 of file AffineMap.cpp.

References mlir::AffineMap::get(), mlir::AffineMap::getContext(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumSymbols(), and mlir::AffineMap::getResults().

Referenced by canonicalizeLoopBounds(), and mlir::affine::createCanonicalizedAffineForOp().

◆ replaceAllUsesInRegionWith()

void mlir::replaceAllUsesInRegionWith ( Value  orig,
Value  replacement,
Region region 
)

Replace all uses of orig within the given region with replacement.

Definition at line 32 of file RegionUtils.cpp.

References mlir::Value::getUses(), and mlir::Region::isAncestor().

Referenced by mlir::async::cloneConstantsIntoTheRegion(), mlir::affine::coalesceLoops(), collapseParallelLoops(), sinkOperationsIntoLaunchOp(), and stripmineSink().

◆ replaceLoopNestWithNewYields()

SmallVector< scf::ForOp > mlir::replaceLoopNestWithNewYields ( RewriterBase rewriter,
MutableArrayRef< scf::ForOp >  loopNest,
ValueRange  newIterOperands,
const NewYieldValuesFn newYieldValuesFn,
bool  replaceIterOperandsUsesInLoop = true 
)

Update a perfectly nested loop nest to yield new values from the innermost loop and propagating it up through the loop nest.

This function

  • Expects loopNest to be a perfectly nested loop with outer most loop first and innermost loop last.
  • newIterOperands are the initialization values to be used for the outermost loop
  • newYielValueFn is the callback that generates the new values to be yielded from within the innermost loop.
  • The original loops are not erased, but are left in a "no-op" state where the body of the loop just yields the basic block arguments that correspond to the initialization values of a loop. The original loops are dead after this method.
  • If replaceIterOperandsUsesInLoop is true, all uses of the newIterOperands within the generated new loop are replaced with the corresponding BlockArgument in the loop body.

Definition at line 40 of file Utils.cpp.

◆ reshapeLikeShapesAreCompatible()

LogicalResult mlir::reshapeLikeShapesAreCompatible ( function_ref< LogicalResult(const Twine &)>  emitError,
ArrayRef< int64_t >  collapsedShape,
ArrayRef< int64_t >  expandedShape,
ArrayRef< ReassociationIndices reassociationMaps,
bool  isExpandingReshape 
)

Verify that shapes of the reshaped types using following rule: if a dimension in the collapsed type is static, then the corresponding dimensions in the expanded shape should be a) static b) the product should be same as the collaped shape.

Definition at line 227 of file ReshapeOpsUtils.cpp.

References emitError(), and mlir::detail::enumerate().

Referenced by verifyReshapeLikeTypes().

◆ runRegionDCE()

LogicalResult mlir::runRegionDCE ( RewriterBase rewriter,
MutableArrayRef< Region regions 
)

This function returns success if any operations or arguments were deleted, failure otherwise.

Definition at line 470 of file RegionUtils.cpp.

References deleteDeadness(), and propagateLiveness().

Referenced by simplifyRegions().

◆ setupDebuggerExecutionContextHook()

void mlir::setupDebuggerExecutionContextHook ( tracing::ExecutionContext executionContext)

◆ simplifyAffineExpr()

AffineExpr mlir::simplifyAffineExpr ( AffineExpr  expr,
unsigned  numDims,
unsigned  numSymbols 
)

Simplify an affine expression by flattening and some amount of simple analysis.

Simplify the affine expression by flattening it and reconstructing it.

This has complexity linear in the number of nodes in 'expr'. Returns the simplified expression, which is the same as the input expression if it can't be simplified. When expr is semi-affine, a simplified semi-affine expression is constructed in the sorted order of dimension and symbol positions.

Definition at line 1566 of file AffineExpr.cpp.

References getAffineExprFromFlatForm(), mlir::AffineExpr::getContext(), getSemiAffineExprFromFlatForm(), mlir::AffineExpr::isPureAffine(), mlir::SimpleAffineExprFlattener::localExprs, mlir::SimpleAffineExprFlattener::operandExprStack, simplifySemiAffine(), and mlir::AffineExprVisitor< SubClass, RetTy >::walkPostOrder().

Referenced by createPrivateMemRef(), getConstDifference(), mlir::FlatLinearConstraints::getSliceBounds(), isModOfModSubtraction(), makeCanonicalStridedLayoutExpr(), mlir::affine::reorderOperandsByHoistability(), mlir::MutableAffineMap::simplify(), and simplifyAffineMap().

◆ simplifyAffineMap()

AffineMap mlir::simplifyAffineMap ( AffineMap  map)

◆ simplifyRegions()

LogicalResult mlir::simplifyRegions ( RewriterBase rewriter,
MutableArrayRef< Region regions,
bool  mergeBlocks = true 
)

Run a set of structural simplifications over the given regions.

This includes transformations like unreachable block elimination, dead argument elimination, as well as some other DCE. This function returns success if any of the regions were simplified, failure otherwise. The provided rewriter is used to notify callers of operation and block deletion. Structurally similar blocks will be merged if the mergeBlock argument is true. Note this can lead to merged blocks with extra arguments.

This includes transformations like unreachable block elimination, dead argument elimination, as well as some other DCE. This function returns success if any of the regions were simplified, failure otherwise.

Definition at line 1042 of file RegionUtils.cpp.

References dropRedundantArguments(), eraseUnreachableBlocks(), mergeIdenticalBlocks(), and runRegionDCE().

◆ sinkOperationsIntoLaunchOp()

LogicalResult mlir::sinkOperationsIntoLaunchOp ( gpu::LaunchOp  launchOp,
llvm::function_ref< bool(Operation *)>  isSinkingBeneficiary 
)

Sink operations into the launchOp to reduce the number of values that are used within the region of the operation, but defined outside of the region.

Definition at line 123 of file KernelOutlining.cpp.

References mlir::OpBuilder::clone(), extractBeneficiaryOps(), mlir::Operation::getResults(), getUsedValuesDefinedAbove(), and replaceAllUsesInRegionWith().

◆ sortTopologically() [1/2]

bool mlir::sortTopologically ( Block block,
function_ref< bool(Value, Operation *)>  isOperandReady = nullptr 
)

Given a block, sort its operations in topological order, excluding its terminator if it has one.

This sort is stable.

Definition at line 102 of file TopologicalSortUtils.cpp.

References mlir::Block::back(), mlir::Block::empty(), mlir::Operation::hasTrait(), sortTopologically(), and mlir::Block::without_terminator().

◆ sortTopologically() [2/2]

bool mlir::sortTopologically ( Block block,
iterator_range< Block::iterator ops,
function_ref< bool(Value, Operation *)>  isOperandReady = nullptr 
)

Given a block, sort a range operations in said block in topological order.

The main purpose is readability of graph regions, potentially faster processing of certain transformations and analyses, or fixing the SSA dominance of blocks that require it after transformations. The function sorts the given operations such that, as much as possible, all users appear after their producers.

For example:

%0 = test.foo
%1 = test.bar %0, %2
%2 = test.baz

Will become:

%0 = test.foo
%1 = test.baz
%2 = test.bar %0, %1

The sort also works on operations with regions and implicit captures. For example:

%0 = test.foo {
test.baz %1
%1 = test.bar %2
}
%2 = test.foo

Will become:

%0 = test.foo
%1 = test.foo {
test.baz %2
%2 = test.bar %0
}

Note that the sort is not recursive on nested regions. This sort is stable; if the operations are already topologically sorted, nothing changes.

Operations that form cycles are moved to the end of the block in order. If the sort is left with only operations that form a cycle, it breaks the cycle by marking the first encountered operation as ready and moving on.

The function optionally accepts a callback that can be provided by users to virtually break cycles early. It is called on top-level operations in the block with value uses at or below those operations. The function should return true to mark that value as ready to be scheduled.

For example, if isOperandReady is set to always mark edges from foo.A to foo.B as ready, these operations:

%0 = foo.B(%1)
%1 = foo.C(%2)
%2 = foo.A(%0)

Are sorted as:

%0 = foo.A(%2)
%1 = foo.C(%0)
%2 = foo.B(%1)

Definition at line 56 of file TopologicalSortUtils.cpp.

References isOpReady(), and mlir::Operation::moveBefore().

Referenced by sortTopologically().

◆ splitAndProcessBuffer()

LogicalResult mlir::splitAndProcessBuffer ( std::unique_ptr< llvm::MemoryBuffer >  originalBuffer,
ChunkBufferHandler  processChunkBuffer,
raw_ostream &  os,
llvm::StringRef  inputSplitMarker = kDefaultSplitMarker,
llvm::StringRef  outputSplitMarker = "" 
)

Splits the specified buffer on a marker (// ----- by default), processes each chunk independently according to the normal processChunkBuffer logic, and writes all results to os.

This is used to allow a large number of small independent tests to be put into a single file. The input split marker is configurable. If it is empty, merging is disabled, which allows for merging split and non-split code paths. Output split markers (//----- by default) followed by a new line character, respectively, are placed between each of the processed output chunks. (The new line character is inserted even if the split marker is empty.)

Definition at line 21 of file ToolUtilities.cpp.

◆ storageClassToAddressSpace()

unsigned mlir::storageClassToAddressSpace ( spirv::ClientAPI  clientAPI,
spirv::StorageClass  storageClass 
)

Definition at line 51 of file AttrToLLVMConverter.cpp.

References mlir::gpu::amd::OpenCL.

Referenced by convertPointerType().

◆ structFuncArgTypeConverter()

LogicalResult mlir::structFuncArgTypeConverter ( const LLVMTypeConverter converter,
Type  type,
SmallVectorImpl< Type > &  result 
)

Callback to convert function argument types.

Give structFuncArgTypeConverter access to memref-specific functions.

It converts a MemRef function argument to a list of non-aggregate types containing descriptor information, and an UnrankedmemRef function argument to a list containing the rank and a pointer to a descriptor struct.

Definition at line 732 of file TypeConverter.cpp.

References mlir::LLVMTypeConverter::convertType().

◆ TableGenLspServerMain()

LogicalResult mlir::TableGenLspServerMain ( int  argc,
char **  argv 
)

◆ thread_safe_nulls()

llvm::raw_ostream & mlir::thread_safe_nulls ( )

Returns a raw output stream that simply discards the output, but in a thread-safe manner.

Similar to llvm::nulls.

Definition at line 12 of file RawOstreamExtras.cpp.

◆ tile() [1/2]

SmallVector< Loops, 8 > mlir::tile ( ArrayRef< scf::ForOp >  forOps,
ArrayRef< Value sizes,
ArrayRef< scf::ForOp >  targets 
)

Performs tiling fo imperfectly nested loops (with interchange) by strip-mining the forOps by sizes and sinking them, in their order of occurrence in forOps, under each of the targets.

Returns the new AffineForOps, one per each of (forOps, targets) pair, nested immediately under each of targets.

Definition at line 1282 of file Utils.cpp.

References stripmineSink().

Referenced by areTilesAndTiledDimsAllConstant(), commonVerifierPackAndUnPackOp(), extractFixedOuterLoops(), mlir::linalg::pack(), and tile().

◆ tile() [2/2]

Loops mlir::tile ( ArrayRef< scf::ForOp >  forOps,
ArrayRef< Value sizes,
scf::ForOp  target 
)

Performs tiling (with interchange) by strip-mining the forOps by sizes and sinking them, in their order of occurrence in forOps, under target.

Returns the new AffineForOps, one per forOps, nested immediately under target.

Definition at line 1295 of file Utils.cpp.

References tile().

◆ tilePerfectlyNested()

Loops mlir::tilePerfectlyNested ( scf::ForOp  rootForOp,
ArrayRef< Value sizes 
)

Tile a nest of scf::ForOp loops rooted at rootForOp with the given (parametric) sizes.

Sizes are expected to be strictly positive values at runtime. If more sizes than loops are provided, discard the trailing values in sizes. Assumes the loop nest is permutable. Returns the newly created intra-tile loops.

Definition at line 1305 of file Utils.cpp.

References getPerfectlyNestedLoopsImpl(), and mlir::affine::tile().

◆ topologicalSort()

SetVector< Operation * > mlir::topologicalSort ( const SetVector< Operation * > &  toSort)

Sorts all operations in toSort topologically while also considering region semantics.

Does not support multi-sets.

Definition at line 283 of file TopologicalSortUtils.cpp.

Referenced by destructureSlot(), getConsumerFromLoopUses(), getOpToConvert(), getSlice(), and promoteSingleIterReductionLoop().

◆ toString()

StringRef mlir::toString ( AsmResourceEntryKind  kind)

◆ trailingNDimsContiguous()

bool mlir::trailingNDimsContiguous ( MemRefType  type,
int64_t  n 
)

Return "true" if the last N dimensions of the given type are contiguous.

Examples:

  • memref<5x4x3x2xi8, strided<[24, 6, 2, 1]> is contiguous when considering both all and only the trailing 3 dims,
  • memref<5x4x3x2xi8, strided<[48, 6, 2, 1]> is only contiguous when considering the trailing 3 dims.

Definition at line 968 of file BuiltinTypes.cpp.

References getStridesAndOffset(), and isLastMemrefDimUnitStride().

Referenced by mlir::vector::isContiguousSlice().

◆ transformCFGToSCF()

FailureOr< bool > mlir::transformCFGToSCF ( Region region,
CFGToSCFInterface interface,
DominanceInfo dominanceInfo 
)

Transformation lifting any dialect implementing control flow graph operations to a dialect implementing structured control flow operations.

region is the region that should be transformed. The implementation of interface is responsible for the conversion of the control flow operations to the structured control flow operations.

If the region contains only a single kind of return-like operation, all control flow graph operations will be converted successfully. Otherwise a single control flow graph operation branching to one block per return-like operation kind remains.

The transformation currently requires that all control flow graph operations have no side effects, implement the BranchOpInterface and does not have any operation produced successor operands. Returns failure if any of the preconditions are violated or if any of the methods of interface failed. The IR is left in an unspecified state.

Otherwise, returns true or false if any changes to the IR have been made.

Definition at line 1276 of file CFGToSCF.cpp.

References mlir::OpBuilder::atBlockBegin(), checkTransformationPreconditions(), createSingleExitBlocksForReturnLike(), mlir::Region::empty(), mlir::Region::front(), mlir::CFGToSCFInterface::getCFGSwitchValue(), mlir::Region::getLoc(), mlir::Block::getParent(), mlir::CFGToSCFInterface::getUndefValue(), mlir::Region::hasOneBlock(), mlir::detail::DominanceInfoBase< IsPostDom >::invalidate(), transformCyclesToSCFLoops(), and transformToStructuredCFBranches().

◆ translateDataLayout()

DataLayoutSpecInterface mlir::translateDataLayout ( const llvm::DataLayout &  dataLayout,
MLIRContext context 
)

Translate the given LLVM data layout into an MLIR equivalent using the DLTI dialect.

Definition at line 327 of file DataLayoutImporter.cpp.

References mlir::LLVM::detail::DataLayoutImporter::getDataLayout().

◆ translateLLVMIRToModule()

OwningOpRef< ModuleOp > mlir::translateLLVMIRToModule ( std::unique_ptr< llvm::Module >  llvmModule,
MLIRContext context,
bool  emitExpensiveWarnings = true,
bool  dropDICompositeTypeElements = false 
)

Translates the LLVM module into an MLIR module living in the given context.

The translation supports operations from any dialect that has a registered implementation of the LLVMImportDialectInterface. It returns nullptr if the translation fails and reports errors using the error handler registered with the MLIR context. The emitExpensiveWarnings option controls if expensive but uncritical diagnostics should be emitted. The dropDICompositeTypeElements option controls if DICompositeTypes should be imported without elements. If set, the option avoids the recursive traversal of composite type debug information, which can be expensive for adversarial inputs.

Definition at line 2293 of file ModuleImport.cpp.

References mlir::LLVM::ModuleImport::convertComdats(), mlir::LLVM::ModuleImport::convertDataLayout(), mlir::LLVM::ModuleImport::convertFunctions(), mlir::LLVM::ModuleImport::convertGlobals(), mlir::LLVM::ModuleImport::convertMetadata(), mlir::OwningOpRef< OpTy >::get(), get(), mlir::FileLineColLoc::get(), mlir::MLIRContext::getAvailableDialects(), mlir::LLVM::ModuleImport::initializeImportInterface(), and mlir::MLIRContext::loadAllAvailableDialects().

Referenced by registerFromLLVMIRTranslation().

◆ translateModuleToLLVMIR()

std::unique_ptr<llvm::Module> mlir::translateModuleToLLVMIR ( Operation module,
llvm::LLVMContext &  llvmContext,
llvm::StringRef  name = "LLVMDialectModule",
bool  disableVerification = false 
)

Translates a given LLVM dialect module into an LLVM IR module living in the given context.

Operates on any operation from dialects that provide a registered implementation of the LLVMTranslationDialectInterface. Returns nullptr when the translation fails. Verifies the produced LLVM module, except when disableVerification is set.

Referenced by mlirTranslateModuleToLLVMIR(), registerToLLVMIRTranslation(), and mlir::LLVM::ModuleToObject::translateToLLVMIR().

◆ tryToDestructureMemorySlots()

LogicalResult mlir::tryToDestructureMemorySlots ( ArrayRef< DestructurableAllocationOpInterface >  allocators,
OpBuilder builder,
const DataLayout dataLayout,
SROAStatistics  statistics = {} 
)

Attempts to destructure the slots of destructurable allocators.

Iteratively retries the destructuring of all slots as destructuring one slot might enable subsequent destructuring. Returns failure if no slot was destructured.

Definition at line 198 of file SROA.cpp.

References computeDestructuringInfo(), and destructureSlot().

◆ tryToPromoteMemorySlots()

LogicalResult mlir::tryToPromoteMemorySlots ( ArrayRef< PromotableAllocationOpInterface >  allocators,
OpBuilder builder,
const DataLayout dataLayout,
DominanceInfo dominance,
Mem2RegStatistics  statistics = {} 
)

Attempts to promote the memory slots of the provided allocators.

Iteratively retries the promotion of all slots as promoting one slot might enable subsequent promotions. Succeeds if at least one memory slot was promoted.

Definition at line 644 of file Mem2Reg.cpp.

References mlir::MemorySlot::ptr, and mlir::Value::use_empty().

◆ verify()

LogicalResult mlir::verify ( Operation op,
bool  verifyRecursively = true 
)

◆ verifyCompatibleDims()

LogicalResult mlir::verifyCompatibleDims ( ArrayRef< int64_t >  dims)

Dimensions are compatible if all non-dynamic dims are equal.

Definition at line 104 of file TypeUtilities.cpp.

Referenced by verifyCompatibleShapes().

◆ verifyCompatibleShape() [1/2]

LogicalResult mlir::verifyCompatibleShape ( ArrayRef< int64_t >  shape1,
ArrayRef< int64_t >  shape2 
)

Returns success if the given two shapes are compatible.

That is, they have the same size and each pair of the elements are equal or one of them is dynamic.

Definition at line 58 of file TypeUtilities.cpp.

Referenced by verifyCompatibleShape(), verifyCompatibleShapes(), and mlir::OpTrait::impl::verifySameOperandsAndResultType().

◆ verifyCompatibleShape() [2/2]

LogicalResult mlir::verifyCompatibleShape ( Type  type1,
Type  type2 
)

Returns success if the given two types have compatible shape.

That is, they are both scalars (not shaped), or they are both shaped types and at least one is unranked or they have compatible dimensions. Dimensions are compatible if at least one is dynamic or both are equal. The element type does not matter.

Definition at line 77 of file TypeUtilities.cpp.

References verifyCompatibleShape().

◆ verifyCompatibleShapes() [1/2]

LogicalResult mlir::verifyCompatibleShapes ( TypeRange  types)

Returns success if all given types have compatible shapes.

That is, they are all scalars (not shaped), or they are all shaped types and any ranked shapes have compatible dimensions. The element type does not matter.

That is, they are all scalars (not shaped), or they are all shaped types and any ranked shapes have compatible dimensions. Dimensions are compatible if all non-dynamic dims are equal. The element type does not matter.

Definition at line 120 of file TypeUtilities.cpp.

References verifyCompatibleDims().

◆ verifyCompatibleShapes() [2/2]

LogicalResult mlir::verifyCompatibleShapes ( TypeRange  types1,
TypeRange  types2 
)

Returns success if the given two arrays have the same number of elements and each pair wise entries have compatible shape.

Definition at line 95 of file TypeUtilities.cpp.

References verifyCompatibleShape().

Referenced by areValidCastInputsAndOutputs(), mlir::OpTrait::impl::verifyElementwise(), mlir::OpTrait::impl::verifySameOperandsAndResultShape(), and mlir::OpTrait::impl::verifySameOperandsShape().

◆ verifyListOfOperandsOrIntegers()

LogicalResult mlir::verifyListOfOperandsOrIntegers ( Operation op,
StringRef  name,
unsigned  expectedNumElements,
ArrayRef< int64_t >  attr,
ValueRange  values 
)

Verify that a the values has as many elements as the number of entries in attr for which isDynamic evaluates to true.

Include the definitions of the loop-like interfaces.

Definition at line 20 of file ViewLikeInterface.cpp.

References mlir::Operation::emitError().

Referenced by mlir::detail::verifyOffsetSizeAndStrideOp().

◆ verifyReshapeLikeTypes()

template<typename Op , typename T >
static LogicalResult mlir::verifyReshapeLikeTypes ( Op  op,
expandedType,
collapsedType,
bool  isExpansion 
)
static

Common verifier for reshape-like types.

Fills expandedType and collapsedType with the proper src or result type.

Definition at line 137 of file ReshapeOpsUtils.h.

References mlir::OpState::emitOpError(), mlir::detail::enumerate(), isReassociationValid(), and reshapeLikeShapesAreCompatible().

Referenced by verifyTensorReshapeOp().

◆ visitUsedValuesDefinedAbove() [1/2]

void mlir::visitUsedValuesDefinedAbove ( MutableArrayRef< Region regions,
function_ref< void(OpOperand *)>  callback 
)

Calls callback for each use of a value within any of the regions provided that was defined in one of the ancestors.

Definition at line 61 of file RegionUtils.cpp.

References visitUsedValuesDefinedAbove().

◆ visitUsedValuesDefinedAbove() [2/2]

void mlir::visitUsedValuesDefinedAbove ( Region region,
Region limit,
function_ref< void(OpOperand *)>  callback 
)

Calls callback for each use of a value within region or its descendants that was defined at the ancestors of the limit.

Definition at line 40 of file RegionUtils.cpp.

References mlir::Operation::getOpOperands(), mlir::Region::getParentRegion(), mlir::Region::isAncestor(), and mlir::Region::walk().

Referenced by getUsedValuesDefinedAbove(), isOpSibling(), and visitUsedValuesDefinedAbove().

◆ walkAndApplyPatterns()

void mlir::walkAndApplyPatterns ( Operation op,
const FrozenRewritePatternSet patterns,
RewriterBase::Listener listener = nullptr 
)

A fast walk-based pattern rewrite driver.

Rewrites ops nested under the given operation by walking it and applying the highest benefit patterns. This rewriter does not wait until a fixpoint is reached and does not visit modified or newly replaced ops. Also does not perform folding or dead-code elimination.

This is intended as the simplest and most lightweight pattern rewriter in cases when a simple walk gets the job done.

Note: Does not apply patterns to the given operation itself.

Definition at line 71 of file WalkPatternRewriteDriver.cpp.

References mlir::PatternApplicator::applyDefaultCostModel(), mlir::MLIRContext::executeAction(), mlir::Operation::getContext(), mlir::Operation::getRegions(), mlir::PatternApplicator::matchAndRewrite(), patterns, mlir::Operation::print(), mlir::OpBuilder::setListener(), and verify().

◆ walkSlice()

WalkContinuation mlir::walkSlice ( mlir::ValueRange  rootValues,
WalkCallback  walkCallback 
)

Walks the slice starting from the rootValues using a depth-first traversal.

The walk calls the provided walkCallback for each value encountered in the slice and uses the returned walk continuation to determine how to proceed.

Definition at line 6 of file SliceWalk.cpp.

References mlir::WalkContinuation::getNextValues(), mlir::WalkContinuation::skip(), mlir::WalkContinuation::wasAdvancedTo(), mlir::WalkContinuation::wasInterrupted(), and mlir::WalkContinuation::wasSkipped().

Referenced by getUnderlyingObjectSet().

◆ wouldOpBeTriviallyDead()

bool mlir::wouldOpBeTriviallyDead ( Operation op)

Return true if the given operation would be dead if unused, and has no side effects on memory that would prevent erasing.

This is equivalent to checking isOpTriviallyDead if op was unused.

Note: Terminators and symbols are never considered to be trivially dead.

Definition at line 301 of file SideEffectInterfaces.cpp.

References mlir::Operation::mightHaveTrait(), and wouldOpBeTriviallyDeadImpl().

Referenced by isOpTriviallyDead(), propagateLiveness(), and rewrite().

◆ writeBytecodeToFile()

LogicalResult mlir::writeBytecodeToFile ( Operation op,
raw_ostream &  os,
const BytecodeWriterConfig config = {} 
)

Write the bytecode for the given operation to the provided output stream.

For streams where it matters, the given stream should be in "binary" mode. It only ever fails if setDesiredByteCodeVersion can't be honored.

Definition at line 1345 of file BytecodeWriter.cpp.

References config.

Referenced by doVerifyRoundTrip(), mlirOperationWriteBytecode(), mlirOperationWriteBytecodeWithConfig(), and performActions().

Variable Documentation

◆ changed

const FrozenRewritePatternSet GreedyRewriteConfig bool* mlir::changed = nullptr

◆ config

Definition at line 234 of file GreedyPatternRewriteDriver.h.

Referenced by mlir::affine::affineForOpBodySkew(), applyAnalysisConversion(), applyFullConversion(), applyOpPatternsGreedily(), applyPartialConversion(), applyPatterns(), applyPatternsAndFoldGreedily(), applyPatternsGreedily(), mlir::transform::TransformState::applyTransform(), mlir::PassReproducerOptions::attachResourceParser(), mlir::BytecodeReader::BytecodeReader(), compileAndExecute(), compileAndExecuteSingleReturnFunction(), compileAndExecuteVoidFunction(), createCanonicalizerPass(), doVerifyRoundTrip(), mlir::PassManager::enableIRPrinting(), mlir::bufferization::AnalysisState::findDefinitions(), mlir::transform::TrackingListener::findReplacementOp(), mlir::bufferization::AnalysisState::findValueInReverseUseDefChain(), mlir::bytecode::detail::IRNumberingState::getDesiredBytecodeVersion(), mlir::affine::hoistAffineIfOp(), mlir::tracing::InstallDebugHandler::Impl::Impl(), mlir::Inliner::Inliner(), mlirBytecodeWriterConfigDestroy(), mlirOperationWriteBytecodeWithConfig(), MlirOptMain(), mlir::OperationConverter::OperationConverter(), parseAffineMapOrIntegerSet(), parseAsmSourceFile(), parseSourceFile(), mlir::detail::parseSourceFile(), parseSourceFileForTool(), parseSourceString(), parseSymbol(), performActions(), processParallelLoop(), readBytecodeFile(), readBytecodeFileImpl(), mlir::MlirOptMainConfig::setDebugConfig(), mlir::spirv::unrollVectorsInSignatures(), mlir::python::PyOperationBase::writeBytecode(), and writeBytecodeToFile().

◆ has_sub_attr_or_type_v

template<typename... Ts>
constexpr bool mlir::has_sub_attr_or_type_v
inlineconstexpr
Initial value:
=
(!llvm::is_detected<detail::has_default_sub_element_handler_t, Ts>::value ||
...)

Definition at line 417 of file AttrTypeSubElements.h.

Referenced by mlir::detail::replaceImmediateSubElementsImpl(), and mlir::detail::walkImmediateSubElementsImpl().

◆ kDefaultSplitMarker

const char* const mlir::kDefaultSplitMarker = "// -----"
externinline

◆ kDeriveIndexBitwidthFromDataLayout

constexpr unsigned mlir::kDeriveIndexBitwidthFromDataLayout = 0
staticconstexpr

Value to pass as bitwidth for the index type when the converter is expected to derive the bitwidth from the LLVM data layout.

Definition at line 26 of file LoweringOptions.h.

Referenced by mlir::LowerToLLVMOptions::overrideIndexBitwidth().

◆ patterns

const FrozenRewritePatternSet& mlir::patterns

Definition at line 233 of file GreedyPatternRewriteDriver.h.

Referenced by mlir::affine::affineForOpBodySkew(), applyAnalysisConversion(), applyFullConversion(), applyOpPatternsGreedily(), applyPartialConversion(), applyPartialOneToNConversion(), applyPatterns(), applyPatternsAndFoldGreedily(), applyPatternsGreedily(), findOptimal(), mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(), mlir::linalg::getLinalgTilingCanonicalizationPatterns(), mlir::affine::hoistAffineIfOp(), mlirApplyPatternsAndFoldGreedily(), mlir::affine::populateAffineExpandIndexOpsAsAffinePatterns(), mlir::affine::populateAffineExpandIndexOpsPatterns(), populateAffineToStdConversionPatterns(), populateAffineToVectorConversionPatterns(), mlir::mesh::populateAllOpLoweringPatterns(), mlir::mesh::populateAllReduceEndomorphismSimplificationPatterns(), mlir::mesh::populateAllSliceOpLoweringPatterns(), mlir::amdgpu::populateAmdgpuEmulateAtomicsPatterns(), populateAMDGPUToROCDLConversionPatterns(), populateAMXLegalizeForLLVMExportPatterns(), populateAnyFunctionOpInterfaceTypeConversionPattern(), mlir::arith::populateArithExpandOpsPatterns(), mlir::arith::populateArithNarrowTypeEmulationPatterns(), mlir::arith::populateArithToAMDGPUConversionPatterns(), mlir::arith::populateArithToArmSMEConversionPatterns(), populateArithToEmitCPatterns(), mlir::arith::populateArithToLLVMConversionPatterns(), mlir::arith::populateArithToSPIRVPatterns(), mlir::arith::populateArithWideIntEmulationPatterns(), populateArmSMEToLLVMConversionPatterns(), populateArmSMEToSCFConversionPatterns(), populateArmSVELegalizeForLLVMExportPatterns(), mlir::cf::populateAssertToLLVMConversionPattern(), populateAsyncFuncToAsyncRuntimeConversionPatterns(), mlir::async::populateAsyncParallelForPatterns(), populateAsyncStructuralTypeConversionsAndLegality(), mlir::linalg::populateBlockPackMatmulPatterns(), mlir::vector::populateBreakDownVectorReductionPatterns(), mlir::tensor::populateBubbleUpExpandShapePatterns(), mlir::linalg::populateBubbleUpExtractSliceOpPatterns(), mlir::vector::populateBubbleVectorBitCastOpPatterns(), mlir::bufferization::populateBufferizationDeallocLoweringPattern(), populateBuiltinFuncToSPIRVPatterns(), populateCallOpTypeConversionPattern(), mlir::vector::populateCastAwayVectorLeadingOneDimPatterns(), mlir::arith::populateCeilFloorDivExpandOpsPatterns(), mlir::vector::populateChainedVectorReductionFoldingPatterns(), mlir::linalg::populateCollapseDimensions(), populateCommutativityUtilsPatterns(), populateComplexToLibmConversionPatterns(), populateComplexToLLVMConversionPatterns(), populateComplexToSPIRVPatterns(), populateComplexToStandardConversionPatterns(), mlir::memref::populateComposeSubViewPatterns(), mlir::linalg::populateConstantFoldLinalgOperations(), mlir::linalg::populateContractionOpRankReducingPatterns(), mlir::cf::populateControlFlowToLLVMConversionPatterns(), mlir::cf::populateControlFlowToSPIRVPatterns(), populateConversionTargetFromOperation(), populateConvertArmNeon2dToIntrPatterns(), mlir::linalg::populateConvertConv2DToImg2ColPatterns(), populateConvertShapeConstraintsConversionPatterns(), mlir::linalg::populateConvertToDestinationStylePatterns(), mlir::linalg::populateConvolutionVectorizationPatterns(), mlir::linalg::populateDataLayoutPropagationPatterns(), mlir::bufferization::populateDeallocOpCanonicalizationPatterns(), mlir::linalg::populateDecomposeConvolutionPatterns(), mlir::linalg::populateDecomposeLinalgOpsPattern(), mlir::linalg::populateDecomposePackUnpackPatterns(), mlir::linalg::populateDecomposePadPatterns(), mlir::linalg::populateDecomposeProjectedPermutationPatterns(), mlir::tensor::populateDecomposeTensorConcatPatterns(), mlir::linalg::populateDecomposeWinogradOpsPatterns(), mlir::tensor::populateDropRedundantInsertSliceRankExpansionPatterns(), mlir::vector::populateDropUnitDimWithShapeCastPatterns(), mlir::linalg::populateElementwiseOpsFusionPatterns(), mlir::linalg::populateElementwiseToLinalgConversionPatterns(), mlir::vector::populateElementwiseToVectorOpsPatterns(), mlir::bufferization::populateEmptyTensorToAllocTensorPattern(), mlir::arith::populateEmulateUnsupportedFloatsPatterns(), mlir::linalg::populateEraseUnnecessaryInputsPatterns(), mlir::linalg::populateEraseUnusedOperandsAndResultsPatterns(), populateExpandAcoshPattern(), populateExpandAsinhPattern(), populateExpandAtanhPattern(), mlir::arith::populateExpandBFloat16Patterns(), populateExpandCeilFPattern(), populateExpandCoshPattern(), populateExpandCtlzPattern(), populateExpandExp2FPattern(), populateExpandFloorFPattern(), populateExpandFmaFPattern(), populateExpandFPowIPattern(), mlir::memref::populateExpandOpsPatterns(), populateExpandPowFPattern(), mlir::memref::populateExpandReallocPatterns(), populateExpandRoundEvenPattern(), populateExpandRoundFPattern(), populateExpandRsqrtPattern(), populateExpandSinhPattern(), populateExpandTanhPattern(), populateExpandTanPattern(), mlir::emitc::populateExpressionPatterns(), mlir::math::populateExtendToSupportedTypesPatterns(), mlir::memref::populateExtractAddressComputationsPatterns(), populateFinalizeMemRefToLLVMConversionPatterns(), mlir::vector::populateFlattenVectorTransferPatterns(), mlir::linalg::populateFoldAddIntoDestPatterns(), mlir::vector::populateFoldArithExtensionPatterns(), mlir::tensor::populateFoldConstantExtractSlicePatterns(), mlir::mesh::populateFoldingPatterns(), mlir::tensor::populateFoldIntoPackAndUnpackPatterns(), mlir::memref::populateFoldMemRefAliasOpPatterns(), mlir::linalg::populateFoldReshapeOpsByCollapsingPatterns(), mlir::linalg::populateFoldReshapeOpsByExpansionPatterns(), mlir::tensor::populateFoldTensorEmptyPatterns(), mlir::tensor::populateFoldTensorSubsetIntoVectorTransferPatterns(), mlir::tensor::populateFoldTensorSubsetOpPatterns(), mlir::linalg::populateFoldUnitExtentDimsPatterns(), populateFoldUnitExtentDimsViaReshapesPatterns(), populateFoldUnitExtentDimsViaSlicesPatterns(), populateFuncOpVectorRewritePatterns(), populateFunctionOpInterfaceTypeConversionPattern(), populateFuncToEmitCPatterns(), populateFuncToLLVMConversionPatterns(), populateFuncToLLVMFuncOpConversionPattern(), populateFuncToSPIRVPatterns(), populateFuncTypeConversionPatterns(), mlir::linalg::populateFuseTensorPadWithProducerLinalgOpPatterns(), populateGpuAllReducePatterns(), populateGpuBreakDownSubgroupReducePatterns(), populateGpuDecomposeMemrefsPatterns(), populateGpuEliminateBarriersPatterns(), populateGpuGlobalIdPatterns(), populateGpuLowerClusteredSubgroupReduceToShufflePatterns(), populateGpuLowerSubgroupReduceToShufflePatterns(), populateGpuRewritePatterns(), populateGpuShufflePatterns(), populateGpuSubgroupReduceOpLoweringPattern(), populateGpuToLLVMConversionPatterns(), populateGpuToLLVMSPVConversionPatterns(), populateGpuToNVVMConversionPatterns(), populateGPUToSPIRVPatterns(), populateGpuWMMAToNVVMConversionPatterns(), populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns(), mlir::index::populateIndexToLLVMConversionPatterns(), mlir::index::populateIndexToSPIRVPatterns(), mlir::linalg::populateInlineConstantOperandsPatterns(), mlir::linalg::populateInsertSliceVectorizationPatterns(), mlir::arith::populateIntRangeNarrowingPatterns(), mlir::arith::populateIntRangeOptimizationsPatterns(), mlir::arm_sve::populateLegalizeVectorStoragePatterns(), mlir::linalg::populateLinalgGenericOpsSpecializationPatterns(), mlir::linalg::populateLinalgNamedOpConversionPatterns(), mlir::linalg::populateLinalgNamedOpsGeneralizationPatterns(), mlir::linalg::populateLinalgTilingCanonicalizationPatterns(), mlir::linalg::populateLinalgToStandardConversionPatterns(), mlir::arm_neon::populateLowerContractionToSMMLAPatternPatterns(), populateLowerForeachToSCFPatterns(), mlir::quant::populateLowerQuantOpsPatterns(), populateLowerSparseIterationToSCFPatterns(), populateLowerSparseOpsToForeachPatterns(), populateMathAlgebraicSimplificationPatterns(), populateMathPolynomialApproximationPatterns(), populateMathToLibmConversionPatterns(), populateMathToLLVMConversionPatterns(), populateMathToROCDLConversionPatterns(), populateMathToSPIRVPatterns(), mlir::memref::populateMemRefNarrowTypeEmulationPatterns(), populateMemRefToEmitCConversionPatterns(), populateMemRefToSPIRVPatterns(), mlir::memref::populateMemRefWideIntEmulationPatterns(), mlir::tensor::populateMergeConsecutiveInsertExtractSlicePatterns(), mlir::nvgpu::populateMmaSyncF32ToTF32Patterns(), mlir::linalg::populateMoveInitOperandsToInputPattern(), populateNVGPUToNVVMConversionPatterns(), populateNVVMToLLVMConversionPatterns(), populateOneToNFunctionOpInterfaceTypeConversionPattern(), populateOpConvertToLLVMConversionPatterns(), populateOpenACCToSCFConversionPatterns(), populateOpenMPToLLVMConversionPatterns(), populateOpPatterns(), mlir::arm_sme::populateOuterProductFusionPatterns(), mlir::linalg::populatePadOpVectorizationPatterns(), populateParallelLoopToGPUPatterns(), populatePolynomialApproximateErfPattern(), populatePolynomialApproximateTanhPattern(), populatePrepareVectorToMMAPatterns(), populatePreSparsificationRewriting(), mlir::mesh::populateProcessMultiIndexOpLoweringPatterns(), mlir::tensor::populateReassociativeReshapeFoldingPatterns(), populateRemoveShapeConstraintsPatterns(), mlir::memref::populateResolveRankedShapedTypeResultDimsPatterns(), mlir::memref::populateResolveShapedTypeResultDimsPatterns(), populateReturnOpTypeConversionPattern(), populateReturnOpVectorRewritePatterns(), mlir::tensor::populateRewriteAsConstantPatterns(), mlir::vector::populateScalarVectorTransferLoweringPatterns(), mlir::scf::populateSCFForLoopCanonicalizationPatterns(), mlir::scf::populateSCFLoopPipeliningPatterns(), mlir::scf::populateSCFRotateWhileLoopPatterns(), mlir::scf::populateSCFStructuralOneToNTypeConversions(), mlir::scf::populateSCFStructuralTypeConversions(), mlir::scf::populateSCFStructuralTypeConversionsAndLegality(), populateSCFToControlFlowConversionPatterns(), populateSCFToEmitCConversionPatterns(), populateSCFToSPIRVPatterns(), mlir::vector::populateShapeCastFoldingPatterns(), populateShapeRewritePatterns(), populateShapeToStandardConversionPatterns(), mlir::mesh::populateSimplificationPatterns(), mlir::tensor::populateSimplifyPackAndUnpackPatterns(), mlir::vector::populateSinkVectorOpsPatterns(), populateSparseAssembler(), populateSparseBufferRewriting(), populateSparseGPUCodegenPatterns(), populateSparseGPULibgenPatterns(), populateSparseReinterpretMap(), populateSparseTensorCodegenPatterns(), populateSparseTensorConversionPatterns(), populateSparseVectorizationPatterns(), populateSparsificationPatterns(), mlir::x86vector::avx2::populateSpecializedTransposeLoweringPatterns(), mlir::spirv::populateSPIRVExpandExtendedMultiplicationPatterns(), mlir::spirv::populateSPIRVExpandNonFiniteArithmeticPatterns(), populateSPIRVLayoutInfoPatterns(), populateSPIRVToLLVMConversionPatterns(), populateSPIRVToLLVMFunctionConversionPatterns(), populateSPIRVToLLVMModuleConversionPatterns(), mlir::linalg::populateSplitReductionPattern(), populateStageSparseOperationsPatterns(), populateStorageSpecifierToLLVMPatterns(), mlir::linalg::populateSwapExtractSliceWithFillPatterns(), populateTensorToLinalgPatterns(), populateTensorToSPIRVPatterns(), mlir::tosa::populateTosaConstantReduction(), mlir::tosa::populateTosaDecomposeConv2D(), mlir::tosa::populateTosaDecomposeDepthwise(), mlir::tosa::populateTosaDecomposeTransposeConv(), mlir::tosa::populateTosaFoldConstantReciprocalPatterns(), mlir::tosa::populateTosaFoldConstantTransposePatterns(), mlir::tosa::populateTosaRescaleToArithConversionPatterns(), mlir::tosa::populateTosaToArithConversionPatterns(), mlir::tosa::populateTosaToLinalgConversionPatterns(), mlir::tosa::populateTosaToLinalgNamedConversionPatterns(), mlir::tosa::populateTosaToMLProgramConversionPatterns(), mlir::tosa::populateTosaToSCFConversionPatterns(), mlir::tosa::populateTosaToTensorConversionPatterns(), mlir::linalg::populateTranposeConv2DPatterns(), mlir::linalg::populateTransposeMatmulPatterns(), mlir::ub::populateUBToLLVMConversionPatterns(), mlir::ub::populateUBToSPIRVConversionPatterns(), mlir::arith::populateUnsignedWhenEquivalentPatterns(), populateUpliftToFMAPatterns(), mlir::scf::populateUpliftWhileToForPatterns(), mlir::vector::populateVectorBitCastLoweringPatterns(), mlir::vector::populateVectorBroadcastLoweringPatterns(), mlir::vector::populateVectorContractCanonicalizeMatmulToMMT(), mlir::vector::populateVectorContractLoweringPatterns(), mlir::vector::populateVectorExtractStridedSliceToExtractInsertChainPatterns(), mlir::vector::populateVectorGatherLoweringPatterns(), mlir::vector::populateVectorInsertExtractStridedSliceDecompositionPatterns(), mlir::vector::populateVectorInsertExtractStridedSliceTransforms(), mlir::vector::populateVectorInterleaveLoweringPatterns(), mlir::vector::populateVectorInterleaveToShufflePatterns(), mlir::vector::populateVectorLinearizeTypeConversionsAndLegality(), mlir::vector::populateVectorMaskedLoadStoreEmulationPatterns(), mlir::vector::populateVectorMaskLoweringPatternsForSideEffectingOps(), mlir::vector::populateVectorMaskMaterializationPatterns(), mlir::vector::populateVectorMaskOpLoweringPatterns(), mlir::vector::populateVectorMultiReductionLoweringPatterns(), mlir::vector::populateVectorNarrowTypeEmulationPatterns(), mlir::vector::populateVectorNarrowTypeRewritePatterns(), mlir::vector::populateVectorOuterProductLoweringPatterns(), mlir::vector::populateVectorRankReducingFMAPattern(), mlir::vector::populateVectorReductionToContractPatterns(), populateVectorReductionToSPIRVDotProductPatterns(), mlir::vector::populateVectorScanLoweringPatterns(), mlir::vector::populateVectorShapeCastLoweringPatterns(), mlir::vector::populateVectorStepLoweringPatterns(), populateVectorToArmSMEPatterns(), populateVectorToLLVMConversionPatterns(), populateVectorToLLVMMatrixConversionPatterns(), populateVectorToSCFConversionPatterns(), populateVectorToSPIRVPatterns(), populateVectorToXeGPUConversionPatterns(), mlir::vector::populateVectorTransferCollapseInnerMostContiguousDimsPatterns(), mlir::vector::populateVectorTransferDropUnitDimsPatterns(), mlir::vector::populateVectorTransferFullPartialPatterns(), mlir::vector::populateVectorTransferLoweringPatterns(), mlir::vector::populateVectorTransferPermutationMapLoweringPatterns(), mlir::vector::populateVectorTransposeLoweringPatterns(), mlir::vector::populateVectorTransposeNarrowTypeRewritePatterns(), mlir::vector::populateVectorUnrollPatterns(), mlir::vector::populateWarpExecuteOnLane0OpToScfForPattern(), populateX86VectorLegalizeForLLVMExportPatterns(), mlir::xegpu::populateXeGPUFoldAliasOpsPatterns(), registerConversionPDLFunctions(), mlir::spirv::unrollVectorsInFuncBodies(), mlir::spirv::unrollVectorsInSignatures(), and walkAndApplyPatterns().