MLIR
19.0.0git
|
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 mutable or not. | |
bufferization | |
builtin | |
builtin_dialect_detail | |
bytecode | |
cf | |
dataflow | |
detail | |
Detect if any of the given parameter types has a sub-element handler. | |
dialect_extension_detail | |
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 | |
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... | |
class | GenericProgramPoint |
Abstract class for generic program points. More... | |
class | GenericProgramPointBase |
Base class for generic program points based on a concrete program point type and a content key. More... | |
struct | ProgramPoint |
Fundamental IR components are supported as first-class program points. 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 | 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 | 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 | DataLayoutEntryAttr |
A data layout entry attribute is a key-value pair where the key is a type or an identifier and the value is another attribute. More... | |
class | DataLayoutSpecAttr |
A data layout specification is a list of entries that specify (partial) data layout information. 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... | |
class | ValueDecomposer |
This class provides a hook that expands one Value into multiple Value's, with a TypeConverter-inspired callback registration mechanism. More... | |
struct | MathPolynomialApproximationOptions |
struct | SparsificationOptions |
Options for the Sparsification pass. 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 | 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 | 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... | |
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 |
The following classes enable support for parsing and printing resources within MLIR assembly formats. 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 |
AttrTypeReplacer. 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 Operation s. 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 | 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 | 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 an attribute. 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... | |
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 SymbolTable s. 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 | raw_indented_ostream |
raw_ostream subclass that simplifies indention a sequence of code. More... | |
struct | LogicalResult |
This class represents an efficient way to signal success or failure. More... | |
class | FailureOr |
This class provides support for representing a failure result, or a valid value of type T . More... | |
class | ParseResult |
This class represents success/failure for parsing-like operations that find it important to chain together failable operations with || . 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... | |
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 | OneToNTypeConverter |
Extends TypeConverter with 1:N target materializations. 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 OneToNConversionPattern s 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 | 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 | GPUIndexIntrinsicOpLowering |
struct | OpToFuncCallLowering |
Rewriting that replace SourceOp with a CallOp to f32Func or f64Func depending on the element type that Op operates upon. 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 | OwnedBlob = std::unique_ptr< std::vector< char > > |
using | BlobGenerator = std::function< OwnedBlob(const std::string &, Location, StringRef)> |
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 | 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 | ReassociationIndices = SmallVector< int64_t, 2 > |
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 | SetIntRangeFn = function_ref< void(Value, const ConstantIntRanges &)> |
The type of the setResultRanges callback provided to ops implementing InferIntRangeInterface. 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 &recordKeeper, 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 , kDebugInterface } |
Defines a scope for reinterpret map pass. More... | |
enum class | SPIRVSubByteTypeStorage { Packed } |
How sub-byte values are storaged in memory. More... | |
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 | GreedyRewriteStrictness { AnyOp , ExistingAndNewOps , ExistingOps } |
This enum controls which ops are put on the worklist during a greedy pattern rewrite. More... | |
Functions | |
raw_ostream & | operator<< (raw_ostream &os, const AliasResult &result) |
raw_ostream & | operator<< (raw_ostream &os, const ModRefResult &result) |
raw_ostream & | operator<< (raw_ostream &os, mlir::Block &block) |
ChangeResult | operator| (ChangeResult lhs, ChangeResult rhs) |
ChangeResult & | operator|= (ChangeResult &lhs, ChangeResult rhs) |
ChangeResult | operator& (ChangeResult lhs, ChangeResult rhs) |
raw_ostream & | operator<< (raw_ostream &os, const AnalysisState &state) |
raw_ostream & | operator<< (raw_ostream &os, ProgramPoint point) |
LogicalResult | getFlattenedAffineExpr (AffineExpr expr, unsigned numDims, unsigned numSymbols, SmallVectorImpl< int64_t > *flattenedExpr, FlatLinearConstraints *cst=nullptr) |
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) |
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... | |
SetVector< Operation * > | topologicalSort (const SetVector< Operation * > &toSort) |
Multi-root DAG topological sort. 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... | |
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< Pass > | createLowerAffinePass () |
Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp) to equivalent lower-level constructs (flow of basic blocks and arithmetic primitives). More... | |
void | populateAMDGPUToROCDLConversionPatterns (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< Pass > | createConvertAMDGPUToROCDLPass () |
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< Pass > | createConvertArmNeon2dToIntrPass () |
Creates a pass to lower Arm NEON 2D ops to intrinsics, i.e. More... | |
std::unique_ptr< Pass > | createConvertArmSMEToLLVMPass () |
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< Pass > | createConvertArmSMEToSCFPass () |
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< Pass > | createBufferizationToMemRefPass () |
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 (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
Populate the given list with patterns that convert from Complex to LLVM. More... | |
void | registerConvertComplexToLLVMInterface (DialectRegistry ®istry) |
void | populateComplexToSPIRVPatterns (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< Pass > | createConvertComplexToStandardPass () |
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... | |
std::unique_ptr< Pass > | createConvertToLLVMPass () |
Create a pass that performs dialect conversion to LLVM for all dialects implementing ConvertToLLVMPatternInterface . More... | |
void | registerConvertToLLVMDependentDialectLoading (DialectRegistry ®istry) |
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 (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
Collect the default pattern to convert a FuncOp to the LLVM dialect. More... | |
void | populateFuncToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns, const SymbolTable *symbolTable=nullptr) |
Collect the patterns to convert from the Func dialect to LLVM. More... | |
void | registerConvertFuncToLLVMInterface (DialectRegistry ®istry) |
void | populateFuncToSPIRVPatterns (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... | |
void | populateGpuToLLVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns, StringRef gpuBinaryAnnotation={}, bool kernelBarePtrCallConv=false, SymbolTable *cachedModuleTable=nullptr) |
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... | |
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 | populateGpuToNVVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
Collect a set of patterns to convert from the GPU dialect to NVVM. More... | |
void | populateGpuSubgroupReduceOpLoweringPattern (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
Populate GpuSubgroupReduce pattern to NVVM. More... | |
void | populateGpuWMMAToNVVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
Collect a set of patterns to convert WMMA ops from GPU dialect to NVVM. More... | |
void | populateGpuToROCDLConversionPatterns (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 (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) |
Appends to a pattern list additional patterns for translating GPU Ops to SPIR-V ops. More... | |
void | populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns (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 (LLVMTypeConverter &converter, RewritePatternSet &patterns, bool approximateLog1p=true) |
void | registerConvertMathToLLVMInterface (DialectRegistry ®istry) |
void | populateMathToSPIRVPatterns (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 | populateFinalizeMemRefToLLVMConversionPatterns (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 ®istry) |
void | populateMemRefToSPIRVPatterns (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... | |
void | populateNVGPUToNVVMConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
void | populateNVVMToLLVMConversionPatterns (RewritePatternSet &patterns) |
void | registerConvertNVVMToLLVMInterface (DialectRegistry ®istry) |
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, 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... | |
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< Pass > | createReconcileUnrealizedCastsPass () |
Creates a pass that eliminates noop unrealized_conversion_cast operation sequences. More... | |
void | populateReconcileUnrealizedCastsPatterns (RewritePatternSet &patterns) |
Populates patterns with rewrite patterns that eliminate 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< Pass > | createConvertSCFToCFPass () |
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< Pass > | createParallelLoopToGpuPass () |
Creates a pass that converts scf.parallel operations into a gpu.launch operation. More... | |
void | populateSCFToSPIRVPatterns (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< Pass > | createConvertShapeConstraintsPass () |
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 (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 (LLVMTypeConverter &typeConverter, RewritePatternSet &patterns) |
Populates the given list with patterns for function conversion from SPIR-V to LLVM. More... | |
void | populateSPIRVToLLVMModuleConversionPatterns (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 (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< Pass > | createConvertVectorToArmSMEPass () |
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< Pass > | createConvertVectorToGPUPass (bool useNvGpu=false) |
Convert from vector to GPU ops. More... | |
void | populateVectorToLLVMMatrixConversionPatterns (LLVMTypeConverter &converter, RewritePatternSet &patterns) |
Collect a set of patterns to convert from Vector contractions to LLVM Matrix Intrinsics. More... | |
void | populateVectorToLLVMConversionPatterns (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< Pass > | createConvertVectorToSCFPass (const VectorTransferToSCFOptions &options=VectorTransferToSCFOptions()) |
Create a pass to convert a subset of vector ops to SCF. More... | |
void | populateVectorToSPIRVPatterns (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 | 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... | |
detail::op_matcher< arith::ConstantIndexOp > | matchConstantIndex () |
Matches a ConstantIndexOp. More... | |
llvm::SmallBitVector | getPositionsOfShapeOne (unsigned rank, ArrayRef< int64_t > shape) |
Value | getValueOrCreateConstantIndexOp (OpBuilder &b, Location loc, OpFoldResult ofr) |
Converts an OpFoldResult to a Value. More... | |
SmallVector< Value > | getValueOrCreateConstantIndexOp (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) |
void | populateArmSVELegalizeForLLVMExportPatterns (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< Pass > | createAsyncParallelForPass () |
std::unique_ptr< Pass > | createAsyncParallelForPass (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< Pass > | createAsyncRuntimeRefCountingPass () |
std::unique_ptr< Pass > | createAsyncRuntimeRefCountingOptPass () |
std::unique_ptr< Pass > | createAsyncRuntimePolicyBasedRefCountingPass () |
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 | populateDecomposeCallGraphTypesPatterns (MLIRContext *context, TypeConverter &typeConverter, ValueDecomposer &decomposer, RewritePatternSet &patterns) |
Populates the patterns needed to drive the conversion process for decomposing call graph types with the given ValueDecomposer . More... | |
void | populateCallOpTypeConversionPattern (RewritePatternSet &patterns, 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, 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, TypeConverter &converter) |
Return true if op is a BranchOpInterface op whose operands are all legal according to converter. More... | |
void | populateReturnOpTypeConversionPattern (RewritePatternSet &patterns, 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, 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 (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< Pass > | createGpuLauchSinkIndexComputationsPass () |
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 | populateGpuBreakDownSubgrupReducePatterns (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 | populateGpuLowerSubgroupReduceToShufflePattenrs (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 | populateGpuRewritePatterns (RewritePatternSet &patterns) |
Collect all patterns to rewrite ops within the GPU dialect. More... | |
void | registerGpuSerializeToHsacoPass () |
Register pass to serialize GPU kernel functions to a HSAco binary annotation. More... | |
std::unique_ptr< Pass > | createGpuSerializeToHsacoPass (StringRef triple, StringRef arch, StringRef features, int optLevel) |
Create an instance of the GPU kernel function to HSAco binary serialization pass. More... | |
void | populateGpuDecomposeMemrefsPatterns (RewritePatternSet &patterns) |
Collect a set of patterns to decompose memrefs ops. More... | |
std::unique_ptr< Pass > | createGpuDecomposeMemrefsPass () |
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) |
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) |
void | populateExpandCtlzPattern (RewritePatternSet &patterns) |
void | populateExpandTanPattern (RewritePatternSet &patterns) |
void | populateExpandSinhPattern (RewritePatternSet &patterns) |
void | populateExpandCoshPattern (RewritePatternSet &patterns) |
void | populateExpandTanhPattern (RewritePatternSet &patterns) |
void | populateExpandFmaFPattern (RewritePatternSet &patterns) |
void | populateExpandFloorFPattern (RewritePatternSet &patterns) |
void | populateExpandCeilFPattern (RewritePatternSet &patterns) |
void | populateExpandExp2FPattern (RewritePatternSet &patterns) |
void | populateExpandPowFPattern (RewritePatternSet &patterns) |
void | populateExpandRoundFPattern (RewritePatternSet &patterns) |
void | populateExpandRoundEvenPattern (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< Pass > | createSCFBufferizePass () |
Creates a pass that bufferizes the SCF dialect. More... | |
std::unique_ptr< Pass > | createForLoopSpecializationPass () |
Creates a pass that specializes for loop for unrolling and vectorization. More... | |
std::unique_ptr< Pass > | createForLoopPeelingPass () |
Creates a pass that peels for loops at their upper bounds for better vectorization. More... | |
std::unique_ptr< Pass > | createSCFForLoopCanonicalizationPass () |
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< Pass > | createTestSCFParallelLoopCollapsingPass () |
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< Pass > | createParallelLoopFusionPass () |
Creates a loop fusion pass which fuses parallel loops. More... | |
std::unique_ptr< Pass > | createParallelLoopSpecializationPass () |
Creates a pass that specializes parallel loop for unrolling and vectorization. More... | |
std::unique_ptr< Pass > | createParallelLoopTilingPass (llvm::ArrayRef< int64_t > tileSize={}, bool noMinMaxBounds=false) |
Creates a pass which tiles innermost parallel loops. More... | |
std::unique_ptr< Pass > | createForLoopRangeFoldingPass () |
Creates a pass which folds arith ops on induction variable into loop range. More... | |
std::unique_ptr< Pass > | createForToWhileLoopPass () |
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 ®ion, 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... | |
void | collapseParallelLoops (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... | |
LogicalResult | loopUnrollByFactor (scf::ForOp forOp, uint64_t unrollFactor, function_ref< void(unsigned, Operation *, OpBuilder)> annotateFn=nullptr) |
Unrolls this for operation by the specified unroll factor. 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... | |
std::unique_ptr< Pass > | createShapeToShapeLowering () |
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< func::FuncOp > > | createShapeBufferizePass () |
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) |
std::unique_ptr< Pass > | createSparseAssembler () |
void | populateSparseReinterpretMap (RewritePatternSet &patterns, ReinterpretMapScope scope) |
std::unique_ptr< Pass > | createSparseReinterpretMapPass () |
std::unique_ptr< Pass > | createSparseReinterpretMapPass (ReinterpretMapScope scope) |
void | populatePreSparsificationRewriting (RewritePatternSet &patterns) |
std::unique_ptr< Pass > | createPreSparsificationRewritePass () |
void | populateSparsificationPatterns (RewritePatternSet &patterns, const SparsificationOptions &options=SparsificationOptions()) |
Sets up sparsification rewriting rules with the given options. More... | |
std::unique_ptr< Pass > | createSparsificationPass () |
std::unique_ptr< Pass > | createSparsificationPass (const SparsificationOptions &options) |
void | populateStageSparseOperationsPatterns (RewritePatternSet &patterns) |
Sets up StageSparseOperation rewriting rules. More... | |
std::unique_ptr< Pass > | createStageSparseOperationsPass () |
void | populateLowerSparseOpsToForeachPatterns (RewritePatternSet &patterns, bool enableRT, bool enableConvert) |
std::unique_ptr< Pass > | createLowerSparseOpsToForeachPass () |
std::unique_ptr< Pass > | createLowerSparseOpsToForeachPass (bool enableRT, bool enableConvert) |
void | populateLowerForeachToSCFPatterns (RewritePatternSet &patterns) |
std::unique_ptr< Pass > | createLowerForeachToSCFPass () |
void | populateSparseTensorConversionPatterns (TypeConverter &typeConverter, RewritePatternSet &patterns) |
Sets up sparse tensor conversion rules. More... | |
std::unique_ptr< Pass > | createSparseTensorConversionPass () |
void | populateSparseTensorCodegenPatterns (TypeConverter &typeConverter, RewritePatternSet &patterns, bool createSparseDeallocs, bool enableBufferInitialization) |
Sets up sparse tensor codegen rules. More... | |
std::unique_ptr< Pass > | createSparseTensorCodegenPass () |
std::unique_ptr< Pass > | createSparseTensorCodegenPass (bool createSparseDeallocs, bool enableBufferInitialization) |
void | populateSparseBufferRewriting (RewritePatternSet &patterns, bool enableBufferInitialization) |
std::unique_ptr< Pass > | createSparseBufferRewritePass () |
std::unique_ptr< Pass > | createSparseBufferRewritePass (bool enableBufferInitialization) |
void | populateSparseVectorizationPatterns (RewritePatternSet &patterns, unsigned vectorLength, bool enableVLAVectorization, bool enableSIMDIndex32) |
Populates the given patterns list with vectorization rules. More... | |
std::unique_ptr< Pass > | createSparseVectorizationPass () |
std::unique_ptr< Pass > | createSparseVectorizationPass (unsigned vectorLength, bool enableVLAVectorization, bool enableSIMDIndex32) |
void | populateSparseGPUCodegenPatterns (RewritePatternSet &patterns, unsigned numThreads) |
void | populateSparseGPULibgenPatterns (RewritePatternSet &patterns, bool enableRT) |
std::unique_ptr< Pass > | createSparseGPUCodegenPass () |
std::unique_ptr< Pass > | createSparseGPUCodegenPass (unsigned numThreads, bool enableRT) |
void | populateStorageSpecifierToLLVMPatterns (TypeConverter &converter, RewritePatternSet &patterns) |
std::unique_ptr< Pass > | createStorageSpecifierToLLVMPass () |
bufferization::OneShotBufferizationOptions | getBufferizationOptionsForSparsification (bool analysisOnly) |
std::unique_ptr< Pass > | createSparsificationAndBufferizationPass () |
std::unique_ptr< Pass > | createSparsificationAndBufferizationPass (const bufferization::OneShotBufferizationOptions &bufferizationOptions, const SparsificationOptions &sparsificationOptions, bool createSparseDeallocs, bool enableRuntimeLibrary, bool enableBufferInitialization, unsigned vectorLength, bool enableVLAVectorization, bool enableSIMDIndex32, bool enableGPULibgen) |
void | populateBuiltinFuncToSPIRVPatterns (SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns) |
Appends to a pattern list additional patterns for translating the builtin func op to the SPIR-V dialect. More... | |
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< AffineExpr > | computeSuffixProduct (ArrayRef< AffineExpr > sizes) |
Given a set of sizes, return the suffix product. More... | |
SmallVector< AffineExpr > | computeStrides (ArrayRef< AffineExpr > sizes) |
SmallVector< AffineExpr > | computeElementwiseMul (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< AffineExpr > | 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. More... | |
SmallVector< AffineExpr > | delinearize (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 > | 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 (OpBuilder &b, 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 rules 1) 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... | |
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< OpFoldResult > | getAsOpFoldResult (ValueRange values) |
Given an array of values, try to extract a constant Attribute from each value. More... | |
SmallVector< OpFoldResult > | getAsOpFoldResult (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< OpFoldResult > | getAsIndexOpFoldResult (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 | 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< OpFoldResult > | 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. More... | |
std::pair< ArrayAttr, SmallVector< Value > > | decomposeMixedValues (Builder &b, const SmallVectorImpl< OpFoldResult > &mixedValues) |
Decompose a vector of mixed static or dynamic values into the corresponding pair of arrays. More... | |
SmallVector< Value > | getValuesSortedByKey (ArrayRef< Attribute > keys, ArrayRef< Value > values, llvm::function_ref< bool(Attribute, Attribute)> compare) |
Helper to sort values according to matching keys . More... | |
SmallVector< OpFoldResult > | getValuesSortedByKey (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... | |
Operation * | clone (OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands) |
template<typename OpT > | |
OpT | clone (OpBuilder &b, OpT op, TypeRange newResultTypes, ValueRange newOperands) |
Operation * | cloneWithoutRegions (OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands) |
SmallVector< NamedAttribute > | getPrunedAttributeList (Operation *op, ArrayRef< StringRef > elidedAttrs) |
void | populateX86VectorLegalizeForLLVMExportPatterns (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 ®istry, 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 ®istry) |
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 ®istry) |
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... | |
Region * | 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. More... | |
Region * | 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. More... | |
raw_ostream & | operator<< (raw_ostream &, const ConstantIntRanges &) |
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, Value value=nullptr) |
Returns true if op has only an effect of type EffectTy (and of no other type) on value . More... | |
template<typename... EffectTys> | |
bool | hasEffect (Operation *op, Value value=nullptr) |
Returns true if op has an effect of type EffectTy on value . 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, TypeRange valueTypes=TypeRange(), ArrayRef< bool > scalables={}, AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square) |
Printer hook for custom directive in assemblyFormat. More... | |
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, 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< AffineExpr > | getAffineConstantExprs (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< AffineMap > | compressUnusedDims (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< AffineMap > | compressUnusedSymbols (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) |
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) |
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) |
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_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_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 (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... | |
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 ¶m) |
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) |
OpAsmPrinter & | operator<< (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> | |
OpAsmPrinter & | operator<< (OpAsmPrinter &p, const T &values) |
OpAsmPrinter & | operator<< (OpAsmPrinter &p, Block *value) |
void | printDimensionList (OpAsmPrinter &printer, Operation *op, ArrayRef< int64_t > dimensions) |
ParseResult | parseDimensionList (OpAsmParser &parser, DenseI64ArrayAttr &dimensions) |
bool | mayHaveSSADominance (Region ®ion) |
Return "true" if the given region may have SSA dominance. More... | |
bool | mayBeGraphRegion (Region ®ion) |
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 | 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< OpPassManager > | parsePassPipeline (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< Pass > | createReductionTreePass () |
std::unique_ptr< Pass > | createOptReductionPass () |
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... | |
LogicalResult | success (bool isSuccess=true) |
Utility function to generate a LogicalResult. More... | |
LogicalResult | failure (bool isFailure=true) |
Utility function to generate a LogicalResult. More... | |
bool | succeeded (LogicalResult result) |
Utility function that returns true if the provided LogicalResult corresponds to a success value. More... | |
bool | failed (LogicalResult result) |
Utility function that returns true if the provided LogicalResult corresponds to a failure value. More... | |
template<typename T , typename = std::enable_if_t<!std::is_convertible_v<T, bool>>> | |
auto | success (T &&t) |
Wrap a value on the success path in a FailureOr of the same value type. More... | |
int64_t | ceilDiv (int64_t lhs, int64_t rhs) |
Returns the result of MLIR's ceildiv operation on constants. More... | |
int64_t | floorDiv (int64_t lhs, int64_t rhs) |
Returns the result of MLIR's floordiv operation on constants. More... | |
int64_t | mod (int64_t lhs, int64_t rhs) |
Returns MLIR's mod operation on constants. 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 ®istry) |
Registers all dialects that can be translated to LLVM IR and the corresponding translation interfaces. More... | |
static void | registerAllGPUToLLVMIRTranslations (DialectRegistry ®istry) |
Registers all the translations to LLVM IR required by GPU passes. More... | |
static void | registerAllFromLLVMIRTranslations (DialectRegistry ®istry) |
Registers all dialects that can be translated from LLVM IR and the corresponding translation interfaces. More... | |
void | registerAMXDialectTranslation (DialectRegistry ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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 ®istry) |
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") |
Translate operation that satisfies LLVM dialect module requirements 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) |
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... | |
LogicalResult | MlirLspServerMain (int argc, char **argv, DialectRegistry ®istry) |
Implementation for tools like mlir-lsp-server . More... | |
std::pair< std::string, std::string > | registerAndParseCLIOptions (int argc, char **argv, llvm::StringRef toolName, DialectRegistry ®istry) |
Register and parse command line options. More... | |
LogicalResult | MlirOptMain (llvm::raw_ostream &outputStream, std::unique_ptr< llvm::MemoryBuffer > buffer, DialectRegistry ®istry, const MlirOptMainConfig &config) |
Perform the core processing behind mlir-opt . More... | |
LogicalResult | MlirOptMain (int argc, char **argv, llvm::StringRef toolName, DialectRegistry ®istry) |
Implementation for tools like mlir-opt . More... | |
LogicalResult | MlirOptMain (int argc, char **argv, llvm::StringRef inputFilename, llvm::StringRef outputFilename, DialectRegistry ®istry) |
Implementation for tools like mlir-opt . More... | |
int | asMainReturnCode (LogicalResult r) |
Helper wrapper to return the result of MlirOptMain directly from main. More... | |
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... | |
LogicalResult | TableGenLspServerMain (int argc, char **argv) |
Implementation for tools like tblgen-lsp-server . More... | |
FailureOr< bool > | transformCFGToSCF (Region ®ion, 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 * > ®ions) |
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... | |
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 | applyPatternsAndFoldGreedily (Region ®ion, 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 (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 | applyOpPatternsAndFold (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... | |
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< Pass > | 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. More... | |
std::unique_ptr< Pass > | createLocationSnapshotPass () |
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, RewriterBase &rewriter, Mem2RegStatistics statistics={}) |
Attempts to promote the memory slots of the provided allocators. More... | |
LogicalResult | applyPartialOneToNConversion (Operation *op, OneToNTypeConverter &typeConverter, const FrozenRewritePatternSet &patterns) |
Applies the given set of patterns recursively on the given op and adds user materializations where necessary. More... | |
std::unique_ptr< Pass > | createCanonicalizerPass () |
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< Pass > | 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. More... | |
std::unique_ptr< Pass > | createControlFlowSinkPass () |
Creates a pass to perform control-flow sinking. More... | |
std::unique_ptr< Pass > | createCSEPass () |
Creates a pass to perform common sub expression elimination. More... | |
std::unique_ptr< Pass > | createPrintIRPass (const PrintIRPassOptions &={}) |
Creates a pass to print IR on the debug stream. More... | |
std::unique_ptr< Pass > | createGenerateRuntimeVerificationPass () |
Creates a pass that generates IR to verify ops at runtime. More... | |
std::unique_ptr< Pass > | createLoopInvariantCodeMotionPass () |
Creates a loop invariant code motion pass that hoists loop invariant instructions out of the loop. More... | |
std::unique_ptr< Pass > | createLoopInvariantSubsetHoistingPass () |
Creates a pass that hoists loop-invariant subset ops. More... | |
std::unique_ptr< Pass > | createStripDebugInfoPass () |
Creates a pass to strip debug information from a function. More... | |
std::unique_ptr< Pass > | createPrintOpStatsPass (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< Pass > | 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. More... | |
std::unique_ptr< Pass > | createInlinerPass () |
Creates a pass which inlines calls and callable operations as defined by the CallGraph. More... | |
std::unique_ptr< Pass > | 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. More... | |
std::unique_ptr< Pass > | 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. More... | |
std::unique_ptr< Pass > | createRemoveDeadValuesPass () |
Creates an optimization pass to remove dead values. More... | |
std::unique_ptr< Pass > | createSCCPPass () |
Creates a pass which performs sparse conditional constant propagation over nested operations. More... | |
std::unique_ptr< Pass > | createSymbolDCEPass () |
Creates a pass which delete symbol operations that are unreachable. More... | |
std::unique_ptr< Pass > | createSymbolPrivatizePass (ArrayRef< std::string > excludeSymbols={}) |
Creates a pass which marks top-level symbol operations as private unless listed in excludeSymbols . More... | |
std::unique_ptr< Pass > | 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. 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 ®ion) |
Replace all uses of orig within the given region with replacement . More... | |
void | visitUsedValuesDefinedAbove (Region ®ion, 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 ®ion, 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< Value > | makeRegionIsolatedFromAbove (RewriterBase &rewriter, Region ®ion, llvm::function_ref< bool(Operation *)> cloneOperationIntoRegion=[](Operation *) { return false;}) |
Make a region isolated from above. More... | |
LogicalResult | simplifyRegions (RewriterBase &rewriter, MutableArrayRef< Region > regions) |
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... | |
SetVector< Block * > | getTopologicallySortedBlocks (Region ®ion) |
Get a topologically sorted list of blocks of the given region. More... | |
LogicalResult | tryToDestructureMemorySlots (ArrayRef< DestructurableAllocationOpInterface > allocators, RewriterBase &rewriter, SROAStatistics statistics={}) |
Attempts to destructure the slots of destructurable allocators. 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... | |
std::unique_ptr< Pass > | createPrintOpGraphPass (raw_ostream &os=llvm::errs()) |
Creates a pass to print op graphs. 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 LogicalResult | verifyPointerAndJointMatrixType (Operation *op, Type pointer, Type jointMatrix) |
static LogicalResult | verifyJointMatrixMad (spirv::INTELJointMatrixMadOp op) |
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 = "// -----" |
Include the generated interface declarations.
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.
using mlir::AllocFunType = typedef llvm::function_ref<void *(size_t)> |
Definition at line 37 of file MemRefUtils.h.
using mlir::AttributeStorageAllocator = typedef StorageUniquer::StorageAllocator |
Definition at line 207 of file AttributeSupport.h.
using mlir::AttrSubElementReplacements = typedef AttrTypeSubElementReplacements<Attribute> |
Definition at line 273 of file AttrTypeSubElements.h.
using mlir::BlobGenerator = typedef std::function<OwnedBlob(const std::string &, Location, StringRef)> |
Definition at line 50 of file GPUCommonPass.h.
using mlir::ChunkBufferHandler = typedef function_ref<LogicalResult( std::unique_ptr<llvm::MemoryBuffer> chunkBuffer, raw_ostream &os)> |
Definition at line 29 of file ToolUtilities.h.
using mlir::DataLayoutEntryKey = typedef llvm::PointerUnion<Type, StringAttr> |
Definition at line 26 of file DataLayoutInterfaces.h.
using mlir::DataLayoutEntryList = typedef llvm::SmallVector<DataLayoutEntryInterface, 4> |
Definition at line 29 of file DataLayoutInterfaces.h.
using mlir::DataLayoutEntryListRef = typedef llvm::ArrayRef<DataLayoutEntryInterface> |
Definition at line 30 of file DataLayoutInterfaces.h.
using mlir::DefaultAttributeStorage = typedef AttributeStorage |
Default storage type for attributes that require no additional initialization or storage.
Definition at line 199 of file AttributeSupport.h.
using mlir::DefaultTypeStorage = typedef TypeStorage |
Default storage type for types that require no additional initialization or storage.
Definition at line 194 of file TypeSupport.h.
using mlir::DenseBoolArrayAttr = typedef detail::DenseArrayAttrImpl<bool> |
Definition at line 765 of file BuiltinAttributes.h.
using mlir::DenseBoolResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<bool> |
Definition at line 815 of file BuiltinAttributes.h.
using mlir::DenseF32ArrayAttr = typedef detail::DenseArrayAttrImpl<float> |
Definition at line 770 of file BuiltinAttributes.h.
using mlir::DenseF32ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<float> |
Definition at line 833 of file BuiltinAttributes.h.
using mlir::DenseF64ArrayAttr = typedef detail::DenseArrayAttrImpl<double> |
Definition at line 771 of file BuiltinAttributes.h.
using mlir::DenseF64ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<double> |
Definition at line 835 of file BuiltinAttributes.h.
using mlir::DenseI16ArrayAttr = typedef detail::DenseArrayAttrImpl<int16_t> |
Definition at line 767 of file BuiltinAttributes.h.
using mlir::DenseI16ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<int16_t> |
Definition at line 819 of file BuiltinAttributes.h.
using mlir::DenseI32ArrayAttr = typedef detail::DenseArrayAttrImpl<int32_t> |
Definition at line 768 of file BuiltinAttributes.h.
using mlir::DenseI32ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<int32_t> |
Definition at line 821 of file BuiltinAttributes.h.
using mlir::DenseI64ArrayAttr = typedef detail::DenseArrayAttrImpl<int64_t> |
Definition at line 769 of file BuiltinAttributes.h.
using mlir::DenseI64ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<int64_t> |
Definition at line 823 of file BuiltinAttributes.h.
using mlir::DenseI8ArrayAttr = typedef detail::DenseArrayAttrImpl<int8_t> |
Definition at line 766 of file BuiltinAttributes.h.
using mlir::DenseI8ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<int8_t> |
Definition at line 817 of file BuiltinAttributes.h.
using mlir::DenseMap = typedef llvm::DenseMap<KeyT, ValueT, KeyInfoT, BucketT> |
DenseMapInfo< mlir::RegisteredOperationName > |
using mlir::DenseResourceElementsHandle = typedef DialectResourceBlobHandle<BuiltinDialect> |
Definition at line 702 of file BuiltinAttributes.h.
using mlir::DenseSet = typedef llvm::DenseSet<ValueT, ValueInfoT> |
using mlir::DenseUI16ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<uint16_t> |
Definition at line 827 of file BuiltinAttributes.h.
using mlir::DenseUI32ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<uint32_t> |
Definition at line 829 of file BuiltinAttributes.h.
using mlir::DenseUI64ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<uint64_t> |
Definition at line 831 of file BuiltinAttributes.h.
using mlir::DenseUI8ResourceElementsAttr = typedef detail::DenseResourceElementsAttrBase<uint8_t> |
Definition at line 825 of file BuiltinAttributes.h.
using mlir::DialectAllocatorFunction = typedef std::function<Dialect *(MLIRContext *)> |
Definition at line 27 of file DialectRegistry.h.
using mlir::DialectAllocatorFunctionRef = typedef function_ref<Dialect *(MLIRContext *)> |
Definition at line 28 of file DialectRegistry.h.
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.
using mlir::DominanceInfoNode = typedef llvm::DomTreeNodeBase<Block> |
Definition at line 30 of file Dominance.h.
using mlir::DynamicDialectPopulationFunction = typedef std::function<void(MLIRContext *, DynamicDialect *)> |
Definition at line 29 of file DialectRegistry.h.
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.
using mlir::ForwardSliceOptions = typedef SliceOptions |
Definition at line 52 of file SliceAnalysis.h.
using mlir::function_ref = typedef llvm::function_ref<Fn> |
using mlir::GenFunction = typedef std::function<bool(const llvm::RecordKeeper &recordKeeper, raw_ostream &os)> |
using mlir::Loops = typedef SmallVector<scf::ForOp, 8> |
using mlir::LoweringCallback = typedef std::function<std::unique_ptr<llvm::Module>( Operation *, llvm::LLVMContext &, StringRef)> |
Definition at line 52 of file GPUCommonPass.h.
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 75 of file GPUCommonPass.h.
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.
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 1698 of file OpImplementation.h.
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 1694 of file OpImplementation.h.
using mlir::OperandElementTypeRange = typedef iterator_range<OperandElementTypeIterator> |
Definition at line 97 of file TypeUtilities.h.
using mlir::OwnedBlob = typedef std::unique_ptr<std::vector<char> > |
Definition at line 49 of file GPUCommonPass.h.
using mlir::PassAllocatorFunction = typedef std::function<std::unique_ptr<Pass>()> |
Definition at line 41 of file PassRegistry.h.
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 257 of file MlirOptMain.h.
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.
using mlir::ReassociationExprs = typedef SmallVector<AffineExpr, 2> |
Definition at line 28 of file ReshapeOpsUtils.h.
using mlir::ReassociationIndices = typedef SmallVector<int64_t, 2> |
Definition at line 26 of file ReshapeOpsUtils.h.
using mlir::ReassociationIndicesRef = typedef ArrayRef<int64_t> |
Definition at line 27 of file ReshapeOpsUtils.h.
using mlir::ReifiedRankedShapedTypeDims = typedef SmallVector<SmallVector<OpFoldResult> > |
Definition at line 29 of file InferTypeOpInterface.h.
using mlir::ReproducerStreamFactory = typedef std::function<std::unique_ptr<ReproducerStream>(std::string &error)> |
Method type for constructing ReproducerStream.
Definition at line 222 of file PassManager.h.
using mlir::ResultElementTypeRange = typedef iterator_range<ResultElementTypeIterator> |
Definition at line 110 of file TypeUtilities.h.
using mlir::SetIntRangeFn = typedef function_ref<void(Value, const ConstantIntRanges &)> |
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 111 of file InferIntRangeInterface.h.
using mlir::SetVector = typedef llvm::SetVector<T, Vector, Set, N> |
using mlir::StringSet = typedef llvm::StringSet<AllocatorTy> |
using mlir::StringSwitch = typedef llvm::StringSwitch<T, R> |
using mlir::TileLoops = typedef std::pair<Loops, Loops> |
using mlir::TransitiveFilter = typedef SliceOptions::TransitiveFilter |
Definition at line 41 of file SliceAnalysis.h.
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.
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.
using mlir::TranslateRawSourceMgrToMLIRFunction = typedef std::function<OwningOpRef<Operation *>(llvm::SourceMgr &sourceMgr, MLIRContext *)> |
Definition at line 30 of file Translation.h.
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.
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.
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.
using mlir::TypeRangeRangeIterator = typedef llvm::mapped_iterator<llvm::iota_range<unsigned>::iterator, std::function<TypeRange(unsigned)> > |
Definition at line 85 of file TypeRange.h.
using mlir::TypeStorageAllocator = typedef StorageUniquer::StorageAllocator |
This is a utility allocator used to allocate memory for instances of derived Types.
Definition at line 202 of file TypeSupport.h.
using mlir::TypeSubElementReplacements = typedef AttrTypeSubElementReplacements<Type> |
Definition at line 274 of file AttrTypeSubElements.h.
using mlir::TypeSwitch = typedef llvm::TypeSwitch<T, ResultT> |
using mlir::ValueDimList = typedef SmallVector<std::pair<Value, std::optional<int64_t> >> |
Definition at line 49 of file ValueBoundsOpInterface.h.
|
strong |
Definition at line 41 of file AffineExpr.h.
|
strong |
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 272 of file AsmState.h.
|
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 34 of file DataFlowFramework.h.
|
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 36 of file MemorySlotInterfaces.h.
|
strong |
Defines the different supported severity of a diagnostic.
Enumerator | |
---|---|
Note | |
Warning | |
Error | |
Remark |
Definition at line 41 of file Diagnostics.h.
|
strong |
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.
|
strong |
Enumerator | |
---|---|
None | |
Loop | |
Block |
Definition at line 21 of file AllocationOpInterface.h.
|
strong |
An enum describing the different display modes for the information within the pass manager.
Enumerator | |
---|---|
List | |
Pipeline |
Definition at line 199 of file PassManager.h.
|
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.
|
strong |
|
strong |
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 369 of file BuiltinTypes.h.
|
strong |
|
strong |
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 |
|
strong |
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 30 of file SPIRVConversion.h.
enum mlir::TraversalMode |
Defines the traversal method options to be used in the reduction tree traversal.
Enumerator | |
---|---|
SinglePath | |
Backtrack | |
MultiPath |
Definition at line 37 of file ReductionNode.h.
|
strong |
Traversal order for region, block and operation walk utilities.
Enumerator | |
---|---|
PreOrder | |
PostOrder |
Definition at line 63 of file Visitors.h.
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 1240 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().
bool mlir::allOperandsHaveSameCoopMatrixType | ( | ValueRange | operands | ) |
Definition at line 85 of file WmmaOpsToSPIRV.cpp.
References mlir::Value::getType(), and mlir::ValueRange::getType().
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 3640 of file DialectConversion.cpp.
References mlir::OperationConverter::convertOperations().
LogicalResult mlir::applyAnalysisConversion | ( | Operation * | op, |
ConversionTarget & | target, | ||
const FrozenRewritePatternSet & | patterns, | ||
ConversionConfig | config = ConversionConfig() |
||
) |
Definition at line 3648 of file DialectConversion.cpp.
void mlir::applyDefaultTimingManagerCLOptions | ( | DefaultTimingManager & | tm | ) |
Apply any values that were registered with 'registerDefaultTimingManagerOptions' to a DefaultTimingManager
.
Definition at line 562 of file Timing.cpp.
References options, mlir::DefaultTimingManager::setDisplayMode(), and mlir::DefaultTimingManager::setEnabled().
Referenced by applyDefaultTimingPassManagerCLOptions(), and performActions().
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 158 of file PassManagerOptions.cpp.
References applyDefaultTimingManagerCLOptions(), and mlir::PassManager::enableTiming().
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 3622 of file DialectConversion.cpp.
References mlir::OperationConverter::convertOperations().
LogicalResult mlir::applyFullConversion | ( | Operation * | op, |
const ConversionTarget & | target, | ||
const FrozenRewritePatternSet & | patterns, | ||
ConversionConfig | config = ConversionConfig() |
||
) |
Definition at line 3630 of file DialectConversion.cpp.
LogicalResult mlir::applyOpPatternsAndFold | ( | 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 folding and 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 applyPatternsAndFoldGreedily
, 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, applyPatternsAndFoldGreedily
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 988 of file GreedyPatternRewriteDriver.cpp.
References findCommonAncestor(), mlir::GreedyRewriteConfig::scope, and success().
Referenced by mlir::affine::hoistAffineIfOp().
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 3605 of file DialectConversion.cpp.
References mlir::OperationConverter::convertOperations().
LogicalResult mlir::applyPartialConversion | ( | Operation * | op, |
const ConversionTarget & | target, | ||
const FrozenRewritePatternSet & | patterns, | ||
ConversionConfig | config = ConversionConfig() |
||
) |
Definition at line 3613 of file DialectConversion.cpp.
LogicalResult mlir::applyPartialOneToNConversion | ( | Operation * | op, |
OneToNTypeConverter & | 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 320 of file OneToNTypeConversion.cpp.
LogicalResult mlir::applyPassManagerCLOptions | ( | PassManager & | pm | ) |
Apply any values provided to the pass manager options that were registered with 'registerPassManagerOptions'.
Definition at line 133 of file PassManagerOptions.cpp.
References emitError(), mlir::PassManager::enableCrashReproducerGeneration(), mlir::PassManager::enableStatistics(), failure(), get(), mlir::PassManager::getContext(), mlir::MLIRContext::isMultithreadingEnabled(), options, and success().
|
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 folding and 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 139 of file GreedyPatternRewriteDriver.h.
LogicalResult mlir::applyPatternsAndFoldGreedily | ( | 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 folding and 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 870 of file GreedyPatternRewriteDriver.cpp.
References failed(), mlir::Region::getContext(), mlir::Region::getParentOp(), mlir::Operation::hasTrait(), mlir::GreedyRewriteConfig::maxIterations, mlir::GreedyRewriteConfig::scope, and verify().
Referenced by mlir::affine::hoistAffineIfOp().
SmallVector<T> mlir::applyPermutation | ( | ArrayRef< T > | input, |
ArrayRef< int64_t > | permutation | ||
) |
Definition at line 201 of file IndexingUtils.h.
Referenced by applyPermutation(), applyPermutationToVector(), mlir::detail::TileOffsetRangeImpl::getDynamicTileOffsets(), mlir::detail::TileOffsetRangeImpl::getStaticTileOffsets(), and getTiledPackShape().
SmallVector<T> mlir::applyPermutation | ( | const SmallVectorImpl< T > & | input, |
ArrayRef< int64_t > | permutation | ||
) |
Definition at line 212 of file IndexingUtils.h.
References applyPermutation().
SmallVector<T> mlir::applyPermutationMap | ( | AffineMap | map, |
llvm::ArrayRef< T > | source | ||
) |
Apply a permutation from map
to source
and return the result.
Definition at line 650 of file AffineMap.h.
References mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getResults(), and mlir::AffineMap::isProjectedPermutation().
Referenced by mlir::vector::inferTransferOpMaskType().
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 vector
permutation = [2, 0, 1], this function leaves
inVec = ['c', 'a', 'b']`.
Definition at line 223 of file IndexingUtils.h.
References applyPermutation().
Referenced by commonPermutationOfPackAndUnPackOp(), computePackUnPackPerm(), mlir::tensor::computeTransposedType(), getPackOpResultTypeShape(), mlir::linalg::interchangeGenericOp(), mlir::linalg::lowerPack(), mlir::linalg::lowerUnPack(), permuteShape(), mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl(), vectorizeAsTensorPackOp(), and vectorizeAsTensorUnpackOp().
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().
|
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, /* ... *‍/); }
Definition at line 304 of file MlirOptMain.h.
References mlir::LogicalResult::succeeded().
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 665 of file TypeConverter.cpp.
References mlir::LLVMTypeConverter::convertCallingConventionType(), failure(), and success().
Referenced by mlir::LLVMTypeConverter::convertFunctionSignature().
void mlir::bindDims | ( | MLIRContext * | ctx, |
AffineExprTy &... | exprs | ||
) |
Bind a list of AffineExpr references to DimExpr at positions: [0 .
. sizeof...(exprs)]
Definition at line 349 of file AffineExpr.h.
Referenced by mlir::tensor::bubbleUpPadSlice(), buildLinearId(), calculateTileOffsetsAndSizes(), mlir::linalg::computeSliceParameters(), contractSupportsMMAMatrixType(), mlir::tensor::createPadHighOp(), createSubViewIntersection(), getBoundedTileSize(), mlir::affine::getDivMod(), mlir::nvgpu::getLaneIdAndValueIdToOperandCoord(), invertSliceIndexing(), mlir::linalg::lowerPack(), mlir::memref::multiBuffer(), mlir::linalg::offsetIndices(), mlir::linalg::packMatmulGreedily(), mlir::linalg::rewriteInIm2Col(), mlir::linalg::updateBoundsForCyclicDistribution(), and updateExpandedGenericOpRegion().
void mlir::bindDimsList | ( | MLIRContext * | ctx, |
MutableArrayRef< AffineExprTy > | exprs | ||
) |
Definition at line 354 of file AffineExpr.h.
References getAffineDimExpr().
Referenced by resolveSourceIndicesExpandShape().
void mlir::bindSymbols | ( | MLIRContext * | ctx, |
AffineExprTy &... | exprs | ||
) |
Bind a list of AffineExpr references to SymbolExpr at positions: [0 .
. sizeof...(exprs)]
Definition at line 363 of file AffineExpr.h.
Referenced by buildLinearId(), calculateTileOffsetsAndSizes(), getBoundedTileSize(), getCompressedMaskOp(), mlir::linalg::getConvolvedIndex(), getIndexProduct(), getIndicesForLoadOrStore(), mlir::memref::getLinearizedMemRefOffsetAndSize(), getOffsetForBitwidth(), invertSliceIndexing(), mlir::linalg::lowerPack(), mlir::affine::mapLoopToProcessorIds(), mlir::affine::mergeOffsetsSizesAndStrides(), mlir::linalg::packMatmulGreedily(), peelForLoop(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), and CopyBuilder::rewrite().
void mlir::bindSymbolsList | ( | MLIRContext * | ctx, |
MutableArrayRef< AffineExprTy > | exprs | ||
) |
Definition at line 368 of file AffineExpr.h.
References getAffineSymbolExpr().
Referenced by HopperBuilder::buildBarrierArriveTx(), HopperBuilder::buildTmaAsyncLoad(), computeLinearIndex(), and mlir::memref::getLinearizedMemRefOffsetAndSize().
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 878 of file BuiltinTypes.cpp.
References mlir::AffineMap::get(), get(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResult(), mlir::AffineMap::isIdentity(), makeCanonicalStridedLayoutExpr(), mlir::MemRefType::Builder::setLayout(), and simplifyAffineExpr().
Referenced by dropUnitDims(), and rankReducingSubviewDroppingUnitDims().
|
inline |
Returns the result of MLIR's ceildiv operation on constants.
The RHS is expected to be non-zero.
Definition at line 23 of file MathExtras.h.
Referenced by mlir::UnrankedMemRefDescriptor::computeSizes(), constantTripCount(), mlir::transform::gpu::CopyMappingInfo::CopyMappingInfo(), getBoundForAffineExpr(), getPackOpResultTypeShape(), mlir::affine::getTripCountMapAndOperands(), loopUnrollByFactor(), setInterTileBoundsParametric(), mlir::mesh::shardDimension(), simplifyCeilDiv(), and simplifyExprAndOperands().
Operation * mlir::clone | ( | OpBuilder & | b, |
Operation * | op, | ||
TypeRange | newResultTypes, | ||
ValueRange | newOperands | ||
) |
Definition at line 197 of file StructuredOpsUtils.cpp.
Referenced by cloneToCollapsedOp< LinalgOp >(), fuse(), mlir::linalg::rewriteAsPaddedOp(), mlir::vector::splitFullAndPartialTransfer(), and mlir::scf::tileAndFuseProducerOfSlice().
OpT mlir::clone | ( | OpBuilder & | b, |
OpT | op, | ||
TypeRange | newResultTypes, | ||
ValueRange | newOperands | ||
) |
Definition at line 145 of file StructuredOpsUtils.h.
Operation * mlir::cloneWithoutRegions | ( | OpBuilder & | b, |
Operation * | op, | ||
TypeRange | newResultTypes, | ||
ValueRange | newOperands | ||
) |
Definition at line 207 of file StructuredOpsUtils.cpp.
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 551 of file Utils.cpp.
References mlir::OpBuilder::create(), failure(), normalizeLoop(), replaceAllUsesInRegionWith(), mlir::OpBuilder::setInsertionPointToStart(), and success().
void mlir::collapseParallelLoops | ( | 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 608 of file Utils.cpp.
References mlir::OpBuilder::atBlockBegin(), mlir::OpBuilder::create(), mlir::Operation::erase(), normalizeLoop(), and replaceAllUsesInRegionWith().
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 >::matchAndRewrite().
Drop the dims that are listed in unusedDims
.
Definition at line 680 of file AffineMap.cpp.
References projectDims().
Referenced by compressUnusedDims().
Drop the symbols that are listed in unusedSymbols
.
Definition at line 694 of file AffineMap.cpp.
References projectSymbols().
Referenced by compressUnusedSymbols().
Drop the dims that are not used.
Definition at line 685 of file AffineMap.cpp.
References compressDims(), and getUnusedDimsBitVector().
Referenced by compressUnusedDims(), mlir::vector::inferTransferOpMaskType(), and reindexIndexingMap().
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 689 of file AffineMap.cpp.
References compressUnusedDims(), and compressUnusedListImpl().
Drop the symbols that are not used.
Definition at line 699 of file AffineMap.cpp.
References compressSymbols(), and getUnusedSymbolsBitVector().
Referenced by compressUnusedSymbols(), getProjectedMap(), and mlirAffineMapCompressUnusedSymbols().
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 703 of file AffineMap.cpp.
References compressUnusedListImpl(), and compressUnusedSymbols().
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().
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().
std::pair< AffineExpr, SmallVector< OpFoldResult > > mlir::computeLinearIndex | ( | OpFoldResult | sourceOffset, |
ArrayRef< int64_t > | strides, | ||
ArrayRef< Value > | indices | ||
) |
Definition at line 309 of file IndexingUtils.cpp.
References computeLinearIndex(), getAsIndexOpFoldResult(), getAsOpFoldResult(), and mlir::OpFoldResult::getContext().
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 278 of file IndexingUtils.cpp.
References bindSymbolsList(), and getContext().
Referenced by computeLinearIndex(), getFlatOffsetAndStrides(), and mlir::affine::linearizeIndex().
|
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().
|
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().
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(), mlir::linalg::lowerUnPack(), and mlir::linalg::packMatmulGreedily().
int64_t mlir::computeProduct | ( | ArrayRef< int64_t > | basis | ) |
Self-explicit.
Definition at line 91 of file IndexingUtils.cpp.
Referenced by HopperBuilder::buildTmaAsyncLoad(), checkMappingSpec(), commonLinearIdBuilderFn(), computeMaxLinearIndex(), and CopyBuilder::rewrite().
AffineExpr mlir::computeProduct | ( | MLIRContext * | ctx, |
ArrayRef< AffineExpr > | basis | ||
) |
Self-explicit.
Definition at line 167 of file IndexingUtils.cpp.
References getAffineConstantExpr().
std::optional< llvm::SmallDenseSet< unsigned > > mlir::computeRankReductionMask | ( | ArrayRef< int64_t > | originalShape, |
ArrayRef< int64_t > | reducedShape | ||
) |
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
.
Definition at line 420 of file BuiltinTypes.cpp.
Referenced by isRankReducedType().
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:
Definition at line 116 of file IndexingUtils.cpp.
References copy().
Referenced by mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl().
|
inline |
Definition at line 129 of file IndexingUtils.h.
References computeSuffixProduct().
|
inline |
Definition at line 47 of file IndexingUtils.h.
References computeSuffixProduct().
Referenced by commonLinearIdBuilderFn(), foreachIndividualVectorElement(), handleMultidimensionalVectors(), mlir::affine::linearizeIndex(), and mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl().
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().
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(), resolveSourceIndicesCollapseShape(), and resolveSourceIndicesExpandShape().
int64_t mlir::computeSum | ( | ArrayRef< int64_t > | basis | ) |
Self-explicit.
Definition at line 83 of file IndexingUtils.cpp.
Referenced by HopperBuilder::buildBarrierArriveTx().
AffineExpr mlir::computeSum | ( | MLIRContext * | ctx, |
ArrayRef< AffineExpr > | basis | ||
) |
Self-explicit.
Definition at line 159 of file IndexingUtils.cpp.
References getAffineConstantExpr().
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 107 of file TopologicalSortUtils.cpp.
Referenced by makeRegionIsolatedFromAbove().
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,
Returns the map:
Definition at line 800 of file AffineMap.cpp.
References mlir::AffineMap::get(), mlir::AffineMap::getNumResults(), and max().
Referenced by mlir::linalg::detail::canOpOperandsBeDroppedImpl(), and mlir::linalg::dropUnitDims().
void mlir::configureAMXLegalizeForExportTarget | ( | LLVMConversionTarget & | target | ) |
Configure the target to support lowering AMX ops to ops that map to LLVM intrinsics.
Definition at line 211 of file LegalizeForLLVMExport.cpp.
References mlir::ConversionTarget::addIllegalOp(), and mlir::ConversionTarget::addLegalOp().
void mlir::configureArmSMEToLLVMConversionLegality | ( | ConversionTarget & | target | ) |
Configure target to convert from the ArmSME dialect to LLVM intrinsics.
Definition at line 883 of file ArmSMEToLLVM.cpp.
References mlir::ConversionTarget::addIllegalDialect(), mlir::ConversionTarget::addLegalDialect(), and mlir::ConversionTarget::addLegalOp().
void mlir::configureArmSVELegalizeForExportTarget | ( | LLVMConversionTarget & | target | ) |
Configure the target to support lowering ArmSVE ops to ops that map to LLVM intrinsics.
Definition at line 175 of file LegalizeForLLVMExport.cpp.
References mlir::ConversionTarget::addIllegalOp(), and mlir::ConversionTarget::addLegalOp().
void mlir::configureGpuToNVVMConversionLegality | ( | ConversionTarget & | target | ) |
Configure target to convert from the GPU dialect to NVVM.
Definition at line 298 of file LowerGpuOpsToNVVMOps.cpp.
References mlir::ConversionTarget::addIllegalDialect(), mlir::ConversionTarget::addIllegalOp(), mlir::ConversionTarget::addLegalDialect(), and mlir::ConversionTarget::addLegalOp().
void mlir::configureGpuToROCDLConversionLegality | ( | ConversionTarget & | target | ) |
Configure target to convert from the GPU dialect to ROCDL.
Definition at line 327 of file LowerGpuOpsToROCDLOps.cpp.
References mlir::ConversionTarget::addIllegalDialect(), mlir::ConversionTarget::addIllegalOp(), mlir::ConversionTarget::addLegalDialect(), and mlir::ConversionTarget::addLegalOp().
void mlir::configureOpenMPToLLVMConversionLegality | ( | ConversionTarget & | target, |
LLVMTypeConverter & | typeConverter | ||
) |
Configure dynamic conversion legality of regionless operations from OpenMP to LLVM.
Definition at line 238 of file OpenMPToLLVM.cpp.
References mlir::ConversionTarget::addDynamicallyLegalOp().
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 680 of file SCFToGPU.cpp.
References mlir::ConversionTarget::addDynamicallyLegalOp(), mlir::ConversionTarget::addLegalDialect(), mlir::gpu::getMappingAttrName(), and kVisitedAttrName.
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().
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 241 of file StaticValueUtils.cpp.
References ceilDiv(), and getConstantIntValue().
Attribute mlir::constFoldBinaryOp | ( | ArrayRef< Attribute > | operands, |
CalculationT && | calculate | ||
) |
Definition at line 179 of file CommonFolders.h.
Attribute mlir::constFoldBinaryOp | ( | ArrayRef< Attribute > | operands, |
Type | resultType, | ||
CalculationT && | calculate | ||
) |
Definition at line 165 of file CommonFolders.h.
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().
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().
Attribute mlir::constFoldCastOp | ( | ArrayRef< Attribute > | operands, |
Type | resType, | ||
CalculationT && | calculate | ||
) |
Definition at line 269 of file CommonFolders.h.
Attribute mlir::constFoldUnaryOp | ( | ArrayRef< Attribute > | operands, |
CalculationT && | calculate | ||
) |
Definition at line 255 of file CommonFolders.h.
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.
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:
After control-flow sink:
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.
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.
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(), failure(), and success().
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 61 of file ODSSupport.cpp.
References emitError().
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 55 of file ODSSupport.cpp.
References emitError().
FailureOr< LLVM::LLVMFuncOp > mlir::convertFuncOpToLLVMFuncOp | ( | FunctionOpInterface | funcOp, |
ConversionPatternRewriter & | rewriter, | ||
const LLVMTypeConverter & | converter | ||
) |
Convert input FunctionOpInterface operation to LLVMFuncOp by using the provided LLVMTypeConverter.
Return failure if failed to so.
Definition at line 322 of file FuncToLLVM.cpp.
References mlir::LLVMTypeConverter::convertFunctionSignature(), mlir::ConversionPatternRewriter::convertRegionTypes(), mlir::LLVMTypeConverter::convertType(), mlir::OpBuilder::create(), failed(), filterFuncAttributes(), get(), mlir::Builder::getArrayAttr(), mlir::Builder::getContext(), mlir::Builder::getNamedAttr(), mlir::RewriterBase::inlineRegionBefore(), linkageAttrName, mlir::RewriterBase::notifyMatchFailure(), shouldUseBarePtrCallConv(), and varargsAttrName.
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::LLVM::LLVMStructType::getLiteral(), mlir::gpu::MMAMatrixType::getOperand(), mlir::gpu::MMAMatrixType::getShape(), and mlir::NVVM::inferMMAType().
FailureOr< Operation * > mlir::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.
Clones existing op with new result types and returns it.
Definition at line 3342 of file DialectConversion.cpp.
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().
SmallVector< ReassociationIndices, 2 > mlir::convertReassociationMapsToIndices | ( | OpBuilder & | b, |
ArrayRef< ReassociationExprs > | reassociationExprs | ||
) |
Convert Array<Array<AffineExpr>> to Array<Array<int64_t>>.
Definition at line 170 of file ReshapeOpsUtils.cpp.
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 169 of file Utils.cpp.
References convertScalarToComplexDtype(), convertScalarToFpDtype(), convertScalarToIntDtype(), emitWarning(), and mlir::Value::getType().
Referenced by mlir::linalg::createMul(), and mlir::sparse_tensor::genCast().
Attribute mlir::convertToAttribute | ( | MLIRContext * | ctx, |
ArrayRef< int64_t > | storage | ||
) |
Convert the provided ArrayRef<int64_t> to a DenseI64ArrayAttr attribute.
Definition at line 67 of file ODSSupport.cpp.
References mlir::detail::DenseArrayAttrImpl< T >::get().
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().
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 1237 of file VectorToGPU.cpp.
References getOpToConvert(), and mlir::LogicalResult::success().
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 1270 of file VectorToGPU.cpp.
References getOpToConvert().
std::unique_ptr< InterfacePass< FunctionOpInterface > > mlir::createAffineForToGPUPass | ( | ) |
Definition at line 76 of file SCFToGPUPass.cpp.
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.
std::unique_ptr< OperationPass< ModuleOp > > mlir::createAsyncFuncToAsyncRuntimePass | ( | ) |
Definition at line 906 of file AsyncToAsyncRuntime.cpp.
std::unique_ptr< Pass > mlir::createAsyncParallelForPass | ( | ) |
Definition at line 943 of file AsyncParallelFor.cpp.
std::unique_ptr< Pass > mlir::createAsyncParallelForPass | ( | bool | asyncDispatch, |
int32_t | numWorkerThreads, | ||
int32_t | minTaskSize | ||
) |
Definition at line 947 of file AsyncParallelFor.cpp.
std::unique_ptr< Pass > mlir::createAsyncRuntimePolicyBasedRefCountingPass | ( | ) |
Definition at line 563 of file AsyncRuntimeRefCounting.cpp.
std::unique_ptr< Pass > mlir::createAsyncRuntimeRefCountingOptPass | ( | ) |
Definition at line 234 of file AsyncRuntimeRefCountingOpt.cpp.
std::unique_ptr< Pass > mlir::createAsyncRuntimeRefCountingPass | ( | ) |
Definition at line 559 of file AsyncRuntimeRefCounting.cpp.
std::unique_ptr< OperationPass< ModuleOp > > mlir::createAsyncToAsyncRuntimePass | ( | ) |
Definition at line 901 of file AsyncToAsyncRuntime.cpp.
std::unique_ptr< Pass > mlir::createBufferizationToMemRefPass | ( | ) |
Definition at line 133 of file BufferizationToMemRef.cpp.
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().
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.
std::unique_ptr< Pass > mlir::createControlFlowSinkPass | ( | ) |
Creates a pass to perform control-flow sinking.
Definition at line 56 of file ControlFlowSink.cpp.
std::unique_ptr< Pass > mlir::createConvertAMDGPUToROCDLPass | ( | ) |
Definition at line 888 of file AMDGPUToROCDL.cpp.
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 74 of file ArmNeon2dToIntr.cpp.
std::unique_ptr< Pass > mlir::createConvertArmSMEToLLVMPass | ( | ) |
Create a pass to convert from the ArmSME dialect to LLVM intrinsics.
Definition at line 961 of file ArmSMEToLLVM.cpp.
std::unique_ptr< Pass > mlir::createConvertArmSMEToSCFPass | ( | ) |
Create a pass to convert a subset of ArmSME ops to SCF.
Definition at line 423 of file ArmSMEToSCF.cpp.
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().
std::unique_ptr< Pass > mlir::createConvertComplexToStandardPass | ( | ) |
Create a pass to convert Complex operations to the Standard dialect.
Definition at line 1176 of file ComplexToStandard.cpp.
Referenced by mlir::sparse_tensor::buildSparsifier().
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.
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.
std::unique_ptr< mlir::OperationPass< mlir::ModuleOp > > mlir::createConvertGpuLaunchFuncToVulkanLaunchFuncPass | ( | ) |
Definition at line 209 of file ConvertGPULaunchFuncToVulkanLaunchFunc.cpp.
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 163 of file GPUToSPIRVPass.cpp.
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.
std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertMathToLibmPass | ( | ) |
Create a pass to convert Math operations to libm calls.
Definition at line 211 of file MathToLibm.cpp.
Referenced by mlir::sparse_tensor::buildSparsifier().
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.
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.
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.
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 742 of file SCFToControlFlow.cpp.
Referenced by mlir::sparse_tensor::buildSparsifier().
std::unique_ptr<OperationPass<> > mlir::createConvertSCFToSPIRVPass | ( | ) |
Creates a pass to convert SCF ops into SPIR-V ops.
std::unique_ptr< Pass > mlir::createConvertShapeConstraintsPass | ( | ) |
Definition at line 71 of file ConvertShapeConstraints.cpp.
std::unique_ptr< OperationPass< ModuleOp > > mlir::createConvertShapeToStandardPass | ( | ) |
Definition at line 732 of file ShapeToStandard.cpp.
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.
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.
std::unique_ptr< Pass > mlir::createConvertToLLVMPass | ( | ) |
Create a pass that performs dialect conversion to LLVM for all dialects implementing ConvertToLLVMPatternInterface
.
Definition at line 132 of file ConvertToLLVMPass.cpp.
std::unique_ptr< Pass > mlir::createConvertVectorToArmSMEPass | ( | ) |
Create a pass to lower operations from the vector dialect to Arm SME.
Definition at line 38 of file VectorToArmSMEPass.cpp.
std::unique_ptr< Pass > mlir::createConvertVectorToGPUPass | ( | bool | useNvGpu = false | ) |
Convert from vector to GPU ops.
Definition at line 1341 of file VectorToGPU.cpp.
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 1549 of file VectorToSCF.cpp.
References options.
Referenced by mlir::sparse_tensor::buildSparsifier().
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.
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().
|
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.
std::unique_ptr< Pass > mlir::createForLoopPeelingPass | ( | ) |
Creates a pass that peels for loops at their upper bounds for better vectorization.
Definition at line 354 of file LoopSpecialization.cpp.
std::unique_ptr< Pass > mlir::createForLoopRangeFoldingPass | ( | ) |
Creates a pass which folds arith ops on induction variable into loop range.
Definition at line 89 of file LoopRangeFolding.cpp.
std::unique_ptr< Pass > mlir::createForLoopSpecializationPass | ( | ) |
Creates a pass that specializes for loop for unrolling and vectorization.
Definition at line 350 of file LoopSpecialization.cpp.
std::unique_ptr< Pass > mlir::createForToWhileLoopPass | ( | ) |
Definition at line 120 of file ForToWhile.cpp.
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.
std::unique_ptr< OperationPass< func::FuncOp > > mlir::createGpuAsyncRegionPass | ( | ) |
Rewrites a function region so that GPU ops execute asynchronously.
Definition at line 352 of file AsyncRegionRewriter.cpp.
std::unique_ptr< Pass > mlir::createGpuDecomposeMemrefsPass | ( | ) |
Pass decomposes memref ops inside gpu.launch
body.
Definition at line 232 of file DecomposeMemrefs.cpp.
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 453 of file KernelOutlining.cpp.
std::unique_ptr< Pass > mlir::createGpuLauchSinkIndexComputationsPass | ( | ) |
Pass that moves ops which are likely an index computation into gpu.launch body.
Definition at line 448 of file KernelOutlining.cpp.
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.
std::unique_ptr<Pass> mlir::createGpuSerializeToHsacoPass | ( | StringRef | triple, |
StringRef | arch, | ||
StringRef | features, | ||
int | optLevel | ||
) |
Create an instance of the GPU kernel function to HSAco binary serialization pass.
std::unique_ptr< Pass > mlir::createInlinerPass | ( | ) |
Creates a pass which inlines calls and callable operations as defined by the CallGraph.
Definition at line 178 of file InlinerPass.cpp.
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 182 of file InlinerPass.cpp.
References defaultInlinerOptPipeline().
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 186 of file InlinerPass.cpp.
std::unique_ptr< Pass > mlir::createLocationSnapshotPass | ( | ) |
Overload utilizing pass options for initialization.
Definition at line 157 of file LocationSnapshot.cpp.
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.
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().
std::unique_ptr< Pass > mlir::createLoopInvariantSubsetHoistingPass | ( | ) |
Creates a pass that hoists loop-invariant subset ops.
Definition at line 64 of file LoopInvariantCodeMotion.cpp.
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().
std::unique_ptr< Pass > mlir::createLowerForeachToSCFPass | ( | ) |
Definition at line 437 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
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 431 of file LowerGpuOpsToROCDLOps.cpp.
std::unique_ptr< Pass > mlir::createLowerSparseOpsToForeachPass | ( | ) |
Definition at line 428 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createLowerSparseOpsToForeachPass | ( | bool | enableRT, |
bool | enableConvert | ||
) |
Definition at line 433 of file SparseTensorPasses.cpp.
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 324 of file MapMemRefStorageClassPass.cpp.
std::unique_ptr< Pass > mlir::createOptReductionPass | ( | ) |
Definition at line 90 of file OptReductionPass.cpp.
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 331 of file OutlineShapeComputation.cpp.
std::unique_ptr< Pass > mlir::createParallelLoopFusionPass | ( | ) |
Creates a loop fusion pass which fuses parallel loops.
Definition at line 285 of file ParallelLoopFusion.cpp.
std::unique_ptr< Pass > mlir::createParallelLoopSpecializationPass | ( | ) |
Creates a pass that specializes parallel loop for unrolling and vectorization.
Definition at line 346 of file LoopSpecialization.cpp.
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.
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.
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.
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.
std::unique_ptr< Pass > mlir::createPreSparsificationRewritePass | ( | ) |
Definition at line 411 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createPrintIRPass | ( | const PrintIRPassOptions & | options = {} | ) |
Creates a pass to print IR on the debug stream.
Definition at line 33 of file PrintIR.cpp.
References options.
std::unique_ptr< Pass > mlir::createPrintOpGraphPass | ( | raw_ostream & | os = llvm::errs() | ) |
Creates a pass to print op graphs.
Definition at line 363 of file ViewOpGraph.cpp.
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 119 of file OpStats.cpp.
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 115 of file OpStats.cpp.
std::unique_ptr< Pass > mlir::createReconcileUnrealizedCastsPass | ( | ) |
Creates a pass that eliminates noop unrealized_conversion_cast
operation sequences.
Definition at line 132 of file ReconcileUnrealizedCasts.cpp.
Referenced by mlir::sparse_tensor::buildSparsifier().
std::unique_ptr< Pass > mlir::createReductionTreePass | ( | ) |
Definition at line 259 of file ReductionTreePass.cpp.
std::unique_ptr< Pass > mlir::createRemoveDeadValuesPass | ( | ) |
Creates an optimization pass to remove dead values.
Definition at line 609 of file RemoveDeadValues.cpp.
std::unique_ptr< OperationPass< func::FuncOp > > mlir::createRemoveShapeConstraintsPass | ( | ) |
Definition at line 70 of file RemoveShapeConstraints.cpp.
Value mlir::createScalarOrSplatConstant | ( | OpBuilder & | builder, |
Location | loc, | ||
Type | type, | ||
const APFloat & | value | ||
) |
Definition at line 226 of file Utils.cpp.
References mlir::OpBuilder::createOrFold(), mlir::DenseElementsAttr::get(), and mlir::Builder::getFloatAttr().
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 201 of file Utils.cpp.
References mlir::OpBuilder::create(), mlir::DenseElementsAttr::get(), and mlir::Builder::getIntegerAttr().
Referenced by clampInput(), constructResultVector(), and createScalarOrSplatConstant().
Value mlir::createScalarOrSplatConstant | ( | OpBuilder & | builder, |
Location | loc, | ||
Type | type, | ||
int64_t | value | ||
) |
Definition at line 214 of file Utils.cpp.
References createScalarOrSplatConstant().
std::unique_ptr< Pass > mlir::createSCCPPass | ( | ) |
std::unique_ptr< Pass > mlir::createSCFBufferizePass | ( | ) |
Creates a pass that bufferizes the SCF dialect.
Definition at line 45 of file Bufferize.cpp.
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.
std::unique_ptr< OperationPass< func::FuncOp > > mlir::createShapeBufferizePass | ( | ) |
Definition at line 47 of file Bufferize.cpp.
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.
std::unique_ptr< Pass > mlir::createSparseAssembler | ( | ) |
Definition at line 396 of file SparseTensorPasses.cpp.
std::unique_ptr< Pass > mlir::createSparseBufferRewritePass | ( | ) |
Definition at line 456 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparseBufferRewritePass | ( | bool | enableBufferInitialization | ) |
Definition at line 461 of file SparseTensorPasses.cpp.
std::unique_ptr< Pass > mlir::createSparseGPUCodegenPass | ( | ) |
Definition at line 477 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::buildSparsifier(), and mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparseGPUCodegenPass | ( | unsigned | numThreads, |
bool | enableRT | ||
) |
Definition at line 481 of file SparseTensorPasses.cpp.
std::unique_ptr< Pass > mlir::createSparseReinterpretMapPass | ( | ) |
Definition at line 400 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparseReinterpretMapPass | ( | ReinterpretMapScope | scope | ) |
Definition at line 405 of file SparseTensorPasses.cpp.
References options.
std::unique_ptr< Pass > mlir::createSparseTensorCodegenPass | ( | ) |
Definition at line 445 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparseTensorCodegenPass | ( | bool | createSparseDeallocs, |
bool | enableBufferInitialization | ||
) |
Definition at line 450 of file SparseTensorPasses.cpp.
std::unique_ptr< Pass > mlir::createSparseTensorConversionPass | ( | ) |
Definition at line 441 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparseVectorizationPass | ( | ) |
Definition at line 465 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparseVectorizationPass | ( | unsigned | vectorLength, |
bool | enableVLAVectorization, | ||
bool | enableSIMDIndex32 | ||
) |
Definition at line 470 of file SparseTensorPasses.cpp.
std::unique_ptr< mlir::Pass > mlir::createSparsificationAndBufferizationPass | ( | ) |
Definition at line 213 of file SparsificationAndBufferizationPass.cpp.
References getBufferizationOptionsForSparsification().
Referenced by mlir::sparse_tensor::buildSparsifier().
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 | ||
) |
Definition at line 227 of file SparsificationAndBufferizationPass.cpp.
std::unique_ptr< Pass > mlir::createSparsificationPass | ( | ) |
Definition at line 415 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createSparsificationPass | ( | const SparsificationOptions & | options | ) |
Definition at line 420 of file SparseTensorPasses.cpp.
References options.
std::unique_ptr< Pass > mlir::createStageSparseOperationsPass | ( | ) |
Definition at line 424 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation().
std::unique_ptr< Pass > mlir::createStorageSpecifierToLLVMPass | ( | ) |
Definition at line 486 of file SparseTensorPasses.cpp.
Referenced by mlir::sparse_tensor::buildSparsifier().
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().
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.
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.
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 106 of file ParallelLoopCollapsing.cpp.
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.
|
static |
Definition at line 28 of file DebugStringHelper.h.
std::pair< ArrayAttr, SmallVector< Value > > mlir::decomposeMixedValues | ( | Builder & | b, |
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 188 of file StaticValueUtils.cpp.
References mlir::Builder::getI64ArrayAttr().
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().
SmallVector< AffineExpr > mlir::delinearize | ( | AffineExpr | linearIndex, |
ArrayRef< int64_t > | strides | ||
) |
Definition at line 194 of file IndexingUtils.cpp.
References delinearize(), getAffineConstantExprs(), and mlir::AffineExpr::getContext().
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(), delinearize(), foreachIndividualVectorElement(), mlir::detail::TileOffsetRangeImpl::getDynamicTileOffsets(), mlir::detail::TileOffsetRangeImpl::getStaticTileOffsets(), handleMultidimensionalVectors(), and resolveSourceIndicesCollapseShape().
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 51 of file StaticValueUtils.cpp.
Referenced by 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 64 of file StaticValueUtils.cpp.
References dispatchIndexOpFoldResult().
Referenced by mlir::tensor::bubbleUpPadSlice().
void mlir::eliminateCommonSubExpressions | ( | RewriterBase & | rewriter, |
DominanceInfo & | domInfo, | ||
Operation * | op, | ||
bool * | changed = nullptr |
||
) |
|
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 definiteFailureHelper().
|
inline |
Definition at line 247 of file DiagnosedSilenceableFailure.h.
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 applyPassManagerCLOptions(), mlir::ROCDL::SerializeGPUModuleBase::assembleIsa(), buildSequentialConstant(), mlir::transform::detail::checkApplyToOne(), mlir::transform::detail::checkNestedConsumption(), checkTensorElementType(), mlir::LLVM::ModuleImport::convertDataLayout(), convertDenseArrayFromAttr(), convertDenseResourceElementsAttr(), convertFromAttribute(), mlir::LLVM::ModuleImport::convertGlobals(), convertOmpSections(), mlir::LLVM::ModuleImport::convertValue(), mlir::ControlFlowToSCFTransformation::createUnreachableTerminator(), 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(), mlir::gpu::MMAMatrixType::getChecked(), mlir::DynamicAttr::getChecked(), mlir::DynamicType::getChecked(), mlir::DataLayoutSpecAttr::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(), mlir::LLVM::LLVMStructType::getIdentifiedChecked(), getInsertExtractValueElementType(), mlir::LLVM::LLVMStructType::getLiteralChecked(), mlir::LLVM::detail::getLLVMConstant(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), mlir::LLVM::LLVMStructType::getOpaqueChecked(), getOrInsertBuiltinVariable(), getScalarConstantAsAttr(), mlir::tracing::InstallDebugHandler::Impl::Impl(), mlir::LLVMImportInterface::initializeImport(), mlir::transform::detail::interpreterBaseInitializeImpl(), mlir::transform::detail::interpreterBaseRunOnOperationImpl(), irdlAttrOrTypeVerifier(), loadIRDLDialects(), mlirEmitError(), mlirLLVMStructTypeLiteralGetChecked(), mlirReduceMain(), mlir::transform::detail::parseTransformModuleFromFile(), readBytecodeFileImpl(), registerFromLLVMIRTranslation(), reshapeLikeShapesAreCompatible(), mlir::OperationName::setOpPropertiesFromAttribute(), mlir::MlirOptMainConfig::setPassPipelineParser(), mlir::DynamicOpDefinition::setPropertiesFromAttr(), mlir::RegisteredOperationName::Model< ConcreteOp >::setPropertiesFromAttr(), translateDataLayout(), mlir::DynamicAttrDefinition::verify(), mlir::DynamicTypeDefinition::verify(), mlir::DataLayoutSpecAttr::verify(), mlir::gpu::MMAMatrixType::verify(), mlir::LLVM::LLVMStructType::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::spirv::InterfaceVarABIAttr::verify(), mlir::spirv::VerCapExtAttr::verify(), mlir::spirv::MatrixType::verify(), mlir::quant::CalibratedQuantizedType::verify(), mlir::spirv::SampledImageType::verify(), mlir::quant::UniformQuantizedPerAxisType::verify(), mlir::quant::UniformQuantizedType::verify(), mlir::quant::QuantizedType::verify(), mlir::quant::AnyQuantizedType::verify(), mlir::irdl::RegionConstraint::verify(), mlir::detail::verifyAffineMapAsLayout(), mlir::detail::verifyDataLayoutSpec(), verifyDimensionCompatibility(), mlir::LLVM::LLVMStructType::verifyEntries(), verifyGatherOperandAndResultShape(), verifyInGroupDevice(), mlir::OperationName::verifyInherentAttrs(), mlir::RegisteredOperationName::Model< ConcreteOp >::verifyInherentAttrs(), verifyMeshAxes(), verifyRegionAttribute(), verifyScatterOrSliceOperandAndResultShape(), and verifyVectorConstructionInvariants().
InFlightDiagnostic mlir::emitError | ( | Location | loc, |
const Twine & | message | ||
) |
Definition at line 329 of file Diagnostics.cpp.
References emitDiag(), and Error.
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 491 of file Diagnostics.h.
References mlir::InFlightDiagnostic::append(), emitError(), and failure().
LogicalResult mlir::emitOptionalRemark | ( | std::optional< Location > | loc, |
Args &&... | args | ||
) |
Definition at line 503 of file Diagnostics.h.
References mlir::InFlightDiagnostic::append(), emitRemark(), and failure().
LogicalResult mlir::emitOptionalWarning | ( | std::optional< Location > | loc, |
Args &&... | args | ||
) |
Definition at line 497 of file Diagnostics.h.
References mlir::InFlightDiagnostic::append(), emitWarning(), and failure().
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().
InFlightDiagnostic mlir::emitRemark | ( | Location | loc, |
const Twine & | message | ||
) |
Definition at line 345 of file Diagnostics.cpp.
References emitDiag(), and Remark.
|
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(), mlir::transform::expandTargetSpecification(), isOpSibling(), and pipelineForSharedCopies().
|
inline |
Definition at line 262 of file DiagnosedSilenceableFailure.h.
InFlightDiagnostic mlir::emitWarning | ( | Location | loc | ) |
Utility method to emit a warning message using this location.
Emit a warning message using this location.
Definition at line 334 of file Diagnostics.cpp.
Referenced by mlir::LLVM::ModuleImport::convertDataLayout(), convertScalarToDtype(), emitOptionalWarning(), mlir::ImplicitLocOpBuilder::emitWarning(), mlir::Operation::emitWarning(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::LLVM::ModuleImport::processFunction(), processPassthroughAttrs(), and mlir::LLVM::detail::LoopAnnotationImporter::translateAccessGroup().
InFlightDiagnostic mlir::emitWarning | ( | Location | loc, |
const Twine & | message | ||
) |
Definition at line 337 of file Diagnostics.cpp.
References emitDiag(), and Warning.
void mlir::encodeBindAttribute | ( | ModuleOp | module | ) |
Encodes global variable's descriptor set and binding into its name if they both exist.
Definition at line 1703 of file SPIRVToLLVM.cpp.
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 179 of file RegionUtils.cpp.
References mlir::Region::begin(), mlir::Region::empty(), and mlir::Region::end().
Referenced by simplifyRegions().
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 917 of file AffineMap.cpp.
References mlir::AffineMap::compose(), mlir::AffineMap::dropResults(), mlir::AffineMap::getContext(), and mlir::AffineMap::getMultiDimIdentityMap().
Definition at line 865 of file Utils.cpp.
References ceilDivPositive(), mlir::OpBuilder::create(), getPerfectlyNestedLoopsImpl(), tile(), and tryIsolateBands().
SmallVector<IntTy> mlir::extractFromIntegerArrayAttr | ( | Attribute | attr | ) |
Extract integer values from the assumed ArrayAttr of IntegerAttr.
Definition at line 64 of file StaticValueUtils.h.
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(), failed(), failure(), mlir::MLIRContext::isMultithreadingEnabled(), mlir::ParallelDiagnosticHandler::setOrderIDForThread(), and success().
Referenced by failableParallelForEach(), failableParallelForEachN(), and parallelForEach().
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().
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().
|
inline |
Utility function that returns true if the provided LogicalResult corresponds to a failure value.
Definition at line 72 of file LogicalResult.h.
References mlir::LogicalResult::failed().
Referenced by mlir::affine::FlatAffineValueConstraints::addAffineForOpDomain(), mlir::affine::FlatAffineValueConstraints::addAffineParallelOpDomain(), mlir::ValueBoundsConstraintSet::addBound(), mlir::FlatLinearConstraints::addBound(), mlir::affine::FlatAffineValueConstraints::addDomainFromSliceMaps(), mlir::affine::FlatAffineValueConstraints::addInductionVarOrTerminalSymbol(), mlir::presburger::Simplex::addInequality(), addInitOperandsToLoopNest(), addMissingLoopIVBounds(), addShardOp(), mlir::affine::FlatAffineValueConstraints::addSliceBounds(), mlir::PassPipelineCLParser::addToPipeline(), mlir::affine::affineDataCopyGenerate(), mlir::bufferization::allocateTensorForShapedValue(), analyzeProfitability(), appendMangledType(), mlir::PassReproducerOptions::apply(), applyPatternsAndFoldGreedily(), applyTilingToAll(), mlir::lsp::TextDocumentContentChangeEvent::applyTo(), mlir::transform::TransformState::applyTransform(), mlir::transform::applyTransformNamedSequence(), mlir::transform::applyTransforms(), mlir::ValueBoundsConstraintSet::areEqual(), mlir::ValueBoundsConstraintSet::areEquivalentSlices(), mlir::ValueBoundsConstraintSet::areOverlappingSlices(), mlir::transform::detail::assembleTransformLibraryFromPaths(), mlir::bufferization::bufferizeBlockSignature(), mlir::bufferization::bufferizeModuleOp(), mlir::linalg::bufferizeToAllocation(), mlir::bufferization::BufferizeTypeConverter::BufferizeTypeConverter(), mlir::tensor::buildIndependentOp(), MmaSyncBuilder::buildMmaSync(), buildPackingLoopNestImpl(), mlir::LLVMTypeConverter::canConvertToBarePtr(), canonicalizeMapExprAndTermOrder(), castAllocFuncResult(), mlir::bufferization::castOrReallocMemRefValue(), castToSourceType(), ValueEquivalenceCache::checkCommutativeEquivalent(), checkIfHyperRectangular(), mlir::affine::checkMemrefAccessDependence(), checkOperandAffineExpr(), checkOperandAffineExprRecursively(), mlir::pdll::codegenPDLLToMLIR(), mlir::DataLayoutSpecAttr::combineWith(), mlir::FlatLinearConstraints::composeMatchingMap(), computeCollapsedLayoutMap(), computeExpandedLayoutMap(), computeMemRefRankReductionMask(), computePaddedShape(), mlir::presburger::computeSingleVarRepr(), mlir::affine::computeSliceUnion(), mlir::presburger::SymbolicLexSimplex::computeSymbolicIntegerLexMin(), mlir::presburger::IntegerRelation::constantFoldVarRange(), convertAffineLoopNestToGPULaunch(), mlir::TypeConverter::convertBlockSignature(), mlir::lsp::MLIRServer::convertFromBytecode(), convertFuncOpToLLVMFuncOp(), convertFuncOpTypes(), mlir::LLVM::ModuleImport::convertFunctions(), mlir::LLVMTypeConverter::convertFunctionSignature(), mlir::LLVM::ModuleImport::convertGlobals(), mlir::LLVM::ModuleImport::convertIntrinsicArguments(), mlir::LLVM::ModuleImport::convertMetadata(), mlir::detail::ConversionPatternRewriterImpl::convertNonEntryRegionTypes(), convertOmpAtomicCapture(), convertOmpAtomicUpdate(), convertOmpOpRegions(), convertOmpParallel(), convertOmpReductionOp(), convertOmpSimdLoop(), convertOmpWsLoop(), mlir::detail::ConversionPatternRewriterImpl::convertRegionTypes(), mlir::TypeConverter::convertSignatureArg(), mlir::TypeConverter::convertSignatureArgs(), convertStructTypePacked(), convertStructTypeWithOffset(), mlir::TypeConverter::convertType(), mlir::TypeConverter::convertTypes(), mlir::LLVM::ModuleImport::convertValues(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::PassPipelineOptions< T >::createFromString(), createIfNonNull(), createSingleExitingLatch(), mlir::affine::delinearizeIndex(), mlir::spirv::Deserializer::deserialize(), mlir::spirv::deserialize(), mlir::presburger::Simplex::detectRedundant(), didntSucceed(), mlir::Inliner::doInlining(), doubleBuffer(), encodeKernelName(), mlir::tosa::EqualizeRanks(), failableParallelForEach(), mlir::FailureOr< T >::FailureOr(), mlir::detail::OpPassManagerImpl::finalizePassList(), mlir::presburger::LexSimplex::findIntegerLexMin(), findOptimal(), mlir::presburger::LexSimplex::findRationalLexMin(), mlir::FlatLinearValueConstraints::FlatLinearValueConstraints(), mlir::FlatLinearConstraints::flattenAlignedMapAndMergeLocals(), foldLoopBounds(), mlir::bufferization::foldToMemrefToTensorPair(), forwardPassthroughAttributes(), mlir::FrozenRewritePatternSet::FrozenRewritePatternSet(), fuseWithReshapeByExpansion(), mlir::linalg::generalizeNamedOp(), mlir::affine::generateCopyForMemRegion(), generateLoopNestUsingForallOp(), generateLoopNestUsingForOp(), mlir::affine::MemRefAccess::getAccessRelation(), mlir::affine::ComputationSliceState::getAsConstraints(), mlir::FlatLinearConstraints::getAsIntegerSet(), getBoundForAffineExpr(), mlir::bufferization::getBuffer(), getCanonicalSubViewResultType(), getCastCompatibleMemRefType(), mlir::DynamicAttr::getChecked(), mlir::DynamicType::getChecked(), mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getChecked(), getConstantIntValues(), getConstantOffset(), getConstantStrides(), mlir::ConvertToLLVMPattern::getElementPtrType(), mlir::spirv::StructType::getEmpty(), mlir::affine::FlatAffineValueConstraints::getIneqAsAffineValueMap(), mlir::nvgpu::getLaneIdAndValueIdToOperandCoord(), getMemoryFootprintBytes(), mlir::LLVM::LLVMStructType::getNewIdentified(), mlir::spirv::getOpenCLElementPtr(), mlir::tensor::getOrCreateDestination(), mlir::affine::getRelationFromMap(), mlir::ConversionPatternRewriter::getRemappedValue(), mlir::affine::ComputationSliceState::getSourceAsConstraints(), getStaticallyKnownRowStride(), getStridesAndOffset(), getStridesAndOffset(), getTypeNumBytes(), mlir::spirv::getVulkanElementPtr(), getWrittenToFields(), mlir::detail::PassOptions::ListOption< DataType, OptionParser >::handleOccurrence(), hasFullyDynamicLayoutMap(), haveCompatibleStrides(), mlir::linalg::hoistPaddingOnTensors(), mlir::linalg::hoistRedundantVectorTransfers(), hoistSubsetAtIterArg(), mlir::linalg::inferContractionDims(), mlir::DataFlowSolver::initializeAndRun(), VectorizationState::initState(), inlineConvertOmpRegions(), mlir::Inliner::Impl::inlineSCC(), mlir::linalg::interchangeGenericOp(), interleaveWithError(), mlir::transform::detail::interpreterBaseInitializeImpl(), mlir::transform::detail::interpreterBaseRunOnOperationImpl(), irdlAttrOrTypeVerifier(), mlir::DiagnosedSilenceableFailure::isDefiniteFailure(), mlir::OperationEquivalence::isEquivalentTo(), isFusionProfitable(), mlir::Tester::isInteresting(), mlir::affine::ComputationSliceState::isMaximal(), isMemRefTypeSupported(), isOpSibling(), mlir::affine::ComputationSliceState::isSliceValid(), mlir::memref::isStaticShapeAndContiguousRowMajor(), JitRunnerMain(), mlir::AsmParser::KeywordSwitch< ResultT >::KeywordSwitch(), mlir::LLVMTypeConverter::LLVMTypeConverter(), mlir::LLVM::ModuleToObject::loadBitcodeFile(), mlir::NVVM::SerializeGPUModuleBase::loadBitcodeFiles(), mlir::ROCDL::SerializeGPUModuleBase::loadBitcodeFiles(), mlir::SymbolTable::lookupSymbolIn(), mlir::SymbolTableCollection::lookupSymbolIn(), mlir::LockedSymbolTableCollection::lookupSymbolIn(), mlir::affine::loopUnrollByFactor(), loopUnrollByFactor(), mlir::affine::loopUnrollJamByFactor(), lowerAsEntryFunction(), lowerEntryPointABIAttr(), makeAtomicReductionGen(), mlir::affine::makeComposedFoldedAffineApply(), makeComposedFoldedMinMax(), makeIndependent(), makeReductionGen(), ConvertTypesInSCFForOp::matchAndRewrite(), mlir::LLVM::CanonicalizeAlignedGep::matchAndRewrite(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::LLVM::SplitStores::matchAndRewrite(), CanonicalizeAffineMinMaxOpExprAndTermOrder< T >::matchAndRewrite(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), mlir::BytecodeReader::Impl::materializeAll(), mlirInferShapedTypeOpInterfaceInferReturnTypes(), mlirInferTypeOpInterfaceInferReturnTypes(), mlirMemRefTypeGetStridesAndOffset(), MlirOptMain(), mlirQueryMain(), mlirReduceMain(), mlir::arith::NarrowTypeEmulationConverter::NarrowTypeEmulationConverter(), NAryInferReturnTypes(), mlir::affine::normalizeMemRef(), mlir::affine::normalizeMemRefType(), mlir::ParseResult::operator bool(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), mlir::amdgpu::optimizeSharedMemoryReadsAndWrites(), mlir::amdgpu::optimizeSharedMemoryReadsAndWritesOp(), outlineIfOp(), mlir::linalg::pack(), mlir::linalg::packMatmulGreedily(), mlir::linalg::padAndHoistLinalgOp(), padOperandToSmallestStaticBoundingBox(), mlir::DataLayoutEntryAttr::parse(), mlir::DataLayoutSpecAttr::parse(), mlir::FieldParser< ContainerT, std::enable_if_t< llvm::is_detected< detail::has_push_back_t, ContainerT >::value, ContainerT > >::parse(), mlir::FieldParser< AffineMap >::parse(), mlir::DynamicAttr::parse(), mlir::DynamicType::parse(), llvm::cl::detail::VectorParserBase< VectorT, ElementT >::parse(), parseAlignedClause(), parseArrayType(), mlir::DynamicDialect::parseAttribute(), mlir::detail::Parser::parseAttribute(), parseAttributions(), parseBindName(), parseBound(), parseClauseWithRegionArgs(), mlir::detail::pass_options::parseCommaSeparatedList(), parseCommonStructuredOpParts(), parseCopyPrivateVarList(), parseCreateOperationOpResults(), mlir::detail::Parser::parseDecOrHexAttr(), mlir::detail::Parser::parseDenseResourceElementsAttr(), parseDependVarList(), parseDeviceTypeArrayAttr(), parseDeviceTypeOperands(), parseDeviceTypeOperandsWithKeywordOnly(), parseDeviceTypeOperandsWithSegment(), parseDialectGrouping(), mlir::detail::Parser::parseDialectSymbolBody(), parseDimensionList(), mlir::detail::Parser::parseDimensionListRanked(), mlir::sparse_tensor::ir_detail::DimLvlMapParser::parseDimLvlMap(), parseDstStyleOp(), parseDynamicIndexList(), parseEntry(), parseExpressedTypeAndRange(), parseExtTypeParams(), mlir::detail::AsmParserImpl< BaseT >::parseFloat(), mlir::function_interface_impl::parseFunctionOp(), parseFunctionResultList(), parseGangClause(), parseGEPIndices(), parseInterfaceVarABIAttr(), parseKeywordList(), mlir::AsmParser::parseKeywordOrString(), mlir::sparse_tensor::ir_detail::LvlTypeParser::parseLvlType(), parseMultitileSizesTypes(), parseNumGangs(), parseOptionalArrayStride(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalAttrDictWithKeyword(), parseOptionalCallFuncPtr(), mlir::AsmParser::parseOptionalInteger(), parseOptionalInterchange(), parseParallelRegion(), parsePassPipeline(), parseQuantParams(), parseReductionVarList(), mlir::AsmParser::parseResourceHandle(), mlir::detail::Parser::parseResourceHandle(), parseRoutineGangClause(), parseRuntimeArrayType(), parseSequenceOpOperands(), parseSingleBlockRegion(), mlir::detail::parseSourceFile(), parseSourceString(), parseStorageRange(), mlir::detail::Parser::parseStridedLayoutAttr(), parseStructMemberDecorations(), parseStructType(), parseSwitchOpCases(), mlir::AsmParser::parseSymbolName(), parseSymOperandList(), parseSynchronizationHint(), mlir::detail::Parser::parseTensorType(), parseTokenOrdering(), mlir::OpAsmParser::parseTrailingOperandList(), mlir::DynamicDialect::parseType(), parseTypedInitialValue(), mlir::tosa::parseTypeOrAttr(), parseWaitClause(), mlir::detail::DenseArrayAttrImpl< T >::parseWithoutBraces(), mlir::PassPipelineRegistration< Options >::PassPipelineRegistration(), pdllConvertValues(), mlir::scf::pipelineForLoop(), pipelineForSharedCopies(), mlir::memref::populateMemRefNarrowTypeEmulationConversions(), prepareLLVMModule(), print(), printBinaryOperation(), printCallOperation(), printConstantOp(), mlir::AsmPrinter::Impl::printLocation(), printOperation(), printStructType(), printUnaryOperation(), mlir::bufferization::promoteBufferResultsToOutParams(), mlir::linalg::promoteSubviewAsNewBuffer(), promoteSubViews(), mlir::linalg::promoteSubViews(), mlir::BytecodeReader::Impl::read(), mlir::DialectBytecodeReader::readAttribute(), mlir::DialectBytecodeReader::readList(), mlir::DialectBytecodeReader::readOptionalAttribute(), mlir::DialectBytecodeReader::readResourceHandle(), readResourceHandle(), mlir::DialectBytecodeReader::readSparseArray(), mlir::DialectBytecodeReader::readType(), mlir::DialectBytecodeReader::readVarIntWithFlag(), mlir::ReductionNode::ReductionNode(), registerConversionPDLFunctions(), reifyValueBound(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::SymbolTable::renameToUnique(), mlir::tensor::replaceExtractSliceWithTiledProducer(), mlir::memref::replaceWithIndependentOp(), mlir::AsmParserState::Impl::resolveSymbolUses(), mlir::linalg::rewriteAsPaddedOp(), mlir::linalg::rewriteInDestinationPassingStyle(), roundTripModule(), mlir::LLVM::ModuleToObject::run(), mlir::bufferization::runOneShotModuleBufferize(), mlir::sparse_tensor::SparsificationAndBufferizationPass::runOnOperation(), runTransformOnCGSCCs(), mlir::affine::separateFullTiles(), mlir::spirv::Serializer::serialize(), serializeModule(), mlir::MlirOptMainConfig::setPassPipelineParser(), simplifyAffineExpr(), splitAndProcessBuffer(), tileAndFuseFirstExtractUse(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), mlir::scf::tileAndFuseProducerOfSlice(), mlir::scf::tileConsumerAndFuseProducersUsingSCF(), mlir::affine::tilePerfectlyNested(), mlir::affine::tilePerfectlyNestedParametric(), transformCFGToSCF(), transformCyclesToSCFLoops(), transformToStructuredCFBranches(), translateDataLayout(), translateLLVMIRToModule(), mlir::DenseElementsAttr::try_value_begin(), mlir::DenseElementsAttr::try_value_end(), mlir::AsmParser::tryStartCyclicParse(), mlir::AsmPrinter::tryStartCyclicPrint(), mlir::linalg::unrollIndex(), mlir::lsp::PDLLServer::updateDocument(), mlir::lsp::TableGenServer::updateDocument(), updateSubElementImpl(), mlir::affine::vectorizeAffineLoopNest(), vectorizeLinalgOpPrecondition(), vectorizeLoops(), vectorizePackOpPrecondition(), vectorizePadOpPrecondition(), vectorizeUnPackOpPrecondition(), mlir::irdl::DynParametricAttrConstraint::verify(), mlir::irdl::DynParametricTypeConstraint::verify(), mlir::irdl::AllOfConstraint::verify(), mlir::quant::UniformQuantizedPerAxisType::verify(), mlir::quant::UniformQuantizedType::verify(), mlir::quant::AnyQuantizedType::verify(), mlir::irdl::RegionConstraint::verify(), verifyAllToAllOperandAndResultShape(), verifyCompatibleShapes(), mlir::detail::verifyDataLayoutSpec(), verifyGatherOperandAndResultShape(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), verifyScatterOrSliceOperandAndResultShape(), mlir::AffineExprVisitor< SubClass, LogicalResult >::walkPostOrder(), walkReturnOperations(), and mlir::arith::WideIntEmulationConverter::WideIntEmulationConverter().
|
inline |
Utility function to generate a LogicalResult.
If isFailure is true a failure
result is generated, otherwise a 'success' result is generated.
Definition at line 62 of file LogicalResult.h.
References mlir::LogicalResult::failure().
Referenced by mlir::affine::FlatAffineValueConstraints::addAffineForOpDomain(), mlir::affine::FlatAffineValueConstraints::addAffineParallelOpDomain(), mlir::FlatLinearConstraints::addBound(), mlir::affine::FlatAffineValueConstraints::addDomainFromSliceMaps(), mlir::scf::addLoopRangeConstraints(), addMissingLoopIVBounds(), addShardOp(), mlir::affine::FlatAffineValueConstraints::addSliceBounds(), mlir::PassPipelineCLParser::addToPipeline(), mlir::affine::affineDataCopyGenerate(), mlir::affine::affineParallelize(), mlir::bufferization::allocateTensorForShapedValue(), analyzeProfitability(), appendMangledType(), mlir::NVVM::SerializeGPUModuleBase::appendStandardLibs(), mlir::ROCDL::SerializeGPUModuleBase::appendStandardLibs(), mlir::PassReproducerOptions::apply(), applyPassManagerCLOptions(), applyTilingToAll(), mlir::lsp::TextDocumentContentChangeEvent::applyTo(), mlir::transform::applyTransforms(), mlir::ValueBoundsConstraintSet::areEqual(), mlir::ValueBoundsConstraintSet::areEquivalentSlices(), mlir::ValueBoundsConstraintSet::areOverlappingSlices(), mlir::transform::detail::assembleTransformLibraryFromPaths(), barePtrFuncArgTypeConverter(), mlir::tensor::bubbleUpPadSlice(), mlir::bufferization::bufferizeBlockSignature(), mlir::bufferization::bufferizeModuleOp(), mlir::tensor::buildIndependentOp(), MmaSyncBuilder::buildMmaSync(), mlir::linalg::detail::buildPackingLoopNest(), buildPackingLoopNestImpl(), calculateMemoryRequirements(), canCollapseShapeBeSimplifiedByRankReducingSlice(), mlir::affine::AffineValueMap::canonicalize(), canonicalizeLoopBounds(), canonicalizeMapExprAndTermOrder(), mlir::vector::castAwayContractionLeadingOneDim(), mlir::bufferization::castOrReallocMemRefValue(), checkAndCollapseInnerZeroIndices(), mlir::DiagnosedSilenceableFailure::checkAndReport(), mlir::transform::detail::checkApplyToOne(), checkCapabilityRequirements(), ValueEquivalenceCache::checkCommutativeEquivalent(), checkCorrectAnyOf(), checkDeviceTypes(), checkExtensionRequirements(), checkIfHyperRectangular(), checkOperandAffineExpr(), checkOperandAffineExprRecursively(), checkTransformationPreconditions(), mlir::affine::coalesceLoops(), coalesceLoops(), mlir::detail::Parser::codeCompleteDialectName(), mlir::detail::Parser::codeCompleteDialectOrElidedOpName(), mlir::detail::Parser::codeCompleteExpectedTokens(), mlir::detail::Parser::codeCompleteOperationName(), mlir::detail::Parser::codeCompleteOptionalTokens(), mlir::detail::Parser::codeCompleteStringDialectOrOperationName(), collapseBranch(), collectValidReferencesFor(), combineOneSpec(), mlir::FlatLinearConstraints::composeMatchingMap(), mlir::ValueBoundsConstraintSet::computeBound(), computeCollapsedLayoutMap(), mlir::ValueBoundsConstraintSet::computeConstantBound(), computeExpandedLayoutMap(), computeMemRefRankReductionMask(), computePaddedShape(), mlir::tensor::computeTransposedType(), mlir::AffineMap::constantFold(), mlir::presburger::IntegerRelation::constantFoldVar(), convertAffineLoopNestToGPULaunch(), mlir::detail::ConversionPatternRewriterImpl::convertBlockSignature(), convertDenseArrayFromAttr(), convertFloatValue(), convertFromAttribute(), convertFuncOpTypes(), mlir::LLVM::ModuleImport::convertFunctions(), convertInstructionImpl(), mlir::LLVMImportDialectInterface::convertIntrinsic(), mlir::LLVMImportInterface::convertIntrinsic(), mlir::LLVM::ModuleImport::convertIntrinsicArguments(), convertIntrinsicImpl(), mlir::LLVM::ModuleImport::convertMetadata(), mlir::LLVM::ModuleImport::convertMetadataValue(), mlir::detail::ConversionPatternRewriterImpl::convertNonEntryRegionTypes(), convertOmpOpRegions(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpReductionOp(), convertOmpSimdLoop(), convertOmpTarget(), convertOmpWsLoop(), convertOperationImpl(), mlir::detail::ConversionPatternRewriterImpl::convertRegionTypes(), mlir::TypeConverter::convertSignatureArg(), mlir::TypeConverter::convertSignatureArgs(), mlir::TypeConverter::convertType(), mlir::TypeConverter::convertTypes(), mlir::LLVM::ModuleImport::convertValues(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::tensor::ExtractSliceFromCollapseHelper::create(), createFullTiles(), createSingleExitingLatch(), mlir::ControlFlowToSCFTransformation::createStructuredBranchRegionOp(), mlir::OpAsmDialectInterface::declareResource(), mlir::DiagnosedSilenceableFailure::definiteFailure(), mlir::affine::delinearizeIndex(), mlir::SaturatedInteger::desaturate(), mlir::spirv::Deserializer::deserialize(), dropRefIfNoUses(), mlir::linalg::dropUnitDims(), mlir::detail::ExpectedDiag::emitError(), emitOptionalError(), emitOptionalRemark(), emitOptionalWarning(), encodeKernelName(), mlir::tosa::EqualizeRanks(), extractStrides(), failableParallelForEach(), mlir::detail::OpPassManagerImpl::finalizePassList(), findIndicesForOffset(), findOptimal(), mlir::FlatLinearConstraints::flattenAlignedMapAndMergeLocals(), mlir::Operation::fold(), foldExtractOpFromExtractChain(), mlir::OperationName::UnregisteredOpModel::foldHook(), foldInsertAfterInsertSlice(), foldLoopBounds(), mlir::bufferization::foldToMemrefToTensorPair(), mlir::op_definition_impl::foldTrait(), forwardPassthroughAttributes(), mlir::linalg::fuseProducerOfTensor(), generalizeNamedOpPrecondition(), generateCleanupLoopForUnroll(), generateCopy(), mlir::affine::generateCopyForMemRegion(), mlir::OpState::genericParseProperties(), mlir::affine::MemRefAccess::getAccessRelation(), getAllowedSizeK(), mlir::affine::ComputationSliceState::getAsConstraints(), mlir::bufferization::getBuffer(), mlir::ROCDL::SerializeGPUModuleBase::getCommonBitcodeLibs(), getCompressedMaskOp(), getDefaultABIAttrs(), mlir::bytecode::detail::IRNumberingState::NumberingDialectWriter::getDialectVersion(), getDivRepr(), mlir::spirv::getExecutionModel(), mlir::bufferization::getGlobalFor(), getIndexProduct(), getInterfaceVariables(), getIntOrSplatIntValue(), mlir::nvgpu::getLaneIdAndValueIdToOperandCoord(), mlir::nvgpu::getLaneIdToLdMatrixMatrixCoord(), mlir::nvgpu::getLdMatrixParams(), getMaskOp(), mlir::spirv::getMemoryModel(), mlir::LLVMTypeConverter::getMemRefAddressSpace(), getMemRefAlignment(), mlir::mesh::getMeshShardingAttr(), mlir::nvgpu::getMmaSyncRegisterType(), getMultiAffineFunctionFromMap(), mlir::tensor::getOrCreateDestination(), mlir::affine::getRelationFromMap(), getRequiredConsistentGEPType(), mlir::shape::getShapeVec(), mlir::affine::ComputationSliceState::getSourceAsConstraints(), getStridesAndOffset(), getStridesAndOffset(), getWrittenToFields(), handleEq(), handleNe(), handleSle(), handleSlt(), handleUle(), handleUlt(), mlir::affine::hoistAffineIfOp(), mlir::linalg::hoistPaddingOnTensors(), incSlicePosition(), mlir::linalg::inferContractionDims(), mlir::linalg::inferConvolutionDims(), inferConvolutionDimsImpl(), inferIteratorsFromOutMap(), mlir::DataFlowSolver::initializeAndRun(), VectorizationState::initState(), mlir::sparse_tensor::CodegenEnv::initTensorExp(), inlineCall(), inlineConvertOmpRegions(), mlir::Inliner::Impl::inlineSCC(), interchangeGenericOpPrecondition(), interleaveWithError(), mlir::transform::detail::interpreterBaseInitializeImpl(), mlir::transform::detail::interpreterBaseRunOnOperationImpl(), irdlAttrOrTypeVerifier(), isAllowedSizeM(), isAllowedSizeN(), isAllowedWGMMADataType(), isMemRefTypeSupported(), isValidMaskedInputVector(), mlir::AsmParser::KeywordSwitch< ResultT >::KeywordSwitch(), mlir::LLVM::ModuleToObject::linkFiles(), mlir::LLVMTypeConverter::LLVMTypeConverter(), mlir::LLVM::ModuleToObject::loadBitcodeFilesFromList(), loadIRDLDialects(), mlir::LLVM::detail::LoopAnnotationImporter::lookupAccessGroupAttrs(), mlir::LLVM::ModuleImport::lookupAliasScopeAttrs(), lookupSymbolInImpl(), mlir::affine::loopUnrollByFactor(), loopUnrollByFactor(), mlir::affine::loopUnrollFull(), mlir::affine::loopUnrollJamByFactor(), lowerEntryPointABIAttr(), makeIndependent(), matchAndReplaceDepthwiseConv(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::ComposeCollapseOfExpandOp< CollapseOpTy, ExpandOpTy, CastOpTy >::matchAndRewrite(), mlir::ComposeExpandOfCollapseOp< ExpandOpTy, CollapseOpTy >::matchAndRewrite(), ConvertTypesInSCFForOp::matchAndRewrite(), mlir::LLVM::CanonicalizeAlignedGep::matchAndRewrite(), mlir::LLVM::SplitGEP::matchAndRewrite(), mlir::GPUFuncOpLowering::matchAndRewrite(), InsertSliceOfInsertSliceFolder< OpTy >::matchAndRewrite(), mlir::ComposeReassociativeReshapeOps< ReshapeOpTy >::matchAndRewrite(), UModSimplification::matchAndRewrite(), mlir::LLVM::SplitStores::matchAndRewrite(), mlir::LLVM::BitcastStores::matchAndRewrite(), DeduplicateAffineMinMaxExpressions< T >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), CanonicalizeAffineMinMaxOpExprAndTermOrder< T >::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), SwapExtractSliceOfFill::matchAndRewrite(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), mlir::scf::matchForLikeLoop(), mlir::BytecodeReader::Impl::materializeAll(), mergeIdenticalBlocks(), mlirExecutionEngineInvokePacked(), MlirOptMain(), mlirQueryMain(), mlirReduceMain(), mlir::presburger::LexSimplexBase::moveRowUnknownToColumn(), mlir::memref::multiBuffer(), mlir::LLVM::detail::LLVMStructTypeStorage::mutate(), mlir::spirv::detail::StructTypeStorage::mutate(), nextIndex(), mlir::affine::normalizeMemRef(), mlir::RewriterBase::notifyMatchFailure(), mlir::Diagnostic::operator FailureOr< T >(), mlir::InFlightDiagnostic::operator FailureOr< T >(), mlir::DiagnosedDefiniteFailure::operator LogicalResult(), mlir::Diagnostic::operator LogicalResult(), mlir::InFlightDiagnostic::operator LogicalResult(), mlir::pdll::ast::Diagnostic::operator LogicalResult(), mlir::pdll::ast::InFlightDiagnostic::operator LogicalResult(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), mlir::amdgpu::optimizeSharedMemoryReadsAndWrites(), mlir::amdgpu::optimizeSharedMemoryReadsAndWritesOp(), outlineIfOp(), outlineSingleBlockRegion(), mlir::linalg::pack(), packLinalgMetadataOnce(), mlir::detail::ParallelDiagnosticHandlerImpl::ParallelDiagnosticHandlerImpl(), mlir::FieldParser< AttributeT, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, AttributeT > >::parse(), mlir::FieldParser< TypeT, std::enable_if_t< std::is_base_of< Type, TypeT >::value, TypeT > >::parse(), mlir::FieldParser< IntT, std::enable_if_t< std::is_integral< IntT >::value, IntT > >::parse(), mlir::FieldParser< std::string >::parse(), mlir::FieldParser< std::optional< AttributeT >, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, std::optional< AttributeT > > >::parse(), mlir::FieldParser< std::optional< IntT >, std::enable_if_t< std::is_integral< IntT >::value, std::optional< IntT > > >::parse(), mlir::FieldParser< ContainerT, std::enable_if_t< llvm::is_detected< detail::has_push_back_t, ContainerT >::value, ContainerT > >::parse(), mlir::FieldParser< AffineMap >::parse(), mlir::DynamicAttr::parse(), mlir::DynamicType::parse(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), mlir::amdgpu::Chipset::parse(), mlir::detail::Parser::parseAffineMapReference(), parseAffineMinMaxOp(), parseAllocateAndAllocator(), parseArithmeticExtendedBinaryOp(), mlir::detail::AsmParserImpl< BaseT >::parseArrowTypeList(), mlir::AsmParser::parseAttribute(), mlir::detail::Parser::parseAttribute(), mlir::detail::Parser::parseAttributeDict(), parseAttributesOp(), parseAwaitResultType(), parseBound(), mlir::detail::Parser::parseCallSiteLocation(), parseCallTypeAndResolveOperands(), parseCaptureType(), parseClauseAttr(), parseClauseWithRegionArgs(), parseCmpOp(), mlir::detail::AsmParserImpl< BaseT >::parseColonType(), mlir::AsmParser::parseColonType(), mlir::detail::AsmParserImpl< BaseT >::parseColonTypeList(), parseCombinedConstructsLoop(), mlir::detail::Parser::parseCommaSeparatedList(), mlir::detail::pass_options::parseCommaSeparatedList(), mlir::detail::Parser::parseCommaSeparatedListUntil(), parseCommonStructuredOpParts(), parseCopyPrivateVarList(), parseCreateOperationOpAttributes(), parseCreateOperationOpResults(), mlir::AsmParser::parseCustomAttributeWithFallback(), mlir::AsmParser::parseCustomTypeWithFallback(), parseDenseI64ArrayAttr(), parseDependVarList(), parseDeviceTypeArrayAttr(), parseDeviceTypeOperandsWithKeywordOnly(), parseDeviceTypeOperandsWithSegment(), parseDialectGrouping(), mlir::detail::Parser::parseDialectSymbolBody(), mlir::affine::parseDimAndSymbolList(), mlir::detail::Parser::parseDimensionListRanked(), parseDstStyleOp(), parseDynamicIndexList(), parseEntry(), mlir::spirv::parseEnumKeywordAttr(), mlir::spirv::parseEnumStrAttr(), parseExtTypeParams(), mlir::detail::AsmParserImpl< BaseT >::parseFloat(), parseForeachMatchSymbols(), mlir::detail::PassOptions::parseFromString(), mlir::tracing::FileLineColLocBreakpoint::parseFromString(), mlir::function_interface_impl::parseFunctionOp(), parseFunctionResultList(), mlir::detail::Parser::parseFunctionResultTypes(), mlir::function_interface_impl::parseFunctionSignature(), parseFunctionTypes(), mlir::detail::Parser::parseFusedLocation(), parseGangClause(), parseGangValue(), parseGEPIndices(), parseGlobalMemrefOpTypeAndInitialValue(), mlir::spirv::parseImageOperands(), mlir::detail::Parser::parseIntegerSetReference(), parseKeywordList(), mlir::AsmParser::parseKeywordType(), parseLaunchDimType(), parseLaunchFuncOperands(), parseLinearClause(), mlir::detail::Parser::parseLocationInstance(), parseLoopControl(), mlir::sparse_tensor::ir_detail::LvlTypeParser::parseLvlType(), parseMapClause(), parseMapEntries(), mlir::detail::Parser::parseMemRefType(), parseMultitileSizesTypes(), parseNamedStructuredOp(), parseNamedStructuredOpResults(), mlir::detail::Parser::parseNameOrFileLineColLocation(), parseNumGangs(), parseOffloadingHandler(), parseOneResultSameOperandTypeOp(), parseOperationOpAttributes(), parseOptionalArrayStride(), mlir::ExtensibleDialect::parseOptionalDynamicAttr(), mlir::ExtensibleDialect::parseOptionalDynamicType(), mlir::detail::Parser::parseOptionalInteger(), parseOptionalInterchange(), mlir::detail::Parser::parseOptionalKeyword(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalKeyword(), parseOptionalStaticSlice(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalString(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalSymbolName(), mlir::AsmParser::parseOptionalSymbolName(), mlir::detail::Parser::parseOptionalType(), mlir::impl::parseOptionalVisibilityKeyword(), mlir::transform::parsePackedOrDynamicIndexList(), parseParallelRegion(), parsePassPipeline(), parseQuantParams(), parseReductionVarList(), mlir::AsmParser::parseResourceHandle(), parseResultsValueType(), parseRoutineGangClause(), parseScheduleClause(), parseSemiFunctionType(), parseSequenceOpOperands(), parseSingleBlockRegion(), parseSizeAssignment(), parseStorageRange(), parseStructMemberDecorations(), parseSwitchCases(), parseSwitchOpCases(), mlir::AsmParser::parseSymbolName(), parseSymOperandList(), parseSynchronizationHint(), parseTokenOrdering(), mlir::transform::parseTransformMatchDims(), mlir::transform::detail::parseTransformModuleFromFile(), mlir::detail::AsmParserImpl< BaseT >::parseType(), mlir::AsmParser::parseType(), parseTypedInitialValue(), mlir::detail::Parser::parseTypeListNoParens(), mlir::detail::Parser::parseTypeListParens(), parseValuesWithVariadicity(), parseValueWithVariadicity(), mlir::detail::Parser::parseVectorDimensionList(), parseVerCapExtAttr(), parseWaitClause(), parseWsLoop(), mlir::PassPipelineRegistration< EmptyPipelineOptions >::PassPipelineRegistration(), mlir::PassPipelineRegistration< Options >::PassPipelineRegistration(), pdllConvertValues(), peelForLoop(), mlir::scf::pipelineForLoop(), printBinaryOperation(), printCallOperation(), printConstantOp(), mlir::ExtensibleDialect::printIfDynamicAttr(), mlir::ExtensibleDialect::printIfDynamicType(), printOperation(), printUnaryOperation(), processParallelLoop(), mlir::bufferization::promoteBufferResultsToOutParams(), mlir::affine::promoteIfSingleIteration(), promoteSingleIterReductionLoop(), mlir::linalg::promoteSubviewAsNewBuffer(), promoteSubViews(), mlir::linalg::promoteSubViews(), mlir::pdll::Lexer::pushInclude(), mlir::BytecodeReader::Impl::read(), mlir::DialectBytecodeReader::readAttribute(), readLine(), mlir::DialectBytecodeReader::readList(), mlir::DialectBytecodeReader::readOptionalAttribute(), mlir::DialectBytecodeReader::readResourceHandle(), readResourceHandle(), mlir::DialectBytecodeReader::readSparseArray(), mlir::DialectBytecodeReader::readType(), mlir::DialectBytecodeReader::readVarIntWithFlag(), registerConversionPDLFunctions(), reifyValueBound(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), mlir::SymbolTable::renameToUnique(), mlir::AttrTypeSubElementHandler< LLVM::detail::LLVMStructTypeStorage::Key >::replace(), replaceDimOrSym(), mlir::tensor::replaceExtractSliceWithTiledProducer(), replaceWithConstant(), mlir::memref::replaceWithIndependentOp(), resolveBroadcastShape(), mlir::OpAsmParser::resolveOperands(), resolveSourceIndicesCollapseShape(), resolveSourceIndicesExpandShape(), mlir::linalg::DownscaleSizeOneWindowed2DConvolution< Conv2DOp, Conv1DOp >::returningMatchAndRewrite(), mlir::linalg::DownscaleConv2DOp::returningMatchAndRewrite(), mlir::linalg::DownscaleDepthwiseConv2DNhwcHwcOp::returningMatchAndRewrite(), mlir::linalg::rewriteInDestinationPassingStyle(), PadOpVectorizationWithInsertSlicePattern::rewriteUser(), PadOpVectorizationWithTransferReadPattern::rewriteUser(), PadOpVectorizationWithTransferWritePattern::rewriteUser(), roundTripModule(), mlir::query::InvalidQuery::run(), mlir::lsp::runMlirLSPServer(), mlir::bufferization::runOneShotModuleBufferize(), mlir::lsp::runPdllLSPServer(), mlir::lsp::runTableGenLSPServer(), runTransformOnCGSCCs(), mlir::affine::separateFullTiles(), mlir::spirv::Serializer::serialize(), serializeModule(), mlir::MlirOptMainConfig::setPassPipelineParser(), mlir::DynamicOpDefinition::setPropertiesFromAttr(), mlir::RegisteredOperationName::Model< ConcreteOp >::setPropertiesFromAttr(), mlir::linalg::specializeGenericOp(), splitAndProcessBuffer(), mlir::vector::splitFullAndPartialTransfer(), splitFullAndPartialTransferPrecondition(), staticallyNonNegative(), structFuncArgTypeConverter(), mlir::affine::tilePerfectlyNested(), mlir::affine::tilePerfectlyNestedParametric(), transformCFGToSCF(), transformCyclesToSCFLoops(), transformToStructuredCFBranches(), mlir::LLVM::detail::LoopAnnotationImporter::translateAccessGroup(), translateDataLayout(), mlir::DenseElementsAttr::try_value_begin(), mlir::DenseElementsAttr::try_value_end(), mlir::DenseElementsAttr::tryGetComplexFloatValues(), mlir::DenseElementsAttr::tryGetComplexIntValues(), mlir::DenseElementsAttr::tryGetFloatValues(), mlir::DenseElementsAttr::tryGetValues(), tryIsolateBands(), mlir::detail::OpToOpPassAdaptor::tryMergeInto(), mlir::AsmParser::tryStartCyclicParse(), mlir::AsmPrinter::tryStartCyclicPrint(), GenericPadOpVectorizationPattern::tryVectorizeCopy(), typeOrAttrParser(), mlir::presburger::IntegerRelation::unionBoundingBox(), updateDeallocIfChanged(), updateSubElementImpl(), mlir::affine::vectorizeAffineLoopNest(), vectorizeAsTensorUnpackOp(), mlir::linalg::vectorizeCopy(), vectorizeDynamicConvOpPrecondition(), vectorizeLinalgOpPrecondition(), vectorizePackOpPrecondition(), vectorizePadOpPrecondition(), vectorizeUnPackOpPrecondition(), 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::quant::UniformQuantizedPerAxisType::verify(), mlir::quant::UniformQuantizedType::verify(), mlir::quant::AnyQuantizedType::verify(), mlir::irdl::RegionConstraint::verify(), mlir::spirv::verifyAccessChain(), verifyAllToAllOperandAndResultShape(), verifyCompatibleShape(), verifyCompatibleShapes(), mlir::detail::verifyDataLayoutSpec(), verifyDependencies(), verifyGatherOperandAndResultShape(), verifyLoopNesting(), verifyReduceOpAndType(), verifyScatterOrSliceOperandAndResultShape(), mlir::SimpleAffineExprFlattener::visitModExpr(), mlir::AffineExprVisitor< SubClass, LogicalResult >::walkPostOrder(), walkReturnOperations(), mlir::BytecodeDialectInterface::writeAttribute(), and mlir::BytecodeDialectInterface::writeType().
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.
void mlir::finalizeParallelLoopToGPUConversion | ( | Operation * | op | ) |
Clean up after applyPartialConversion/applyFullConversion call.
Definition at line 688 of file SCFToGPU.cpp.
|
inline |
Return positions in iteratorTypes
that match iteratorTypeName
.
Definition at line 77 of file StructuredOpsUtils.h.
References mlir::detail::enumerate().
|
inline |
Returns the result of MLIR's floordiv operation on constants.
The RHS is expected to be non-zero.
Definition at line 33 of file MathExtras.h.
Referenced by mlir::scf::addLoopRangeConstraints(), createPrivateMemRef(), generateCopy(), getBoundForAffineExpr(), mlir::memref::multiBuffer(), simplifyExprAndOperands(), and simplifyFloorDiv().
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 708 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::areEqual(), mlir::ValueBoundsConstraintSet::areOverlappingSlices(), mlir::affine::makeComposedAffineApply(), and makeComposedMinMax().
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 271 of file StaticValueUtils.cpp.
References getConstantIntValue(), m_Constant(), matchPattern(), and success().
Referenced by foldDynamicOffsetSizeList(), and foldDynamicStrideList().
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 292 of file StaticValueUtils.cpp.
References foldDynamicIndexList().
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 297 of file StaticValueUtils.cpp.
References foldDynamicIndexList().
|
static |
Definition at line 86 of file ReshapeOpsUtils.h.
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 907 of file Utils.cpp.
References mlir::OpBuilder::create(), mlir::IRMapping::map(), mlir::OpBuilder::setInsertionPointAfter(), and mlir::OpBuilder::setInsertionPointToStart().
Referenced by fuseSiblings().
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.
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.
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.
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.
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 510 of file BytecodeImplementation.h.
Referenced by addAtomicRMW(), mlir::OperationState::addAttribute(), mlir::ROCDL::SerializeGPUModuleBase::addControlVariables(), addOpaquePointerConversion(), addResumeFunction(), addScopeToFunction(), addShardOp(), allocateSubviewGPUMemoryInAddressSpace(), allocBuffer(), mlir::sparse_tensor::allocDenseTensor(), mlir::NamedAttrList::append(), appendX1Dim(), applyPad(), applyPassManagerCLOptions(), applyToIntegerAttrs(), areAllIndicesI32(), mlir::transform::detail::assembleTransformLibraryFromPaths(), bitAndAddrspaceCast(), broadcast(), mlir::tensor::bubbleUpPadSlice(), mlir::bufferization::BufferizeTypeConverter::BufferizeTypeConverter(), 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(), mlir::BytecodeReader::BytecodeReader(), calculateMemoryRequirements(), canonicalizeStridedLayout(), castAllocFuncResult(), mlir::quant::QuantizedType::castFromExpressedType(), mlir::quant::QuantizedType::castFromStorageType(), castToCompatibleMemRefType(), castToElemPtrPtr(), mlir::quant::QuantizedType::castToExpressedType(), mlir::quant::QuantizedType::castToStorageType(), mlir::TensorType::cloneWith(), mlir::BaseMemRefType::cloneWith(), collapseValue(), collectSymbolScopes(), collectValidReferencesFor(), computeCollapsedLayoutMap(), computeExpandedLayoutMap(), concatArrayAttr(), mlir::AffineMap::constantFold(), constFoldBinaryOpConditional(), mlir::detail::constructSubElementReplacement(), mlir::quant::ExpressedToQuantizedConverter::convert(), mlir::arith::convertArithFastMathAttrToLLVM(), mlir::arith::convertArithOverflowAttrToLLVM(), convertArrayType(), convertBoolMemrefType(), convertFuncOpToLLVMFuncOp(), convertFuncOpTypes(), mlir::LLVMTypeConverter::convertFunctionSignature(), mlir::LLVMTypeConverter::convertFunctionTypeCWrapper(), mlir::LLVM::ModuleImport::convertGlobals(), mlir::LLVM::ModuleImport::convertIntrinsicArguments(), convertIntrinsicResult(), convertLinkerOptionsOp(), convertOmpCritical(), convertOperationImpl(), convertPointerType(), convertRuntimeArrayType(), convertSubByteIntegerType(), convertToAttribute(), mlir::LLVM::ModuleImport::convertValue(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::DistinctAttr::create(), createAsyncDispatchFunction(), createCtlzFunc(), createCustomDialectWrapper(), createDeviceFunctionCall(), createElementFPowIFunc(), createElementIPowIFunc(), createFullPartialVectorTransferRead(), createFullPartialVectorTransferWrite(), mlir::LLVM::createGlobalString(), createGroupReduceOpImpl(), createI32ConstantOf(), createIfNonNull(), createNewAliasScopesFromNoAliasParameter(), mlir::LLVM::createPrintStrCall(), createPrivateMemRef(), createQuickSort(), createReadOrMaskedRead(), createSortStableFunc(), createVL(), createWriteOrMaskedWrite(), deepCloneAliasScopes(), defaultAllocBufferCallBack(), deserializeModule(), mlir::spirv::Deserializer::processOp< spirv::EntryPointOp >(), mlir::spirv::Deserializer::processOp< spirv::ExecutionModeOp >(), mlir::spirv::Deserializer::processOp< spirv::FunctionCallOp >(), mlir::detail::divideCeil(), dropTrailingX1Dim(), dumpIndexMemRef(), PyAttrBuilderMap::dundeGetItemNamed(), PyAttrBuilderMap::dunderContains(), PyAttrBuilderMap::dundeSetItemNamed(), encodeKernelName(), mlir::tosa::EqualizeRanks(), mlir::transform::detail::expandPathsToMLIRFiles(), expandRank(), extendVectorRank(), mlir::detail::OpPassManagerImpl::finalizePassList(), finalizeWhileOp(), findPayloadRoot(), foldBinaryOpChecked(), foldBinaryOpUnchecked(), foldCastOp(), foldDynamicToStaticDimSizes(), foldMemRefCasts(), mlir::sparse_tensor::foreachFieldAndTypeInSparseTensor(), mlir::sparse_tensor::genAlloca(), mlir::sparse_tensor::genAllocaScalar(), mlir::sparse_tensor::FuncCallOrInlineGenerator< SubClass >::genCallOrInline(), generateCopy(), generateNewRefAttr(), mlir::sparse_tensor::genReader(), genSliceToSize(), mlir::sparse_tensor::genToMemref(), mlir::gpu::MMAMatrixType::get(), mlir::spirv::StructType::get(), mlir::spirv::InterfaceVarABIAttr::get(), mlir::spirv::VerCapExtAttr::get(), mlir::detail::DenseArrayAttrImpl< T >::get(), mlir::DataLayoutSpecAttr::get(), mlir::DenseElementsAttr::get(), mlir::detail::DenseResourceElementsAttrBase< T >::get(), mlir::spirv::ImageType::get(), mlir::DataLayoutEntryAttr::get(), mlir::FlatSymbolRefAttr::get(), mlir::spirv::MatrixType::get(), mlir::spirv::RuntimeArrayType::get(), mlir::spirv::JointMatrixINTELType::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::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(), getCanonicalSubViewResultType(), VectorizationState::getCanonicalVecType(), mlir::python::PyBlock::getCapsule(), getCastCompatibleMemRefType(), getCharPtr(), getCompressedMaskOp(), getConvOutputDim(), mlir::sparse_tensor::SparseTensorType::getCOOType(), mlir::sparse_tensor::SparseTensorType::getCrdType(), 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(), mlir::ConvertToLLVMPattern::getElementPtrType(), mlir::spirv::StructType::getEmpty(), mlir::Lexer::getEncodedSourceLocation(), 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(), getFirstSubelementType(), mlir::LLVM::getFixedVectorType(), mlir::FloatType::getFloat8E4M3B11FNUZ(), mlir::FloatType::getFloat8E4M3FN(), mlir::FloatType::getFloat8E4M3FNUZ(), mlir::FloatType::getFloat8E5M2(), mlir::FloatType::getFloat8E5M2FNUZ(), mlir::Builder::getFloatAttr(), mlir::sparse_tensor::getFunc(), mlir::Builder::getFunctionType(), mlir::Builder::getFusedLoc(), getGetValueTypeOpValueType(), 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::LLVM::LLVMStructType::getIdentified(), mlir::Builder::getIndexArrayAttr(), mlir::Builder::getIndexAttr(), mlir::Builder::getIndexTensorAttr(), mlir::Builder::getIndexType(), mlir::LLVMTypeConverter::getIndexType(), getIndexType(), mlir::Builder::getIndexVectorAttr(), mlir::sparse_tensor::SparseTensorSpecifier::getInitValue(), mlir::Builder::getIntegerAttr(), mlir::Builder::getIntegerType(), getInterfaceVariables(), mlir::ConvertToLLVMPattern::getIntPtrType(), getLaneId(), mlir::LLVM::LLVMStructType::getLiteral(), mlir::LLVM::detail::getLLVMConstant(), getLLVMFuncType(), mlir::dataflow::CFGEdge::getLoc(), getMangledSortHelperFunc(), mlir::ConvertToLLVMPattern::getMemRefDescriptorSizes(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), mlir::bufferization::getMemRefType(), mlir::bufferization::getMemRefTypeWithFullyDynamicLayout(), mlir::bufferization::getMemRefTypeWithStaticIdentityLayout(), mlir::nvgpu::getMmaSyncRegisterType(), getMmaSyncVectorOperandType(), mlir::Builder::getNoneType(), getNormalizedEncodingForSpecifier(), mlir::LLVM::LLVMStructType::getOpaque(), mlir::sparse_tensor::getOpaquePointerType(), mlir::LLVM::ModuleTranslation::getOrCreateAliasScope(), mlir::LLVM::ModuleTranslation::getOrCreateAliasScopes(), getOrInsertBuiltinVariable(), mlir::MLIRContext::getOrLoadDynamicDialect(), getPackOpSourceOrPaddedSource(), mlir::sparse_tensor::SparseTensorType::getPosType(), mlir::DataFlowSolver::getProgramPoint(), mlir::LLVM::getScalableVectorType(), getScalarConstantAsAttr(), getScalarOrVectorConstInt(), getSharedAddressSpaceAttribute(), mlir::Builder::getSI32IntegerAttr(), mlir::ConvertToLLVMPattern::getSizeInBytes(), mlir::arm_sme::getSMETileTypeForElement(), mlir::Builder::getStringAttr(), mlir::LLVM::LLVMStructType::getSubelementIndexMap(), 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(), 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(), handleMultidimensionalVectors(), mlir::mesh::handlePartialAxesDuringResharding(), mlir::tracing::InstallDebugHandler::Impl::Impl(), inferIntrinsicResultType(), mlir::detail::inferReturnTensorTypes(), inferSparseBufferType(), inferStridedSliceOpResultType(), mlir::vector::inferTransferOpMaskType(), inferTransposeResultType(), mlir::LLVMImportInterface::initializeImport(), mlir::sparse_tensor::LoopEmitter::initializeLoopEmit(), mlir::transform::detail::interpreterBaseInitializeImpl(), invertPredicate(), isBatchMatvec(), isBatchVecmat(), isColumnMajorMatmul(), isMatvec(), isRowMajorBatchMatmul(), isRowMajorMatmul(), 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(), mlir::SymbolTable::lookupSymbolIn(), lowerEntryPointABIAttr(), mlir::LowerToLLVMOptions::LowerToLLVMOptions(), makeI64ArrayAttr(), makeStridedLayoutDynamic(), matchAndReplaceDepthwiseConv(), mlir::LLVM::CanonicalizeAlignedGep::matchAndRewrite(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), ConvertLoad::matchAndRewrite(), mlir::linalg::GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(), mlir::linalg::GeneralizeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), ConsolidateTransposeOptimization::matchAndRewrite(), mlir::spirv::MemorySpaceToStorageClassConverter::MemorySpaceToStorageClassConverter(), mergeInto(), minMaxValueForFloat(), minMaxValueForSignedInt(), minMaxValueForUnsignedInt(), mlirAffineMapAttrGet(), mlirArrayAttrGet(), mlirAttributeGetType(), mlirComplexTypeGet(), mlirDictionaryAttrGet(), mlirDictionaryAttrGetElementByName(), mlirFloatAttrDoubleGet(), mlirFunctionTypeGet(), mlirIdentifierGet(), mlirIndexTypeGet(), mlirIntegerAttrGet(), mlirIntegerTypeGet(), mlirIntegerTypeSignedGet(), mlirIntegerTypeUnsignedGet(), mlirLLVMArrayTypeGet(), mlirLLVMCConvAttrGet(), mlirLLVMComdatAttrGet(), mlirLLVMDIBasicTypeAttrGet(), mlirLLVMDICompileUnitAttrGet(), mlirLLVMDICompositeTypeAttrGet(), mlirLLVMDIDerivedTypeAttrGet(), mlirLLVMDIExpressionAttrGet(), mlirLLVMDIExpressionElemAttrGet(), mlirLLVMDIFileAttrGet(), mlirLLVMDIFlagsAttrGet(), mlirLLVMDILexicalBlockAttrGet(), mlirLLVMDILexicalBlockFileAttrGet(), mlirLLVMDILocalVariableAttrGet(), mlirLLVMDIModuleAttrGet(), mlirLLVMDINullTypeAttrGet(), mlirLLVMDISubprogramAttrGet(), mlirLLVMDISubroutineTypeAttrGet(), mlirLLVMFunctionTypeGet(), mlirLLVMLinkageAttrGet(), mlirLLVMPointerTypeGet(), mlirLLVMVoidTypeGet(), mlirLocationCallSiteGet(), mlirLocationFileLineColGet(), mlirLocationFusedGet(), mlirLocationNameGet(), mlirLocationUnknownGet(), mlirMemRefTypeContiguousGet(), mlirMemRefTypeGet(), mlirNoneTypeGet(), mlirOpaqueAttrGet(), mlirOpaqueTypeGet(), 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::MemRefType::Builder::operator MemRefType(), mlir::RankedTensorType::Builder::operator RankedTensorType(), mlir::VectorType::Builder::operator VectorType(), mlir::LLVM::GEPIndicesAdaptor< DynamicRange >::iterator::operator*(), mlir::DenseElementsAttr::AttributeElementIterator::operator*(), optionalLevelAttr(), outlineExecuteOp(), outlineKernelFuncImpl(), outlineSingleBlockRegion(), packFunctionArguments(), padOperandToSmallestStaticBoundingBox(), parseAsmSourceFile(), mlir::detail::Parser::parseAttribute(), parseBound(), mlir::detail::Parser::parseCallSiteLocation(), parseCaptureType(), parseClauseAttr(), parseClauseWithRegionArgs(), parseCombinedConstructsLoop(), mlir::detail::Parser::parseComplexType(), parseCopyPrivateVarList(), mlir::detail::Parser::parseDecOrHexAttr(), mlir::detail::Parser::parseDenseArrayAttr(), mlir::detail::Parser::parseDenseResourceElementsAttr(), parseDependVarList(), parseDeviceTypeArrayAttr(), parseDeviceTypeOperandsWithKeywordOnly(), parseDeviceTypeOperandsWithSegment(), mlir::detail::Parser::parseExtendedAttr(), mlir::detail::Parser::parseFloatAttr(), parseForeachMatchSymbols(), mlir::function_interface_impl::parseFunctionOp(), mlir::detail::Parser::parseFusedLocation(), parseGangClause(), parseGlobalMemrefOpTypeAndInitialValue(), mlir::spirv::parseImageOperands(), parseLaunchDimType(), mlir::detail::Parser::parseLocationInstance(), parseLoopControl(), mlir::detail::Parser::parseNameOrFileLineColLocation(), mlir::detail::Parser::parseNonFunctionType(), parseNumGangs(), mlir::detail::Parser::parseOptionalAttribute(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalSymbolName(), parseRangeType(), parseReductionVarList(), 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(), mlir::detail::Parser::parseVectorType(), parseWaitClause(), parseWsLoop(), performOptionalDebugActions(), populateAMDGPUToROCDLConversionPatterns(), populateAsyncStructuralTypeConversionsAndLegality(), populateGpuToNVVMConversionPatterns(), mlir::math::populateLegalizeToF32TypeConverter(), mlir::memref::populateMemRefNarrowTypeEmulationConversions(), populateMMAToSPIRVCoopMatrixTypeConversion(), mlir::vector::populateVectorLinearizeTypeConversionsAndLegality(), printMinMaxBound(), mlir::LLVM::ModuleImport::processFunctionAttributes(), processMemoryEffects(), processPassthroughAttrs(), mlir::ValueBoundsConstraintSet::processWorklist(), mlir::LLVMTypeConverter::promoteOneMemRefDescriptor(), promoteSubViews(), PYBIND11_MODULE(), readBytecodeFileImpl(), reducedVectorTypeBack(), reduceInnermostDim(), mlir::ExtensibleDialect::registerDynamicAttr(), mlir::ExtensibleDialect::registerDynamicType(), registerFromLLVMIRTranslation(), mlir::Operation::removeAttr(), mlir::Operation::removeDiscardableAttr(), mlir::SymbolTable::rename(), renameSymbol(), mlir::SymbolTable::renameToUnique(), mlir::LLVM::MergeFragments::replace(), replaceAllSymbolUsesImpl(), mlir::IntegerSet::replaceDimsAndSymbols(), mlir::linalg::rewriteAsPaddedOp(), rewriteI4ToI8SignedExt(), rewriteI8ToI4Trunc(), mlir::linalg::rewriteInIm2Col(), PadOpVectorizationWithInsertSlicePattern::rewriteUser(), mlir::gpu::SerializeToBlobPass::runOnOperation(), mlir::NamedAttrList::set(), mlir::Operation::setAttr(), mlir::Operation::setAttrs(), mlir::Operation::setDiscardableAttr(), mlir::Operation::setDiscardableAttrs(), mlir::MlirOptMainConfig::setPassPipelineParser(), mlir::UnrankedMemRefDescriptor::setSize(), mlir::UnrankedMemRefDescriptor::setStride(), mlir::SymbolTable::setSymbolName(), mlir::SymbolTable::setSymbolVisibility(), setupCoroMachinery(), mlir::LLVM::DIExpressionRewriter::simplify(), mlir::UnrankedMemRefDescriptor::size(), mlir::MemRefDescriptor::size(), mlir::UnrankedMemRefDescriptor::sizeBasePtr(), sourceMaterializationCallback(), mlir::vector::splitFullAndPartialTransfer(), mlir::sparse_tensor::CodegenEnv::startEmit(), mlir::UnrankedMemRefDescriptor::stride(), mlir::UnrankedMemRefDescriptor::strideBasePtr(), mlir::SymbolTable::SymbolTable(), mlir::mesh::targetShardingInMoveLastAxis(), mlir::mesh::targetShardingInSplitLastAxis(), mlir::mesh::targetShardingInUnsplitLastAxis(), mlir::LLVM::detail::DebugImporter::translate(), translateDataLayout(), mlir::LLVM::detail::DebugImporter::translateFuncLocation(), mlir::LLVM::detail::DebugImporter::translateGlobalVariableExpression(), mlir::LLVM::detail::DebugTranslation::translateGlobalVariableExpression(), translateLLVMIRToModule(), mlir::LLVM::detail::DebugImporter::translateLoc(), mlir::x86vector::avx2::transpose4x8xf32(), mlir::x86vector::avx2::transpose8x8xf32(), transposeToShuffle16x16(), trimLeadingOneDims(), trimNonScalableUnitDims(), GenericPadOpVectorizationPattern::tryVectorizeCopy(), mlir::mesh::unsplitLastAxisInResharding(), updateFuncOp(), vectorizeAsTensorPackOp(), vectorizeAsTensorUnpackOp(), mlir::linalg::vectorizeCopy(), mlir::irdl::RegionConstraint::verify(), walkIndicesAsAttr(), mlir::arith::WideIntEmulationConverter::WideIntEmulationConverter(), wmmaPushInputOperand(), wrapExternalFunction(), mlir::detail::wrapIntegerMemorySpace(), and wrapNumericMemorySpace().
AffineExpr mlir::getAffineBinaryOpExpr | ( | AffineExprKind | kind, |
AffineExpr | lhs, | ||
AffineExpr | rhs | ||
) |
Definition at line 62 of file AffineExpr.cpp.
Referenced by createDimSizeExprForTiledLayout(), mlir::sparse_tensor::inverseBlockSparsity(), mlirAffineAddExprGet(), mlirAffineCeilDivExprGet(), mlirAffineFloorDivExprGet(), mlirAffineModExprGet(), mlirAffineMulExprGet(), mlir::AffineExpr::replace(), mlir::AffineExpr::replaceDimsAndSymbols(), simplifyAdd(), simplifyExprAndOperands(), simplifySemiAffine(), mlir::affine::substWithMin(), and symbolicDivide().
AffineExpr mlir::getAffineConstantExpr | ( | int64_t | constant, |
MLIRContext * | context | ||
) |
Definition at line 623 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(), detectAsMod(), mlir::linalg::dropUnitDims(), mlir::AffineExpr::floorDiv(), mlir::Builder::getAffineConstantExpr(), getAffineConstantExprs(), getAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getAsIntegerSet(), mlir::AffineMap::getConstantMap(), mlir::IntegerSet::getEmptySet(), getSemiAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getSliceBounds(), getStridesAndOffset(), mlir::vector::getTransferMinorIdentityMap(), inverseAndBroadcastProjectedPermutation(), isModOfModSubtraction(), linearize(), 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(), and mlir::SimpleAffineExprFlattener::visitModExpr().
SmallVector< AffineExpr > mlir::getAffineConstantExprs | ( | ArrayRef< int64_t > | constants, |
MLIRContext * | context | ||
) |
Definition at line 633 of file AffineExpr.cpp.
References getAffineConstantExpr().
Referenced by delinearize(), mlir::detail::TileOffsetRangeImpl::getDynamicTileOffsets(), and linearize().
AffineExpr mlir::getAffineDimExpr | ( | unsigned | position, |
MLIRContext * | context | ||
) |
These free functions allow clients of the API to not use classes in detail.
Definition at line 599 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(), mlir::linalg::dropUnitDims(), genReplaceDimToLvlMap(), mlir::Builder::getAffineDimExpr(), getAffineExprFromFlatForm(), getCollapsedOpIndexingMap(), getDimMap(), mlir::nvgpu::getLaneIdToLdMatrixMatrixCoord(), mlir::AffineMap::getMultiDimIdentityMap(), mlir::AffineMap::getMultiDimMapWithTargets(), getSemiAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getSliceBounds(), inverseAndBroadcastProjectedPermutation(), mlir::sparse_tensor::inverseBlockSparsity(), inversePermutation(), mlir::AffineExpr::isFunctionOfDim(), isNormalizedMemRefDynamicDim(), mlir::linalg::makeAffineDimExprs(), makeCanonicalStridedLayoutExpr(), makePermutationMap(), makeStridedLinearLayoutMap(), mlirAffineDimExprGet(), projectCommonImpl(), replaceDimOrSym(), mlir::AffineExpr::shiftDims(), sliceTransferIndices(), and transferReadSupportsMMAMatrixType().
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 1008 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().
AffineExpr mlir::getAffineSymbolExpr | ( | unsigned | position, |
MLIRContext * | context | ||
) |
Definition at line 609 of file AffineExpr.cpp.
References getAffineDimOrSymbol(), and SymbolId.
Referenced by mlir::detail::bindSymbols(), bindSymbolsList(), canonicalizeMapOrSetAndOperands(), canonicalizePromotedSymbols(), mlir::AffineMap::compose(), composeAffineMapAndOperands(), mlir::FlatLinearConstraints::computeLocalVars(), mlir::linalg::computeSliceParameters(), getAffineExprFromFlatForm(), mlir::Builder::getAffineSymbolExpr(), getSemiAffineExprFromFlatForm(), mlir::FlatLinearConstraints::getSliceBounds(), mlir::AffineExpr::isFunctionOfSymbol(), mlir::affine::linearizeIndex(), makeCanonicalStridedLayoutExpr(), makeStridedLinearLayoutMap(), mlirAffineSymbolExprGet(), projectCommonImpl(), replaceDimOrSym(), mlir::AffineExpr::shiftSymbols(), and mlir::linalg::updateBoundsForCyclicDistribution().
SmallVector<OpFoldResult> mlir::getAsIndexOpFoldResult | ( | MLIRContext * | ctx, |
ArrayRef< int64_t > | values | ||
) |
Definition at line 102 of file StaticValueUtils.cpp.
References getAsIndexOpFoldResult().
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 98 of file StaticValueUtils.cpp.
References get().
Referenced by HopperBuilder::buildPredicateLoadsOnThread0(), commonLinearIdBuilderFn(), computeLinearIndex(), and getAsIndexOpFoldResult().
SmallVector< OpFoldResult > mlir::getAsOpFoldResult | ( | ArrayAttr | arrayAttr | ) |
Convert arrayAttr
to a vector of OpFoldResult.
Definition at line 90 of file StaticValueUtils.cpp.
OpFoldResult mlir::getAsOpFoldResult | ( | Value | val | ) |
Given a value, try to extract a constant Attribute.
If this fails, return the original value.
Definition at line 73 of file StaticValueUtils.cpp.
References m_Constant(), and matchPattern().
Referenced by computeLinearIndex(), getAsOpFoldResult(), getCompressedMaskOp(), getDimValue(), getFlatMemref(), getFlatOffsetAndStrides(), InsertSliceOfInsertSliceFolder< OpTy >::matchAndRewrite(), replaceConstantUsesOf(), and mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides().
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 84 of file StaticValueUtils.cpp.
References getAsOpFoldResult().
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.
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 120 of file SliceAnalysis.cpp.
Referenced by getBackwardSlice().
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 132 of file SliceAnalysis.cpp.
References getBackwardSlice(), mlir::Value::getDefiningOp(), mlir::Operation::getParentOp(), and options.
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 1549 of file AffineExpr.cpp.
References CeilDiv, ceilDiv(), failed(), FloorDiv, floorDiv(), Mod, mod(), mlir::SimpleAffineExprFlattener::numLocals, mlir::SimpleAffineExprFlattener::operandExprStack, and mlir::AffineExprVisitor< SubClass, RetTy >::walkPostOrder().
Referenced by getLowerBound(), getUpperBound(), and simplifyMinOrMaxExprWithOperands().
mlir::bufferization::OneShotBufferizationOptions mlir::getBufferizationOptionsForSparsification | ( | bool | analysisOnly | ) |
Definition at line 190 of file SparsificationAndBufferizationPass.cpp.
References mlir::bufferization::getMemRefTypeWithStaticIdentityLayout(), mlir::Value::getType(), and options.
Referenced by mlir::sparse_tensor::buildSparsifier(), and createSparsificationAndBufferizationPass().
std::optional< int64_t > mlir::getConstantIntValue | ( | OpFoldResult | ofr | ) |
If ofr is a constant integer or an IntegerAttr, return the integer.
Definition at line 109 of file StaticValueUtils.cpp.
References m_ConstantInt(), and matchPattern().
Referenced by mlir::affine::FlatAffineValueConstraints::addInductionVarOrTerminalSymbol(), mlir::scf::addLoopRangeConstraints(), allocBuffer(), asShapeWithAnyValueAsDynamic(), buildAffineLoopFromValues(), canOmitTileOffsetInBoundsCheck(), checkAndCollapseInnerZeroIndices(), mlir::linalg::computeSliceParameters(), constantTripCount(), constifyIndexValues(), createInBoundsCond(), mlir::linalg::GenerateLoopNest< LoopTy >::doit(), foldDynamicIndexList(), foldDynamicToStaticDimSizes(), mlir::affine::ComputationSliceState::getAsConstraints(), getBoundedTileSize(), getConstantIntValues(), mlir::ValueBoundsConstraintSet::getExpr(), getPackOpSourceOrPaddedSource(), getSlicedDimensions(), isConstantIntValue(), isDimOpValidSymbol(), mlir::vector::isDisjointTransferIndices(), isEqualConstantIntOrValue(), isTrivialSubViewOp(), loopUnrollByFactor(), mlir::linalg::makeTiledLoopRanges(), mlir::linalg::GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(), normalizeLoop(), mlir::linalg::pack(), peelForLoop(), tileDividesIterationDomain(), and GenericPadOpVectorizationPattern::tryVectorizeCopy().
std::optional< SmallVector< int64_t > > mlir::getConstantIntValues | ( | ArrayRef< OpFoldResult > | ofrs | ) |
If all ofrs are constant integers or IntegerAttrs, return the integers.
Definition at line 125 of file StaticValueUtils.cpp.
References failed(), and getConstantIntValue().
Referenced by getThreadIdBuilder(), rewriteOneForallCommonImpl(), and verifyGpuMapping().
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 187 of file SideEffectInterfaces.cpp.
Return the element type or return the type itself.
Definition at line 33 of file TypeUtilities.cpp.
References getElementTypeOrSelf().
Return the element type or return the type itself.
Definition at line 23 of file TypeUtilities.cpp.
Referenced by buildGenericRegion(), MmaSyncBuilder::buildMmaSync(), clampInput(), createConst(), createFloatConst(), createIntConst(), exp2I32(), fillStructuredOpRegion(), frexp(), mlir::OpTrait::util::getBroadcastedType(), getElementTypeOrSelf(), getScalarOrElementWidth(), getUnderlyingType(), mlir::vector::isBroadcastableTo(), mlir::linalg::lowerPack(), mlir::linalg::pack(), padOperandToSmallestStaticBoundingBox(), mlir::linalg::rewriteAsPaddedOp(), and mlir::linalg::vectorizeCopy().
Definition at line 29 of file TypeUtilities.cpp.
References getElementTypeOrSelf(), and mlir::Value::getType().
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.
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::Value::getParentRegion().
LogicalResult mlir::getFlattenedAffineExpr | ( | AffineExpr | expr, |
unsigned | numDims, | ||
unsigned | numSymbols, | ||
SmallVectorImpl< int64_t > * | flattenedExpr, | ||
FlatLinearConstraints * | cst = nullptr |
||
) |
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., semi-affine is not yet handled). '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 110 of file FlatLinearValueConstraints.cpp.
References getFlattenedAffineExprs().
LogicalResult mlir::getFlattenedAffineExprs | ( | AffineMap | map, |
std::vector< SmallVector< int64_t, 8 >> * | flattenedExprs, | ||
FlatLinearConstraints * | localVarCst = nullptr |
||
) |
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., semi-affine is not yet handled). '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., semi-affine expressions not handled yet).
Definition at line 123 of file FlatLinearValueConstraints.cpp.
References getFlattenedAffineExprs(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResults(), and success().
Referenced by mlir::FlatLinearValueConstraints::FlatLinearValueConstraints(), mlir::FlatLinearConstraints::flattenAlignedMapAndMergeLocals(), getFlattenedAffineExpr(), getMultiAffineFunctionFromMap(), and mlir::affine::getRelationFromMap().
LogicalResult mlir::getFlattenedAffineExprs | ( | IntegerSet | set, |
std::vector< SmallVector< int64_t, 8 >> * | flattenedExprs, | ||
FlatLinearConstraints * | cst = nullptr |
||
) |
Definition at line 137 of file FlatLinearValueConstraints.cpp.
References mlir::IntegerSet::getConstraints(), getFlattenedAffineExprs(), mlir::IntegerSet::getNumConstraints(), mlir::IntegerSet::getNumDims(), mlir::IntegerSet::getNumSymbols(), and success().
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.
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.
0
___________|___________ 1 2 3 4 |_______| |______| | | | | 5 6 |___|_____________| | | 7 8 |_______________| | 9
Assuming all local orders match the numbering order:
forwardSlice
may contain: {9, 7, 8, 5, 1, 2, 6, 3, 4}Definition at line 53 of file SliceAnalysis.cpp.
Referenced by computeDestructuringInfo(), mlir::linalg::hoistRedundantVectorTransfers(), and promoteSingleIterReductionLoop().
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 69 of file SliceAnalysis.cpp.
References getForwardSliceImpl(), mlir::Value::getUsers(), and options.
SmallVector< int64_t > mlir::getI64SubArray | ( | ArrayAttr | arrayAttr, |
unsigned | dropFront = 0 , |
||
unsigned | dropBack = 0 |
||
) |
Helper to return a subset of arrayAttr
as a vector of int64_t.
Definition at line 255 of file IndexingUtils.cpp.
References dropFront().
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 247 of file Utils.cpp.
References mlir::Operation::getRegions().
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 293 of file ReshapeOpsUtils.cpp.
References mlir::detail::enumerate().
|
static |
Calculates maximum dimension and symbol positions from the expressions in exprsLists
and stores them in maxDim
and maxSym
respectively.
Definition at line 672 of file AffineMap.h.
References max().
Referenced by inferFromExprList(), and willBeValidAffineMap().
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 170 of file StaticValueUtils.cpp.
References mlir::Builder::getI64IntegerAttr().
LogicalResult mlir::getMultiAffineFunctionFromMap | ( | AffineMap | map, |
presburger::MultiAffineFunction & | multiAff | ||
) |
Definition at line 1286 of file FlatLinearValueConstraints.cpp.
References mlir::LogicalResult::failed(), failure(), getFlattenedAffineExprs(), mlir::presburger::IntegerRelation::getLocalReprs(), mlir::AffineMap::getNumDims(), mlir::presburger::DivisionRepr::getNumDivs(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), mlir::AffineMap::getNumSymbols(), mlir::presburger::DivisionRepr::hasAllReprs(), and success().
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 32 of file StaticValueUtils.cpp.
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 2910 of file MemRefOps.cpp.
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 860 of file Utils.cpp.
References getPerfectlyNestedLoopsImpl().
llvm::SmallBitVector mlir::getPositionsOfShapeOne | ( | unsigned | rank, |
ArrayRef< int64_t > | shape | ||
) |
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 882 of file AffineMap.cpp.
References compressUnusedSymbols(), and projectDims().
SmallVector< NamedAttribute > mlir::getPrunedAttributeList | ( | Operation * | op, |
ArrayRef< StringRef > | elidedAttrs | ||
) |
Definition at line 218 of file StructuredOpsUtils.cpp.
Referenced by mlir::tensor::bubbleUpPadSlice().
|
constexpr |
Attribute name for the ArrayAttr which encodes reassociation indices.
Definition at line 31 of file ReshapeOpsUtils.h.
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().
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().
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().
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.
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().
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.
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.
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).
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:
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 143 of file SliceAnalysis.cpp.
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 276 of file ReshapeOpsUtils.cpp.
References getConstantIntValue(), and isEqualConstantIntOrValue().
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 837 of file BuiltinTypes.cpp.
References getStridesAndOffset(), and succeeded().
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:
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 807 of file BuiltinTypes.cpp.
References failed(), failure(), and success().
Referenced by mlir::MemRefDescriptor::bufferPtr(), mlir::LLVMTypeConverter::canConvertToBarePtr(), mlir::bufferization::castOrReallocMemRefValue(), computeCollapsedLayoutMap(), computeExpandedLayoutMap(), computeMemRefRankReductionMask(), mlir::MemRefDescriptor::fromStaticShape(), getCastCompatibleMemRefType(), getConstantOffset(), getConstantStrides(), getFlatOffsetAndStrides(), mlir::spirv::getOpenCLElementPtr(), getStaticallyKnownRowStride(), getStridesAndOffset(), getTypeNumBytes(), mlir::spirv::getVulkanElementPtr(), hasFullyDynamicLayoutMap(), haveCompatibleOffsets(), haveCompatibleStrides(), inferTransposeResultType(), isLastMemrefDimUnitStride(), mlir::memref::isStaticShapeAndContiguousRowMajor(), isStrided(), mlirMemRefTypeGetStridesAndOffset(), mlir::memref::populateMemRefNarrowTypeEmulationConversions(), and trailingNDimsContiguous().
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().
Get a topologically sorted list of blocks of the given region.
Definition at line 840 of file RegionUtils.cpp.
References mlir::Region::getBlocks().
Referenced by convertOmpOpRegions().
Definition at line 892 of file AffineMap.cpp.
Referenced by compressUnusedDims().
Definition at line 904 of file AffineMap.cpp.
Referenced by compressUnusedSymbols().
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 70 of file RegionUtils.cpp.
References getUsedValuesDefinedAbove().
void mlir::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.
Definition at line 63 of file RegionUtils.cpp.
References mlir::IROperand< DerivedT, IRValueT >::get(), and visitUsedValuesDefinedAbove().
Referenced by mlir::async::cloneConstantsIntoTheRegion(), getUsedValuesDefinedAbove(), makeRegionIsolatedFromAbove(), outlineExecuteOp(), outlineKernelFuncImpl(), outlineSingleBlockRegion(), and sinkOperationsIntoLaunchOp().
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 50 of file Utils.cpp.
References mlir::OpBuilder::create(), mlir::Value::getType(), and mlir::Type::isIndex().
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 193 of file Utils.cpp.
References getValueOrCreateConstantIndexOp().
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 IntegerAttribute. Other attribute types are not supported.
Definition at line 41 of file Utils.cpp.
References mlir::OpBuilder::create().
Referenced by mlir::tensor::bubbleUpPadSlice(), HopperBuilder::buildAndInitBarrierInSharedMemory(), HopperBuilder::buildBarrierArriveTx(), HopperBuilder::buildGlobalMemRefDescriptor(), buildLinearId(), calculateExpandedAccessIndices(), createInBoundsCond(), mlir::affine::delinearizeIndex(), generateLoopNestUsingForOp(), getBoundedTileSize(), getCompressedMaskOp(), getIndicesForLoadOrStore(), getOffsetForBitwidth(), getValueOrCreateConstantIndexOp(), mlir::memref::multiBuffer(), mlir::linalg::offsetIndices(), mlir::linalg::promoteSubviewAsNewBuffer(), mlir::affine::resolveIndicesIntoOpWithOffsetsAndStrides(), resolveSourceIndicesCollapseShape(), resolveSourceIndicesExpandShape(), and unpackRanges().
SmallVector<int64_t> mlir::getValuesSortedByKey | ( | ArrayRef< Attribute > | keys, |
ArrayRef< int64_t > | values, | ||
llvm::function_ref< bool(Attribute, Attribute)> | compare | ||
) |
Definition at line 234 of file StaticValueUtils.cpp.
References mlir::presburger::compare(), and getValuesSortedByKeyImpl().
SmallVector< OpFoldResult > mlir::getValuesSortedByKey | ( | ArrayRef< Attribute > | keys, |
ArrayRef< OpFoldResult > | values, | ||
llvm::function_ref< bool(Attribute, Attribute)> | compare | ||
) |
Definition at line 228 of file StaticValueUtils.cpp.
References mlir::presburger::compare(), and getValuesSortedByKeyImpl().
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 222 of file StaticValueUtils.cpp.
References mlir::presburger::compare(), and getValuesSortedByKeyImpl().
Referenced by rewriteOneForallCommonImpl().
|
static |
Helper to sort values
according to matching keys
.
Definition at line 206 of file StaticValueUtils.cpp.
Referenced by getValuesSortedByKey().
Returns true if op
has an effect of type EffectTy
on value
.
If no value
is provided, simply check if effects of the given type(s) are present.
Definition at line 134 of file SideEffectInterfaces.cpp.
inline ::llvm::hash_code mlir::hash_value | ( | AffineExpr | arg | ) |
Make AffineExpr hashable.
Definition at line 261 of file AffineExpr.h.
Referenced by mlir::OperationEquivalence::directHashValue(), llvm::DenseMapInfo< mlir::AffineExpr >::getHashValue(), llvm::DenseMapInfo< mlir::AffineMap >::getHashValue(), llvm::DenseMapInfo< mlir::Attribute >::getHashValue(), llvm::DenseMapInfo< mlir::IntegerSet >::getHashValue(), llvm::DenseMapInfo< mlir::Location >::getHashValue(), llvm::DenseMapInfo< mlir::NamedAttribute >::getHashValue(), llvm::DenseMapInfo< mlir::Type >::getHashValue(), llvm::DenseMapInfo< mlir::TypeID >::getHashValue(), and llvm::DenseMapInfo< mlir::Value >::getHashValue().
inline ::llvm::hash_code mlir::hash_value | ( | AffineMap | arg | ) |
Definition at line 400 of file AffineMap.h.
inline ::llvm::hash_code mlir::hash_value | ( | Attribute | arg | ) |
Definition at line 193 of file Attributes.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
References mlir::AsmDialectResourceHandle::getResource().
inline ::llvm::hash_code mlir::hash_value | ( | const NamedAttribute & | arg | ) |
Definition at line 251 of file Attributes.h.
inline ::llvm::hash_code mlir::hash_value | ( | IntegerSet | arg | ) |
Definition at line 124 of file IntegerSet.h.
inline ::llvm::hash_code mlir::hash_value | ( | Location | arg | ) |
Definition at line 123 of file Location.h.
|
inline |
Definition at line 516 of file OperationSupport.h.
References mlir::OperationName::getAsOpaquePointer().
inline ::llvm::hash_code mlir::hash_value | ( | TypeID | id | ) |
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().
inline ::llvm::hash_code mlir::hash_value | ( | Value | arg | ) |
bool mlir::hasNonIdentityLayout | ( | Type | type | ) |
Returns true iff the type is a MemRefType and has a non-identity layout.
Definition at line 269 of file ReshapeOpsUtils.cpp.
Referenced by mlir::ComposeCollapseOfExpandOp< CollapseOpTy, ExpandOpTy, CastOpTy >::matchAndRewrite(), mlir::ComposeExpandOfCollapseOp< ExpandOpTy, CollapseOpTy >::matchAndRewrite(), and mlir::ComposeReassociativeReshapeOps< ReshapeOpTy >::matchAndRewrite().
Returns true if op
has only an effect of type EffectTy
(and of no other type) on value
.
If no value is provided, simply check if effects of that type and only of that type are present.
Definition at line 107 of file SideEffectInterfaces.cpp.
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 259 of file StaticValueUtils.cpp.
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 265 of file StaticValueUtils.cpp.
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:
Is rewritten to:
Definition at line 392 of file LoopInvariantCodeMotionUtils.cpp.
References hoistSubsetAtIterArg().
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 428 of file InliningUtils.cpp.
References mlir::Region::empty(), failure(), and mlir::Region::front().
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 366 of file InliningUtils.cpp.
References inlineRegionImpl().
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 388 of file InliningUtils.cpp.
References inlineRegionImpl().
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 356 of file InliningUtils.cpp.
References mlir::Operation::getBlock().
Referenced by inlineRegion().
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 378 of file InliningUtils.cpp.
References mlir::Operation::getBlock(), and inlineRegion().
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.
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.
a
and b
(ancestor) that implements RegionBranchOpInterface.regionA
and regionB
in which a
and b
are contained.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(), and isRegionReachable().
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:
returns:
Example 2:
returns:
Example 3:
returns:
Example 4:
returns:
Definition at line 779 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().
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:
map
has no symbols.Example 1:
returns:
Example 2:
returns:
Definition at line 755 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(), mlir::linalg::makeTransposeOp(), and mlir::linalg::rewriteInIm2Col().
SmallVector< int64_t > mlir::invertPermutationVector | ( | ArrayRef< int64_t > | permutation | ) |
Helper method to apply to inverse a permutation.
Definition at line 205 of file IndexingUtils.cpp.
References mlir::detail::enumerate().
Referenced by getPackUnpackNormalizedPerm(), inferStaticShape(), mlir::linalg::lowerPack(), mlir::linalg::GeneralizeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), and vectorizeAsTensorPackOp().
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().
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().
bool mlir::isBytecode | ( | llvm::MemoryBufferRef | buffer | ) |
Returns true if the given buffer starts with the magic bytes that signal MLIR bytecode.
Definition at line 2565 of file BytecodeReader.cpp.
Referenced by readBytecodeFileImpl().
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::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().
bool mlir::isConstantIntValue | ( | OpFoldResult | ofr, |
int64_t | value | ||
) |
Return true if ofr
is constant integer equal to value
.
Definition at line 139 of file StaticValueUtils.cpp.
References getConstantIntValue().
Referenced by mlir::tensor::bubbleUpPadSlice(), calculateTileOffsetsAndSizes(), generateLoopNestUsingForallOp(), and generateLoopNestUsingForOp().
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 148 of file StaticValueUtils.cpp.
References getConstantIntValue().
Referenced by mlir::bufferization::Ownership::getCombined(), getSlicedDimensions(), PadOpVectorizationWithTransferWritePattern::hasSameTensorSize(), haveSameTiles(), and isEqualConstantIntOrValueArray().
bool mlir::isEqualConstantIntOrValueArray | ( | ArrayRef< OpFoldResult > | ofrs1, |
ArrayRef< OpFoldResult > | ofrs2 | ||
) |
Definition at line 157 of file StaticValueUtils.cpp.
References isEqualConstantIntOrValue().
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 mlir::linalg::lowerUnPack().
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 964 of file BuiltinTypes.cpp.
References getStridesAndOffset(), and succeeded().
Referenced by isMemRefTypeSupported(), and trailingNDimsContiguous().
bool mlir::isLegalForBranchOpInterfaceTypeConversionPattern | ( | Operation * | op, |
TypeConverter & | converter | ||
) |
Return true if op is a BranchOpInterface op whose operands are all legal according to converter.
Definition at line 124 of file FuncConversions.cpp.
bool mlir::isLegalForReturnOpTypeConversionPattern | ( | Operation * | op, |
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 145 of file FuncConversions.cpp.
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().
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 161 of file SideEffectInterfaces.cpp.
Referenced by checkTransformationPreconditions(), matchReduction(), and noAliasingUseInLoop().
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 159 of file FuncConversions.cpp.
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.
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.
bool mlir::isPermutationVector | ( | ArrayRef< int64_t > | interchange | ) |
Method to check if an interchange vector is a permutation.
Definition at line 222 of file IndexingUtils.cpp.
Referenced by commonPermutationOfPackAndUnPackOp(), mlir::tensor::computeTransposedType(), mlir::linalg::makeTransposeOp(), mlir::linalg::packMatmulGreedily(), mlir::linalg::packTranspose(), and mlir::detail::TileOffsetRangeImpl::TileOffsetRangeImpl().
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 244 of file SideEffectInterfaces.cpp.
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 446 of file BuiltinTypes.cpp.
References computeRankReductionMask(), ElemTypeMismatch, RankTooLarge, SizeMismatch, and Success.
Referenced by mlir::linalg::lowerPack(), and verifyInsertSliceOp().
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().
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::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().
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::get(), get(), mlir::AffineExpr::getContext(), mlir::AffineMap::getNumInputs(), mlir::AffineMap::getNumResults(), and mlir::AffineMap::getResult().
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 218 of file SideEffectInterfaces.cpp.
bool mlir::isStrided | ( | MemRefType | t | ) |
Return "true" if the layout for t
is compatible with strided semantics.
Definition at line 957 of file BuiltinTypes.cpp.
References getStridesAndOffset(), and succeeded().
Referenced by mlir::affine::AffineDmaStartOp::parse(), and mlir::affine::AffineDmaStartOp::print().
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().
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 mlir::Value::getDefiningOp().
Referenced by mlir::linalg::computeTileOffsets(), mlir::linalg::computeTileSizes(), generateLoopNest(), and mlir::linalg::rewriteInDestinationPassingStyle().
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 compileAndExecuteVoidFunction(), Error, failed(), getCommandLineOptLevel(), mlir::JitRunnerConfig::llvmModuleBuilder, makeOptimizingTransformer(), makeStringError(), mlir::JitRunnerConfig::mlirTransformer, options, parseMLIRInput(), and mlir::JitRunnerConfig::runtimesymbolMap.
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().
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().
AffineExpr mlir::linearize | ( | MLIRContext * | ctx, |
ArrayRef< AffineExpr > | offsets, | ||
ArrayRef< int64_t > | basis | ||
) |
Definition at line 181 of file IndexingUtils.cpp.
References getAffineConstantExprs(), and linearize().
mlir::LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE | ( | ) |
Enable Bitmask enums for OperationEquivalence::Flags.
LogicalResult 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 success if the loop is unrolled.
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 355 of file Utils.cpp.
References ceilDiv(), ceilDivPositive(), mlir::OpBuilder::clone(), mlir::OpBuilder::create(), failed(), failure(), generateUnrolledLoop(), getConstantIntValue(), mlir::OpBuilder::setInsertionPoint(), and success().
Emit code that computes the lower bound of the given affine loop using standard arithmetic operations.
Referenced by getOrEmitLowerBound().
Emit code that computes the upper bound of the given affine loop using standard arithmetic operations.
Referenced by getOrEmitUpperBound().
|
inline |
Matches a constant scalar / vector splat / tensor splat float (both positive and negative) zero.
Definition at line 340 of file Matchers.h.
Referenced by isZeroValue().
|
inline |
Matches a named attribute operation.
Definition at line 315 of file Matchers.h.
|
inline |
Matches a named attribute operation and writes the value to bind_value.
Definition at line 333 of file Matchers.h.
|
inline |
Matches a constant foldable operation.
Definition at line 310 of file Matchers.h.
Referenced by mlir::LocalAliasAnalysis::aliasImpl(), canonicalizeMapOrSetAndOperands(), createNewAliasScopesFromNoAliasParameter(), mlir::Operation::fold(), foldDynamicIndexList(), foldLoopBounds(), getAsOpFoldResult(), mlir::shape::getShapeVec(), getSinglyExecutedRegionsToSink(), mlir::ValueShapeRange::getValueAsShape(), handleInlinedAllocas(), integerConstants(), isDefinedOutsideOrConstant(), mlir::affine::isValidSymbol(), mlir::affine::makeComposedFoldedAffineApply(), makeComposedFoldedMinMax(), mlir::linalg::makeComposedPadHighOp(), UModSimplification::matchAndRewrite(), mlir::LLVM::ModuleImport::matchFloatAttr(), mlir::LLVM::ModuleImport::matchIntegerAttr(), materializeConstant(), movePaddingToFillOrGenericOp(), and remainsLegalAfterInline().
|
inline |
Matches a value from a constant foldable operation and writes the value to bind_value.
Definition at line 327 of file Matchers.h.
|
inline |
Matches a constant holding a scalar/vector/tensor float (splat) and writes the float value to bind_value.
Definition at line 431 of file Matchers.h.
|
inline |
Matches a constant holding a scalar/vector/tensor integer (splat) and writes the integer value to bind_value.
Definition at line 438 of file Matchers.h.
Referenced by allocateSubviewGPUMemoryInAddressSpace(), destructureIndices(), getConstantIntValue(), getConstantIntValue(), getConstantUint32(), getIntOrSplatIntValue(), and maybeConstantDimsAttr().
|
inline |
Matches a constant scalar / vector splat / tensor splat float negative infinity.
Definition at line 371 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat float negative zero.
Definition at line 350 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat integer that is any non-zero value.
Definition at line 384 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat integer one.
Definition at line 389 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat float ones.
Definition at line 355 of file Matchers.h.
|
inline |
Matches the given OpClass.
Definition at line 395 of file Matchers.h.
auto mlir::m_Op | ( | Matchers... | matchers | ) |
Definition at line 443 of file Matchers.h.
|
inline |
Matches a named operation.
Definition at line 320 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat float positive infinity.
Definition at line 363 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat float positive zero.
Definition at line 345 of file Matchers.h.
|
inline |
Matches a constant scalar / vector splat / tensor splat integer zero.
Definition at line 378 of file Matchers.h.
Referenced by isZeroValue().
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:
20*exprs[0] + 5*exprs[1] + exprs[2]
.s0*exprs[0] + 5*exprs[1] + exprs[2]
.s1*exprs[0] + s0*exprs[1] + exprs[2]
. Definition at line 916 of file BuiltinTypes.cpp.
References getAffineConstantExpr(), getAffineSymbolExpr(), mlir::AffineMap::inferFromExprList(), and simplifyAffineExpr().
Referenced by canonicalizeStridedLayout(), getStridesAndOffset(), and makeCanonicalStridedLayoutExpr().
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 948 of file BuiltinTypes.cpp.
References getAffineDimExpr(), and makeCanonicalStridedLayoutExpr().
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 JitRunnerMain(), mlir::gpu::SerializeToBlobPass::optimizeLlvm(), and mlir::LLVM::ModuleToObject::optimizeModule().
SmallVector< Value > mlir::makeRegionIsolatedFromAbove | ( | RewriterBase & | rewriter, |
Region & | region, | ||
llvm::function_ref< bool(Operation *)> | cloneOperationIntoRegion = [](Operation *) { return false; } |
||
) |
Make a region isolated from above.
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 80 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().
std::string mlir::makeReproducer | ( | StringRef | anchorName, |
const llvm::iterator_range< OpPassManager::pass_iterator > & | passes, | ||
Operation * | op, | ||
StringRef | outputFile, | ||
bool | disableThreads = false , |
||
bool | verifyPasses = false |
||
) |
Definition at line 447 of file PassCrashRecovery.cpp.
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.
Definition at line 1790 of file BuiltinAttributes.cpp.
References mlir::detail::enumerate(), mlir::AffineMap::get(), getAffineConstantExpr(), getAffineDimExpr(), and getAffineSymbolExpr().
detail::op_matcher< arith::ConstantIndexOp > mlir::matchConstantIndex | ( | ) |
|
inline |
Entry point for matching a pattern over an Attribute.
Returns false
when attr
is null.
Definition at line 419 of file Matchers.h.
|
inline |
Entry point for matching a pattern over an Operation.
Definition at line 411 of file Matchers.h.
Entry point for matching a pattern over a Value.
Definition at line 401 of file Matchers.h.
Referenced by mlir::LocalAliasAnalysis::aliasImpl(), allocateSubviewGPUMemoryInAddressSpace(), canonicalizeMapOrSetAndOperands(), createNewAliasScopesFromNoAliasParameter(), destructureIndices(), mlir::Operation::fold(), foldDynamicIndexList(), foldLoopBounds(), getAsOpFoldResult(), getAttributeIndexFromIndexOperands(), getConstantIntValue(), getConstantIntValue(), getConstantUint32(), getIntOrSplatIntValue(), mlir::shape::getShapeVec(), getSinglyExecutedRegionsToSink(), mlir::ValueShapeRange::getValueAsShape(), handleInlinedAllocas(), integerConstants(), isDefinedOutsideOrConstant(), mlir::affine::isValidSymbol(), isZeroValue(), mlir::affine::makeComposedFoldedAffineApply(), makeComposedFoldedMinMax(), mlir::linalg::makeComposedPadHighOp(), UModSimplification::matchAndRewrite(), mlir::LLVM::ModuleImport::matchFloatAttr(), mlir::LLVM::ModuleImport::matchIntegerAttr(), materializeConstant(), maybeConstantDimsAttr(), movePaddingToFillOrGenericOp(), and remainsLegalAfterInline().
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:
iterCarriedArgs
.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 279 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 matchLinalgReduction(), and matchSimpleReduction().
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().
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().
LogicalResult mlir::MlirLspServerMain | ( | int | argc, |
char ** | argv, | ||
DialectRegistry & | registry | ||
) |
Implementation for tools like mlir-lsp-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.
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 registrationAndParseCLIOptions so that CLI options can be accessed before running MlirOptMain.
Definition at line 555 of file MlirOptMain.cpp.
References mlir::MlirOptMainConfig::createFromCLOptions(), failed(), failure(), MlirOptMain(), openInputFile(), openOutputFile(), printRegisteredDialects(), mlir::MlirOptMainConfig::shouldShowDialects(), and success().
LogicalResult mlir::MlirOptMain | ( | int | argc, |
char ** | argv, | ||
llvm::StringRef | toolName, | ||
DialectRegistry & | registry | ||
) |
Implementation for tools like mlir-opt
.
--help
.Definition at line 596 of file MlirOptMain.cpp.
References MlirOptMain(), and registerAndParseCLIOptions().
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
.
Definition at line 524 of file MlirOptMain.cpp.
References printRegisteredDialects(), and mlir::MlirOptMainConfig::shouldShowDialects().
Referenced by MlirOptMain().
LogicalResult mlir::MlirPdllLspServerMain | ( | int | argc, |
char ** | argv | ||
) |
Implementation for tools like mlir-pdll-lsp-server
.
Definition at line 20 of file MlirPdllLspServerMain.cpp.
References mlir::lsp::Logger::Debug, mlir::lsp::Delimited, mlir::lsp::Logger::Error, mlir::lsp::Logger::Info, options, mlir::lsp::runPdllLSPServer(), mlir::lsp::Logger::setLogLevel(), and mlir::lsp::Standard.
mlir::LogicalResult mlir::mlirQueryMain | ( | int | argc, |
char ** | argv, | ||
MLIRContext & | context, | ||
const mlir::query::matcher::Registry & | matcherRegistry | ||
) |
Definition at line 32 of file MlirQueryMain.cpp.
References mlir::MLIRContext::allowUnregisteredDialects(), mlir::query::complete(), failed(), failure(), mlir::OwningOpRef< OpTy >::get(), openInputFile(), mlir::query::parse(), parseSourceFile(), success(), and mlir::query::QuerySession::terminate.
LogicalResult mlir::mlirReduceMain | ( | int | argc, |
char ** | argv, | ||
MLIRContext & | context | ||
) |
Definition at line 49 of file MlirReduceMain.cpp.
References mlir::PassPipelineCLParser::addToPipeline(), emitError(), failed(), failure(), mlir::OwningOpRef< OpTy >::get(), get(), loadModule(), openOutputFile(), and success().
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.
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
.
|
inline |
Returns MLIR's mod operation on constants.
MLIR's mod operation yields the remainder of the Euclidean division of 'lhs' by 'rhs', and is therefore not C's % operator. The RHS is always expected to be positive, and the result is always non-negative.
Definition at line 45 of file MathExtras.h.
Referenced by mlir::AllocationOpLLVMLowering::createAligned(), mlir::sparse_tensor::genMapBuffers(), getBoundForAffineExpr(), parseScheduleClause(), prepareLLVMModule(), simplifyMod(), and verifyScheduleModifiers().
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:
After LICM:
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.
Referenced by mlir::linalg::hoistRedundantVectorTransfers(), and moveLoopInvariantCode().
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().
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().
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().
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 mlir::SimpleObjectCache::dumpToObjectFile(), mlir::tracing::InstallDebugHandler::Impl::Impl(), makeReproducerStreamFactory(), MlirOptMain(), and mlirReduceMain().
Definition at line 259 of file OpDefinition.h.
References mlir::OpState::getOperation().
|
inline |
Definition at line 251 of file ControlFlowInterfaces.h.
|
inline |
Definition at line 1058 of file BuiltinAttributes.h.
|
inline |
Definition at line 1064 of file BuiltinAttributes.h.
|
inline |
Definition at line 1070 of file BuiltinAttributes.h.
|
inline |
Definition at line 1074 of file BuiltinAttributes.h.
|
inline |
Definition at line 45 of file DataFlowFramework.h.
References NoChange.
|
inline |
Definition at line 266 of file AffineExpr.h.
|
inline |
Definition at line 265 of file AffineExpr.h.
|
inline |
Definition at line 267 of file AffineExpr.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inlinedelete |
Definition at line 96 of file OpImplementation.h.
|
inlinedelete |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 96 of file OpImplementation.h.
|
inline |
Definition at line 534 of file OpImplementation.h.
References mlir::OpAsmPrinter::printSuccessor().
|
inline |
Definition at line 529 of file OpImplementation.h.
References mlir::OpAsmPrinter::printOperands().
|
inline |
Definition at line 520 of file OpImplementation.h.
References mlir::OpAsmPrinter::printOperand().
raw_ostream & mlir::operator<< | ( | raw_ostream & | os, |
const ConstantIntRanges & | range | ||
) |
Definition at line 125 of file InferIntRangeInterface.cpp.
References mlir::ConstantIntRanges::smax(), mlir::ConstantIntRanges::smin(), mlir::ConstantIntRanges::umax(), and mlir::ConstantIntRanges::umin().
raw_ostream & mlir::operator<< | ( | raw_ostream & | os, |
AffineExpr | expr | ||
) |
Definition at line 998 of file AffineExpr.cpp.
References mlir::AffineExpr::print().
|
inline |
Definition at line 639 of file AffineMap.h.
References mlir::AffineMap::print().
|
inline |
Definition at line 163 of file Attributes.h.
References mlir::Attribute::print().
|
inline |
Definition at line 78 of file AliasAnalysis.h.
References mlir::AliasResult::print().
|
inline |
Definition at line 499 of file DataFlowFramework.h.
|
inline |
Definition at line 296 of file Diagnostics.h.
References diag().
|
inline |
Definition at line 144 of file Diagnostics.h.
References mlir::DiagnosticArgument::print().
raw_ostream& mlir::operator<< | ( | raw_ostream & | os, |
const IRUnit & | unit | ||
) |
|
inline |
Definition at line 117 of file Location.h.
References mlir::Location::print().
|
inline |
Definition at line 165 of file AliasAnalysis.h.
References mlir::ModRefResult::print().
|
inline |
Definition at line 1090 of file Operation.h.
raw_ostream & mlir::operator<< | ( | raw_ostream & | os, |
const Range & | range | ||
) |
Definition at line 2902 of file MemRefOps.cpp.
References mlir::Range::offset, mlir::Range::size, and mlir::Range::stride.
|
inline |
Emit a type range to the given output stream.
Definition at line 77 of file TypeRange.h.
raw_ostream & mlir::operator<< | ( | raw_ostream & | os, |
mlir::Block & | block | ||
) |
Definition at line 27 of file CFGLoopInfo.cpp.
References mlir::Block::print().
|
inline |
Definition at line 510 of file OperationSupport.h.
References mlir::OperationName::print().
|
inline |
Allow printing to a stream.
Definition at line 300 of file OpDefinition.h.
|
inline |
Allow printing to a stream.
Definition at line 308 of file OpDefinition.h.
|
inline |
Definition at line 504 of file DataFlowFramework.h.
References mlir::ProgramPoint::print().
raw_ostream & mlir::operator<< | ( | raw_ostream & | os, |
SymbolTable::Visibility | visibility | ||
) |
Definition at line 466 of file SymbolTable.cpp.
References mlir::SymbolTable::Nested, mlir::SymbolTable::Private, and mlir::SymbolTable::Public.
|
inline |
Definition at line 250 of file Types.h.
References mlir::Type::print().
|
inline |
Definition at line 252 of file Value.h.
References mlir::Value::print().
|
inline |
Definition at line 163 of file TypeRange.h.
Definition at line 256 of file OpDefinition.h.
References mlir::OpState::getOperation().
|
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==().
|
inline |
Definition at line 1061 of file BuiltinAttributes.h.
|
inline |
Allow direct comparison with StringRef.
Definition at line 1067 of file BuiltinAttributes.h.
|
inline |
Definition at line 1071 of file BuiltinAttributes.h.
|
inline |
Definition at line 38 of file DataFlowFramework.h.
References Change.
|
inline |
Definition at line 41 of file DataFlowFramework.h.
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:
thenFn
is not null, thenFnName
must be specified and the then
region is inlined into a new FuncOp that is captured by the pointer.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 224 of file Utils.cpp.
References failed(), failure(), outlineSingleBlockRegion(), and success().
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
operands
, in that order.launchOp
and defined above it. These captured values are appended to the operands
list. Definition at line 265 of file KernelOutlining.cpp.
References outlineKernelFuncImpl().
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 120 of file Utils.cpp.
References mlir::Region::begin(), mlir::OpBuilder::clone(), mlir::OpBuilder::create(), mlir::OpBuilder::createBlock(), mlir::RewriterBase::eraseOp(), failure(), 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().
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().
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(), and success().
Referenced by parallelFor(), and parallelForEach().
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().
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.
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 2778 of file Parser.cpp.
References get(), and mlir::ParserConfig::getContext().
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().
ParseResult mlir::parseDimensionList | ( | OpAsmParser & | parser, |
DenseI64ArrayAttr & | dimensions | ||
) |
Definition at line 3981 of file AsmPrinter.cpp.
References mlir::AsmParser::emitError(), failed(), mlir::detail::DenseArrayAttrImpl< T >::get(), mlir::AsmParser::getContext(), mlir::AsmParser::getCurrentLocation(), mlir::AsmParser::parseDimensionList(), mlir::AsmParser::parseOptionalLSquare(), mlir::AsmParser::parseRSquare(), succeeded(), and success().
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]":
result
is filled with the i64 ArrayAttr "[`kDynamic`, 7, 42,
`kDynamic`]"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::LogicalResult::failed(), failed(), failure(), 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(), mlir::AsmParser::parseOptionalRSquare(), mlir::LogicalResult::succeeded(), succeeded(), and success().
Referenced by parseDynamicIndexList(), and mlir::transform::parsePackedOrDynamicIndexList().
|
inline |
Definition at line 149 of file ViewLikeInterface.h.
References parseDynamicIndexList().
|
inline |
Definition at line 158 of file ViewLikeInterface.h.
References parseDynamicIndexList().
|
inline |
Definition at line 140 of file ViewLikeInterface.h.
References parseDynamicIndexList().
IntegerSet mlir::parseIntegerSet | ( | llvm::StringRef | str, |
MLIRContext * | context | ||
) |
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 704 of file PassRegistry.cpp.
References failed(), failure(), and success().
Referenced by mlir::PassPipelineCLParser::addToPipeline(), mlir::PassReproducerOptions::apply(), mlirOpPassManagerAddPipeline(), mlirParsePassPipeline(), and parsePassPipeline().
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 718 of file PassRegistry.cpp.
References failed(), failure(), and parsePassPipeline().
ParseResult mlir::parseSemiFunctionType | ( | OpAsmParser & | parser, |
Type & | argumentType, | ||
SmallVectorImpl< Type > & | resultTypes | ||
) |
Definition at line 28 of file Syntax.cpp.
References mlir::LogicalResult::failed(), failure(), mlir::AsmParser::parseArrow(), mlir::AsmParser::parseOptionalLParen(), mlir::AsmParser::parseRParen(), mlir::AsmParser::parseType(), mlir::AsmParser::parseTypeList(), mlir::LogicalResult::succeeded(), and success().
ParseResult mlir::parseSemiFunctionType | ( | OpAsmParser & | parser, |
Type & | argumentType, | ||
Type & | resultType | ||
) |
Parses a single non-function type or a function type with at least one argument.
This allows for the following syntax:
(
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::LogicalResult::failed(), failure(), mlir::AsmParser::parseArrow(), mlir::AsmParser::parseOptionalLParen(), mlir::AsmParser::parseRParen(), mlir::AsmParser::parseType(), mlir::LogicalResult::succeeded(), and success().
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().
|
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.
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.
|
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.
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.
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.
|
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.
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.
|
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.
|
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.
|
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 parseSourceFile().
Referenced by loadModule(), and parseMLIRInput().
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().
|
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 failed(), mlir::ParserConfig::getContext(), and parseSourceString().
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().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateAMDGPUToROCDLConversionPatterns | ( | 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 858 of file AMDGPUToROCDL.cpp.
References mlir::RewritePatternSet::add(), mlir::TypeConverter::addConversion(), mlir::LLVMTypeConverter::convertType(), and get().
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 205 of file LegalizeForLLVMExport.cpp.
References mlir::RewritePatternSet::add().
void mlir::populateAnyFunctionOpInterfaceTypeConversionPattern | ( | RewritePatternSet & | patterns, |
const TypeConverter & | converter | ||
) |
Definition at line 3369 of file DialectConversion.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateArithToEmitCPatterns | ( | TypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Definition at line 88 of file ArithToEmitC.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 916 of file ArmSMEToLLVM.cpp.
References mlir::TypeConverter::addConversion(), and mlir::arm_sme::isValidSMETileVectorType().
void mlir::populateArmSMEToSCFConversionPatterns | ( | RewritePatternSet & | patterns | ) |
Collect a set of patterns to convert from the ArmSME dialect to SCF.
Definition at line 399 of file ArmSMEToSCF.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateArmSVELegalizeForLLVMExportPatterns | ( | 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 146 of file LegalizeForLLVMExport.cpp.
References mlir::RewritePatternSet::add(), and mlir::LLVMTypeConverter::getContext().
void mlir::populateAsyncFuncToAsyncRuntimeConversionPatterns | ( | RewritePatternSet & | patterns, |
ConversionTarget & | target | ||
) |
Definition at line 853 of file AsyncToAsyncRuntime.cpp.
References mlir::RewritePatternSet::add(), mlir::ConversionTarget::addDynamicallyLegalOp(), and mlir::RewritePatternSet::getContext().
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::RewritePatternSet::add(), mlir::TypeConverter::addConversion(), mlir::ConversionTarget::addDynamicallyLegalOp(), mlir::TypeConverter::convertType(), get(), and mlir::RewritePatternSet::getContext().
void mlir::populateBranchOpInterfaceTypeConversionPattern | ( | RewritePatternSet & | patterns, |
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.
void mlir::populateBuiltinFuncToSPIRVPatterns | ( | 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 811 of file SPIRVConversion.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateCallOpTypeConversionPattern | ( | RewritePatternSet & | patterns, |
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 46 of file FuncConversions.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by mlir::arith::populateArithNarrowTypeEmulationPatterns(), and mlir::arith::populateArithWideIntEmulationPatterns().
void mlir::populateCommutativityUtilsPatterns | ( | RewritePatternSet & | patterns | ) |
Populates the commutativity utility patterns.
Definition at line 312 of file CommutativityUtils.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateComplexToLLVMConversionPatterns | ( | 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 mlir::RewritePatternSet::add().
void mlir::populateComplexToSPIRVPatterns | ( | 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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateComplexToStandardConversionPatterns | ( | RewritePatternSet & | patterns | ) |
Populate the given list with patterns that convert from Complex to Standard.
Definition at line 1125 of file ComplexToStandard.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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::walk().
void mlir::populateConvertArmNeon2dToIntrPatterns | ( | RewritePatternSet & | patterns | ) |
Populates patterns for the lowering of Arm NEON 2D ops to intrinsics.
See createConvertArmNeon2dToIntrPass.
Definition at line 70 of file ArmNeon2dToIntr.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateConvertShapeConstraintsConversionPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 44 of file ConvertShapeConstraints.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateDecomposeCallGraphTypesPatterns | ( | MLIRContext * | context, |
TypeConverter & | typeConverter, | ||
ValueDecomposer & | decomposer, | ||
RewritePatternSet & | patterns | ||
) |
Populates the patterns needed to drive the conversion process for decomposing call graph types with the given ValueDecomposer
.
Definition at line 190 of file DecomposeCallGraphTypes.cpp.
References mlir::RewritePatternSet::add().
void mlir::populateExpandCeilFPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 508 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertCeilOp().
void mlir::populateExpandCoshPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 492 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertCoshOp().
void mlir::populateExpandCtlzPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 484 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertCtlzOp().
void mlir::populateExpandExp2FPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 512 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertExp2fOp().
void mlir::populateExpandFloorFPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 524 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertFloorOp().
void mlir::populateExpandFmaFPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 504 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertFmaFOp().
void mlir::populateExpandPowFPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 516 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertPowfOp().
void mlir::populateExpandRoundEvenPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 528 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertRoundEvenOp().
void mlir::populateExpandRoundFPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 520 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertRoundOp().
void mlir::populateExpandSinhPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 488 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertSinhOp().
void mlir::populateExpandTanhPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 500 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertTanhOp().
void mlir::populateExpandTanPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 496 of file ExpandPatterns.cpp.
References mlir::RewritePatternSet::add(), and convertTanOp().
void mlir::populateFinalizeMemRefToLLVMConversionPatterns | ( | 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 1653 of file MemRefToLLVM.cpp.
References mlir::RewritePatternSet::add(), mlir::LowerToLLVMOptions::AlignedAlloc, mlir::LowerToLLVMOptions::allocLowering, mlir::LLVMTypeConverter::getOptions(), and mlir::LowerToLLVMOptions::Malloc.
void mlir::populateFunctionOpInterfaceTypeConversionPattern | ( | RewritePatternSet & | patterns, |
const TypeConverter & | converter | ||
) |
Definition at line 640 of file DialectConversion.h.
References populateFunctionOpInterfaceTypeConversionPattern().
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 3362 of file DialectConversion.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by populateFunctionOpInterfaceTypeConversionPattern().
void mlir::populateFuncToEmitCPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 116 of file FuncToEmitC.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateFuncToLLVMConversionPatterns | ( | 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 752 of file FuncToLLVM.cpp.
References mlir::RewritePatternSet::add(), and populateFuncToLLVMFuncOpConversionPattern().
void mlir::populateFuncToLLVMFuncOpConversionPattern | ( | 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 747 of file FuncToLLVM.cpp.
References mlir::RewritePatternSet::add().
Referenced by populateFuncToLLVMConversionPatterns().
void mlir::populateFuncToSPIRVPatterns | ( | 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 91 of file FuncToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateFuncTypeConversionPatterns | ( | TypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Definition at line 119 of file OneToNFuncConversions.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by populateGpuRewritePatterns().
void mlir::populateGpuBreakDownSubgrupReducePatterns | ( | 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 309 of file SubgroupReduceLowering.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateGpuDecomposeMemrefsPatterns | ( | RewritePatternSet & | patterns | ) |
Collect a set of patterns to decompose memrefs ops.
Definition at line 227 of file DecomposeMemrefs.cpp.
References mlir::RewritePatternSet::getContext(), and mlir::RewritePatternSet::insert().
void mlir::populateGpuEliminateBarriersPatterns | ( | RewritePatternSet & | patterns | ) |
Erase barriers that do not enforce conflicting memory side effects.
Definition at line 618 of file EliminateBarriers.cpp.
References mlir::RewritePatternSet::getContext(), and mlir::RewritePatternSet::insert().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by populateGpuRewritePatterns().
void mlir::populateGpuLowerSubgroupReduceToShufflePattenrs | ( | 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.
Definition at line 317 of file SubgroupReduceLowering.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 686 of file GPUOpsLowering.cpp.
References mlir::TypeConverter::addTypeAttributeConversion(), and wrapNumericMemorySpace().
|
inline |
Collect all patterns to rewrite ops within the GPU dialect.
Definition at line 81 of file Passes.h.
References populateGpuAllReducePatterns(), populateGpuGlobalIdPatterns(), and 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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by populateGpuRewritePatterns().
void mlir::populateGpuSubgroupReduceOpLoweringPattern | ( | 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 320 of file LowerGpuOpsToNVVMOps.cpp.
References mlir::RewritePatternSet::add().
void mlir::populateGpuToLLVMConversionPatterns | ( | LLVMTypeConverter & | converter, |
RewritePatternSet & | patterns, | ||
StringRef | gpuBinaryAnnotation = {} , |
||
bool | kernelBarePtrCallConv = false , |
||
SymbolTable * | cachedModuleTable = nullptr |
||
) |
Collect a set of patterns to convert from the GPU dialect to LLVM and populate converter for gpu types.
Definition at line 1979 of file GPUToLLVMConversion.cpp.
References mlir::RewritePatternSet::add(), and mlir::LLVMTypeConverter::getContext().
void mlir::populateGpuToNVVMConversionPatterns | ( | LLVMTypeConverter & | converter, |
RewritePatternSet & | patterns | ||
) |
Collect a set of patterns to convert from the GPU dialect to NVVM.
Definition at line 325 of file LowerGpuOpsToNVVMOps.cpp.
References mlir::RewritePatternSet::add(), get(), mlir::LLVMTypeConverter::getContext(), mlir::NVVM::kSharedMemoryAlignmentBit, and kSharedMemorySpace.
void mlir::populateGpuToROCDLConversionPatterns | ( | 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 349 of file LowerGpuOpsToROCDLOps.cpp.
void mlir::populateGPUToSPIRVPatterns | ( | 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 614 of file GPUToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateGpuWMMAToNVVMConversionPatterns | ( | 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 mlir::RewritePatternSet::add().
void mlir::populateGpuWMMAToSPIRVCoopMatrixKHRConversionPatterns | ( | 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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateLowerForeachToSCFPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 1448 of file SparseTensorRewriting.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateLowerSparseOpsToForeachPatterns | ( | RewritePatternSet & | patterns, |
bool | enableRT, | ||
bool | enableConvert | ||
) |
Definition at line 1432 of file SparseTensorRewriting.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateMathAlgebraicSimplificationPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 224 of file AlgebraicSimplification.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateMathPolynomialApproximationPatterns | ( | RewritePatternSet & | patterns, |
const MathPolynomialApproximationOptions & | options = {} |
||
) |
Definition at line 1495 of file PolynomialApproximation.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and options.
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 mlir::RewritePatternSet::getContext().
void mlir::populateMathToLLVMConversionPatterns | ( | LLVMTypeConverter & | converter, |
RewritePatternSet & | patterns, | ||
bool | approximateLog1p = true |
||
) |
Definition at line 301 of file MathToLLVM.cpp.
References mlir::RewritePatternSet::add().
void mlir::populateMathToSPIRVPatterns | ( | SPIRVTypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Appends to a pattern list additional patterns for translating Math ops to SPIR-V ops.
Definition at line 406 of file MathToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateMemRefToSPIRVPatterns | ( | SPIRVTypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Appends to a pattern list additional patterns for translating MemRef ops to SPIR-V ops.
Definition at line 926 of file MemRefToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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().
void mlir::populateNVGPUToNVVMConversionPatterns | ( | LLVMTypeConverter & | converter, |
RewritePatternSet & | patterns | ||
) |
Definition at line 1675 of file NVGPUToNVVM.cpp.
References mlir::RewritePatternSet::add().
void mlir::populateNVVMToLLVMConversionPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 112 of file NVVMToLLVM.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateOpenMPToLLVMConversionPatterns | ( | LLVMTypeConverter & | converter, |
RewritePatternSet & | patterns | ||
) |
Populate the given list with patterns that convert from OpenMP to LLVM.
Definition at line 267 of file OpenMPToLLVM.cpp.
References mlir::RewritePatternSet::add(), and mlir::TypeConverter::addConversion().
void mlir::populateParallelLoopToGPUPatterns | ( | RewritePatternSet & | patterns | ) |
Adds the conversion pattern from scf.parallel
to gpu.launch
to the provided pattern list.
Definition at line 676 of file SCFToGPU.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populatePolynomialApproximateErfPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 1490 of file PolynomialApproximation.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populatePolynomialApproximateTanhPattern | ( | RewritePatternSet & | patterns | ) |
Definition at line 1485 of file PolynomialApproximation.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 1226 of file VectorToGPU.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and mlir::vector::populateVectorContractCanonicalizeMatmulToMMT().
void mlir::populatePreSparsificationRewriting | ( | RewritePatternSet & | patterns | ) |
Definition at line 1426 of file SparseTensorRewriting.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateReconcileUnrealizedCastsPatterns | ( | RewritePatternSet & | patterns | ) |
Populates patterns
with rewrite patterns that eliminate noop unrealized_conversion_cast
operation sequences.
Definition at line 127 of file ReconcileUnrealizedCasts.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateRemoveShapeConstraintsPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 64 of file RemoveShapeConstraints.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateReturnOpTypeConversionPattern | ( | RewritePatternSet & | patterns, |
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 140 of file FuncConversions.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
Referenced by mlir::arith::populateArithNarrowTypeEmulationPatterns(), and mlir::arith::populateArithWideIntEmulationPatterns().
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 720 of file SCFToControlFlow.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSCFToEmitCConversionPatterns | ( | RewritePatternSet & | patterns | ) |
Collect a set of patterns to convert SCF operations to the EmitC dialect.
Definition at line 185 of file SCFToEmitC.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSCFToSPIRVPatterns | ( | 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::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and mlir::ScfToSPIRVContext::getImpl().
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 mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateShapeToStandardConversionPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 708 of file ShapeToStandard.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseAssembler | ( | RewritePatternSet & | patterns | ) |
Definition at line 226 of file SparseAssembler.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseBufferRewriting | ( | RewritePatternSet & | patterns, |
bool | enableBufferInitialization | ||
) |
Definition at line 1426 of file SparseBufferRewriting.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseGPUCodegenPatterns | ( | RewritePatternSet & | patterns, |
unsigned | numThreads | ||
) |
Definition at line 1325 of file SparseGPUCodegen.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseGPULibgenPatterns | ( | RewritePatternSet & | patterns, |
bool | enableRT | ||
) |
Definition at line 1330 of file SparseGPUCodegen.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseReinterpretMap | ( | RewritePatternSet & | patterns, |
ReinterpretMapScope | scope | ||
) |
Definition at line 791 of file SparseReinterpretMap.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), kAll, kExceptGeneric, and kGenericOnly.
void mlir::populateSparseTensorCodegenPatterns | ( | 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 1585 of file SparseTensorCodegen.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseTensorConversionPatterns | ( | 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 873 of file SparseTensorConversion.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSparseVectorizationPatterns | ( | RewritePatternSet & | patterns, |
unsigned | vectorLength, | ||
bool | enableVLAVectorization, | ||
bool | enableSIMDIndex32 | ||
) |
Populates the given patterns list with vectorization rules.
Definition at line 673 of file SparseVectorization.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 1394 of file Sparsification.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and options.
void mlir::populateSPIRVToLLVMConversionPatterns | ( | 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 1568 of file SPIRVToLLVM.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSPIRVToLLVMFunctionConversionPatterns | ( | LLVMTypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Populates the given list with patterns for function conversion from SPIR-V to LLVM.
Definition at line 1686 of file SPIRVToLLVM.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSPIRVToLLVMModuleConversionPatterns | ( | LLVMTypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Populates the given patterns for module conversion from SPIR-V to LLVM.
Definition at line 1691 of file SPIRVToLLVM.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateSPIRVToLLVMTypeConversion | ( | LLVMTypeConverter & | typeConverter, |
spirv::ClientAPI | clientAPIForAddressSpaceMapping = spirv::ClientAPI::Unknown |
||
) |
Populates type conversions with additional SPIR-V types.
Definition at line 1552 of file SPIRVToLLVM.cpp.
References mlir::TypeConverter::addConversion(), convertArrayType(), convertPointerType(), convertRuntimeArrayType(), and convertStructType().
void mlir::populateStageSparseOperationsPatterns | ( | RewritePatternSet & | patterns | ) |
Sets up StageSparseOperation rewriting rules.
Definition at line 71 of file StageSparseOperations.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateStorageSpecifierToLLVMPatterns | ( | TypeConverter & | converter, |
RewritePatternSet & | patterns | ||
) |
Definition at line 353 of file SparseStorageSpecifierToLLVM.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateTensorToLinalgPatterns | ( | RewritePatternSet & | patterns | ) |
Appends to a pattern list additional patterns for translating tensor ops to Linalg ops.
Definition at line 28 of file TensorToLinalg.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateTensorToSPIRVPatterns | ( | 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 105 of file TensorToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateUpliftToFMAPatterns | ( | RewritePatternSet & | patterns | ) |
Definition at line 77 of file UpliftToFMA.cpp.
References mlir::RewritePatternSet::getContext(), and mlir::RewritePatternSet::insert().
void mlir::populateVectorReductionToSPIRVDotProductPatterns | ( | RewritePatternSet & | patterns | ) |
Appends patterns to convert vector reduction of the form:
to SPIR-V integer dot product ops.
Definition at line 833 of file VectorToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
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 663 of file VectorToArmSME.cpp.
References mlir::RewritePatternSet::add().
void mlir::populateVectorToLLVMConversionPatterns | ( | 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 1780 of file ConvertVectorToLLVM.cpp.
References mlir::RewritePatternSet::add(), mlir::LLVMTypeConverter::getDialect(), mlir::vector::populateVectorInsertExtractStridedSliceTransforms(), and mlir::vector::populateVectorTransferLoweringPatterns().
void mlir::populateVectorToLLVMMatrixConversionPatterns | ( | 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 1807 of file ConvertVectorToLLVM.cpp.
References mlir::RewritePatternSet::add().
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 1493 of file VectorToSCF.cpp.
References mlir::RewritePatternSet::add(), mlir::RewritePatternSet::getContext(), and options.
void mlir::populateVectorToSPIRVPatterns | ( | SPIRVTypeConverter & | typeConverter, |
RewritePatternSet & | patterns | ||
) |
Appends to a pattern list additional patterns for translating Vector Ops to SPIR-V ops.
Definition at line 812 of file VectorToSPIRV.cpp.
References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().
void mlir::populateX86VectorLegalizeForLLVMExportPatterns | ( | 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 mlir::RewritePatternSet::add().
void mlir::printDimensionList | ( | OpAsmPrinter & | printer, |
Operation * | op, | ||
ArrayRef< int64_t > | dimensions | ||
) |
Definition at line 3972 of file AsmPrinter.cpp.
void mlir::printDynamicIndexList | ( | OpAsmPrinter & | printer, |
Operation * | op, | ||
OperandRange | values, | ||
ArrayRef< int64_t > | integers, | ||
TypeRange | valueTypes = TypeRange() , |
||
ArrayRef< bool > | scalables = {} , |
||
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.
void mlir::printSemiFunctionType | ( | OpAsmPrinter & | printer, |
Operation * | op, | ||
Type | argumentType, | ||
Type | resultType | ||
) |
Definition at line 71 of file Syntax.cpp.
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 55 of file Syntax.cpp.
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 868 of file AffineMap.cpp.
Referenced by compressDims(), and getProjectedMap().
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 875 of file AffineMap.cpp.
Referenced by compressSymbols().
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.
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 2594 of file BytecodeReader.cpp.
References readBytecodeFileImpl().
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 2589 of file BytecodeReader.cpp.
References readBytecodeFileImpl().
|
static |
Helper for resource handle reading that returns LogicalResult.
Definition at line 495 of file BytecodeImplementation.h.
References failed(), failure(), mlir::DialectBytecodeReader::readResourceHandle(), and success().
|
inline |
Add all the MLIR dialects to the provided registry.
Definition at line 99 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::builtin::registerCastOpInterfaceExternalModels(), mlir::tensor::registerFindPayloadReplacementOpInterfaceExternalModels(), mlir::tensor::registerInferTypeOpInterfaceExternalModels(), mlir::memref::registerMemorySlotExternalModels(), mlir::NVVM::registerNVVMTargetInterfaceExternalModels(), mlir::ROCDL::registerROCDLTargetInterfaceExternalModels(), 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(), and mlir::tensor::registerValueBoundsOpInterfaceExternalModels().
Referenced by mlirRegisterAllDialects(), and registerAllDialects().
|
inline |
Append all the MLIR dialects to the registry contained in the given context.
Definition at line 183 of file InitAllDialects.h.
References mlir::MLIRContext::appendDialectRegistry(), and registerAllDialects().
|
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 56 of file InitAllExtensions.h.
References mlir::func::registerAllExtensions(), mlir::arith::registerConvertArithToLLVMInterface(), registerConvertComplexToLLVMInterface(), mlir::cf::registerConvertControlFlowToLLVMInterface(), registerConvertFuncToLLVMInterface(), mlir::index::registerConvertIndexToLLVMInterface(), registerConvertMathToLLVMInterface(), registerConvertMemRefToLLVMInterface(), registerConvertNVVMToLLVMInterface(), mlir::ub::registerConvertUBToLLVMInterface(), mlir::transform::registerDebugExtension(), mlir::transform::registerLoopExtension(), mlir::transform::registerPDLExtension(), mlir::affine::registerTransformDialectExtension(), mlir::amdgpu::registerTransformDialectExtension(), mlir::bufferization::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().
|
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().
|
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().
|
inline |
Definition at line 61 of file InitAllPasses.h.
References mlir::bufferization::registerBufferizationPipelines(), mlir::gpu::registerGPUToNVVMPipeline(), mlir::sparse_tensor::registerSparseTensorPipelines(), and mlir::tosa::registerTosaToLinalgPipelines().
Referenced by mlirRegisterAllPasses().
|
inlinestatic |
Registers all dialects that can be translated to LLVM IR and the corresponding translation interfaces.
Definition at line 39 of file All.h.
References registerAMXDialectTranslation(), registerArmNeonDialectTranslation(), registerArmSMEDialectTranslation(), registerArmSVEDialectTranslation(), registerBuiltinDialectTranslation(), registerGPUDialectTranslation(), registerLLVMDialectTranslation(), registerNVVMDialectTranslation(), mlir::gpu::registerOffloadingLLVMTranslationInterfaceExternalModels(), registerOpenACCDialectTranslation(), registerOpenMPDialectTranslation(), registerROCDLDialectTranslation(), registerSPIRVDialectTranslation(), registerVCIXDialectTranslation(), and registerX86VectorDialectTranslation().
Referenced by mlirRegisterAllLLVMTranslations().
|
inline |
Definition at line 28 of file InitAllTranslations.h.
References registerFromLLVMIRTranslation(), registerFromSPIRVTranslation(), registerToCppTranslation(), registerToLLVMIRTranslation(), and registerToSPIRVTranslation().
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().
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().
std::pair< std::string, std::string > mlir::registerAndParseCLIOptions | ( | int | argc, |
char ** | argv, | ||
llvm::StringRef | toolName, | ||
DialectRegistry & | registry | ||
) |
Register and parse command line options.
--help
.Definition at line 488 of file MlirOptMain.cpp.
References mlir::DialectRegistry::getDialectNames(), registerAsmPrinterCLOptions(), mlir::tracing::DebugCounter::registerCLOptions(), mlir::MlirOptMainConfig::registerCLOptions(), registerDefaultTimingManagerCLOptions(), registerMLIRContextCLOptions(), and registerPassManagerCLOptions().
Referenced by MlirOptMain().
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().
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().
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().
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().
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().
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().
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 199 of file AsmPrinter.cpp.
References clOptions.
Referenced by registerAndParseCLIOptions().
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 registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerBuiltinDialectTranslation().
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().
void mlir::registerConversionPDLFunctions | ( | RewritePatternSet & | patterns | ) |
Register the dialect conversion PDL functions with the given pattern set.
Definition at line 3552 of file DialectConversion.cpp.
References mlir::TypeConverter::convertTypes(), mlir::detail::ConversionPatternRewriterImpl::currentTypeConverter, failed(), failure(), mlir::RewritePatternSet::getPDLPatterns(), and pdllConvertValues().
void mlir::registerConvertComplexToLLVMInterface | ( | DialectRegistry & | registry | ) |
Definition at line 386 of file ComplexToLLVM.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by registerAllExtensions().
void mlir::registerConvertFuncToLLVMInterface | ( | DialectRegistry & | registry | ) |
Definition at line 857 of file FuncToLLVM.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by registerAllExtensions().
void mlir::registerConvertMathToLLVMInterface | ( | DialectRegistry & | registry | ) |
Definition at line 358 of file MathToLLVM.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by registerAllExtensions().
void mlir::registerConvertMemRefToLLVMInterface | ( | DialectRegistry & | registry | ) |
Definition at line 1739 of file MemRefToLLVM.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by registerAllExtensions().
void mlir::registerConvertNVVMToLLVMInterface | ( | DialectRegistry & | registry | ) |
Definition at line 116 of file NVVMToLLVM.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by registerAllExtensions().
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 127 of file ConvertToLLVMPass.cpp.
References mlir::DialectRegistry::addExtensions().
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 557 of file Timing.cpp.
References options.
Referenced by registerAndParseCLIOptions().
void mlir::registerFromLLVMIRTranslation | ( | ) |
Definition at line 27 of file ConvertFromLLVMIR.cpp.
References emitError(), get(), registerAllFromLLVMIRTranslations(), and translateLLVMIRToModule().
Referenced by registerAllTranslations().
void mlir::registerFromSPIRVTranslation | ( | ) |
Definition at line 58 of file TranslateRegistration.cpp.
References deserializeModule().
Referenced by registerAllTranslations().
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().
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().
void mlir::registerGpuSerializeToHsacoPass | ( | ) |
Register pass to serialize GPU kernel functions to a HSAco binary annotation.
Definition at line 458 of file SerializeToHsaco.cpp.
void mlir::registerLLVMDialectImport | ( | DialectRegistry & | registry | ) |
Registers the LLVM dialect and its import from LLVM IR in the given registry.
Definition at line 282 of file LLVMIRToLLVMTranslation.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().
Referenced by registerAllFromLLVMIRTranslations(), and registerLLVMDialectImport().
void mlir::registerLLVMDialectImport | ( | MLIRContext & | context | ) |
Registers the LLVM dialect and its import from LLVM IR with the given context.
Definition at line 289 of file LLVMIRToLLVMTranslation.cpp.
References mlir::MLIRContext::appendDialectRegistry(), and registerLLVMDialectImport().
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 420 of file LLVMToLLVMIRTranslation.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().
Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerLLVMDialectTranslation().
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 427 of file LLVMToLLVMIRTranslation.cpp.
References mlir::MLIRContext::appendDialectRegistry(), and registerLLVMDialectTranslation().
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().
void mlir::registerNVVMDialectImport | ( | DialectRegistry & | registry | ) |
Registers the NVVM dialect and its import from LLVM IR in the given registry.
Definition at line 82 of file LLVMIRToNVVMTranslation.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().
Referenced by registerAllFromLLVMIRTranslations(), and registerNVVMDialectImport().
void mlir::registerNVVMDialectImport | ( | MLIRContext & | context | ) |
Registers the NVVM dialect and its import from LLVM IR with the given context.
Definition at line 89 of file LLVMIRToNVVMTranslation.cpp.
References mlir::MLIRContext::appendDialectRegistry(), and registerNVVMDialectImport().
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 263 of file NVVMToLLVMIRTranslation.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().
Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerNVVMDialectTranslation().
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 270 of file NVVMToLLVMIRTranslation.cpp.
References mlir::MLIRContext::appendDialectRegistry(), and registerNVVMDialectTranslation().
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().
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().
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 3203 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().
Referenced by registerAllToLLVMIRTranslations(), and registerOpenMPDialectTranslation().
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 3210 of file OpenMPToLLVMIRTranslation.cpp.
References mlir::MLIRContext::appendDialectRegistry(), and registerOpenMPDialectTranslation().
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 123 of file PassRegistry.cpp.
References passRegistry, and passRegistryTypeIDs.
Referenced by mlir::PassRegistration< ConcretePass >::PassRegistration().
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 128 of file PassManagerOptions.cpp.
References options.
Referenced by registerAndParseCLIOptions().
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().
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 194 of file ROCDLToLLVMIRTranslation.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::DialectRegistry::insert().
Referenced by registerAllGPUToLLVMIRTranslations(), registerAllToLLVMIRTranslations(), and registerROCDLDialectTranslation().
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 201 of file ROCDLToLLVMIRTranslation.cpp.
References mlir::MLIRContext::appendDialectRegistry(), and registerROCDLDialectTranslation().
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().
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().
void mlir::registerTestRoundtripDebugSPIRV | ( | ) |
Definition at line 137 of file TranslateRegistration.cpp.
References roundTripModule().
void mlir::registerTestRoundtripSPIRV | ( | ) |
Definition at line 126 of file TranslateRegistration.cpp.
References roundTripModule().
void mlir::registerToCppTranslation | ( | ) |
Definition at line 26 of file TranslateRegistration.cpp.
Referenced by registerAllTranslations().
void mlir::registerToLLVMIRTranslation | ( | ) |
Definition at line 25 of file ConvertToLLVMIR.cpp.
Referenced by registerAllTranslations().
void mlir::registerToSPIRVTranslation | ( | ) |
Definition at line 86 of file TranslateRegistration.cpp.
References serializeModule().
Referenced by registerAllTranslations().
void mlir::registerTranslationCLOptions | ( | ) |
Register command-line options used by the translation registry.
Definition at line 38 of file Translation.cpp.
References clOptions.
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().
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().
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().
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().
LogicalResult mlir::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).
Definition at line 26 of file InferTypeOpInterface.cpp.
Referenced by mlir::bufferization::allocateTensorForShapedValue(), mlir::tensor::getOrCreateDestination(), reifyOrComputeDynamicSizes(), mlir::linalg::rewriteAsPaddedOp(), and mlir::linalg::rewriteInDestinationPassingStyle().
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 746 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().
Replace all uses of orig
within the given region with replacement
.
Definition at line 28 of file RegionUtils.cpp.
References mlir::Value::getUses(), and mlir::Region::isAncestor().
Referenced by mlir::affine::coalesceLoops(), coalesceLoops(), collapseParallelLoops(), convertOmpParallel(), OmpParallelOpConversionManager::OmpParallelOpConversionManager(), stripmineSink(), and OmpParallelOpConversionManager::~OmpParallelOpConversionManager().
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
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 loopnewYielValueFn
is the callback that generates the new values to be yielded from within the innermost loop.replaceIterOperandsUsesInLoop
is true, all uses of the newIterOperands
within the generated new loop are replaced with the corresponding BlockArgument
in the loop body. 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 rules 1) 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.
2) if a dimension in the collaped type is dynamic, one and only one of the corresponding dimensions in the expanded type should be dynamic. This rule is only needed with reshape operations that are expanding.
Definition at line 227 of file ReshapeOpsUtils.cpp.
References emitError(), mlir::detail::enumerate(), and success().
Referenced by fuseWithReshapeByExpansion().
LogicalResult mlir::runRegionDCE | ( | RewriterBase & | rewriter, |
MutableArrayRef< Region > | regions | ||
) |
This function returns success if any operations or arguments were deleted, failure otherwise.
Definition at line 466 of file RegionUtils.cpp.
References deleteDeadness(), and propagateLiveness().
Referenced by simplifyRegions().
void mlir::setupDebuggerExecutionContextHook | ( | tracing::ExecutionContext & | executionContext | ) |
Definition at line 361 of file DebuggerExecutionContextHook.cpp.
References debuggerCallBackFunction(), and mlir::tracing::ExecutionContext::setCallback().
Referenced by mlir::tracing::InstallDebugHandler::Impl::Impl().
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 1520 of file AffineExpr.cpp.
References failed(), getAffineExprFromFlatForm(), mlir::AffineExpr::getContext(), getSemiAffineExprFromFlatForm(), mlir::AffineExpr::isPureAffine(), mlir::SimpleAffineExprFlattener::localExprs, mlir::SimpleAffineExprFlattener::operandExprStack, simplifySemiAffine(), and mlir::AffineExprVisitor< SubClass, RetTy >::walkPostOrder().
Referenced by canonicalizeStridedLayout(), createPrivateMemRef(), getConstDifference(), mlir::FlatLinearConstraints::getSliceBounds(), getStridesAndOffset(), isModOfModSubtraction(), makeCanonicalStridedLayoutExpr(), mlir::MutableAffineMap::simplify(), and simplifyAffineMap().
Simplifies an affine map by simplifying its underlying AffineExpr results.
Definition at line 736 of file AffineMap.cpp.
References mlir::AffineMap::get(), mlir::AffineMap::getContext(), mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResults(), and simplifyAffineExpr().
Referenced by mlir::affine::FlatAffineValueConstraints::addBound(), composeAffineMapAndOperands(), mlir::affine::AffineValueMap::difference(), generatePointWiseCopy(), mlir::affine::MemRefAccess::getAccessMap(), and getCleanupLoopLowerBound().
LogicalResult mlir::simplifyRegions | ( | RewriterBase & | rewriter, |
MutableArrayRef< Region > | regions | ||
) |
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.
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 830 of file RegionUtils.cpp.
References eraseUnreachableBlocks(), mergeIdenticalBlocks(), runRegionDCE(), succeeded(), and success().
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 extractBeneficiaryOps(), and getUsedValuesDefinedAbove().
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 97 of file TopologicalSortUtils.cpp.
References mlir::Block::back(), mlir::Block::empty(), mlir::Operation::hasTrait(), sortTopologically(), and mlir::Block::without_terminator().
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:
Will become:
The sort also works on operations with regions and implicit captures. For example:
Will become:
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:
Are sorted as:
Definition at line 51 of file TopologicalSortUtils.cpp.
Referenced by sortTopologically().
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 22 of file ToolUtilities.cpp.
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 636 of file TypeConverter.cpp.
References mlir::LLVMTypeConverter::convertType(), failure(), and success().
|
inline |
Utility function that returns true if the provided LogicalResult corresponds to a success value.
Definition at line 68 of file LogicalResult.h.
References mlir::LogicalResult::succeeded().
Referenced by addShardOp(), mlir::affine::affineDataCopyGenerate(), mlir::LocalAliasAnalysis::aliasImpl(), mlir::bufferization::allocateTensorForShapedValue(), mlir::ValueBoundsConstraintSet::areOverlappingSlices(), areValidCastInputsAndOutputs(), mlir::PassReproducerOptions::attachResourceParser(), buildNumReadElements(), mlir::presburger::SetCoalescer::coalesce(), collapseValue(), collectSymbolScopes(), composeAffineMapAndOperands(), computeDestructuringInfo(), mlir::TypeConverter::convertType(), createPrivateMemRef(), deleteDeadness(), mlir::detail::DiagnosticEngineImpl::emit(), extractStrides(), mlir::detail::PassCrashReproducerGenerator::finalize(), mlir::detail::OpPassManagerImpl::finalizePassList(), mlir::Operation::fold(), foldLoopBounds(), mlir::presburger::IntegerRelation::fourierMotzkinEliminate(), mlir::DynamicType::get(), mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::get(), mlir::affine::ComputationSliceState::getAsConstraints(), getIndexedPtrs(), mlir::DiagnosedSilenceableFailure::getStatusString(), getStridesAndOffset(), getStridesAndOffset(), mlir::DenseElementsAttr::getValues(), haveCompatibleOffsets(), mlir::linalg::hoistPaddingOnTensors(), mlir::vector::isDisjointTransferIndices(), isFusionLegal(), isLastMemrefDimUnitStride(), isStrided(), mlir::LLVM::SplitGEP::matchAndRewrite(), mlir::LLVM::SplitStores::matchAndRewrite(), mlir::linalg::GeneralizePadOpPattern::matchAndRewrite(), mlir::LLVM::ModuleImport::matchFloatAttr(), mlir::LLVM::ModuleImport::matchIntegerAttr(), mergeIdenticalBlocks(), mlirParsePassPipeline(), mlir::linalg::packMatmulGreedily(), mlir::DataLayoutSpecAttr::parse(), mlir::FieldParser< std::optional< AttributeT >, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, std::optional< AttributeT > > >::parse(), mlir::FieldParser< std::optional< IntT >, std::enable_if_t< std::is_integral< IntT >::value, std::optional< IntT > > >::parse(), mlir::detail::DenseArrayAttrImpl< T >::parse(), parseAnyType(), parseAsyncDependencies(), mlir::DynamicDialect::parseAttribute(), parseAttributesOp(), parseCombinedConstructsLoop(), parseCommonStructuredOpParts(), parseCreateOperationOpAttributes(), parseCreateOperationOpResults(), parseDeviceTypeArrayAttr(), parseDeviceTypeOperandsWithKeywordOnly(), parseDeviceTypeOperandsWithSegment(), parseDimensionList(), parseDynamicIndexList(), parseExpressionArg(), parseFunctionArgumentList(), parseFunctionResultList(), mlir::function_interface_impl::parseFunctionSignature(), parseFunctionTypes(), parseGangClause(), parseGangValue(), parseGlobalMemrefOpTypeAndInitialValue(), parseInterfaceVarABIAttr(), parseKeywordList(), parseLaunchDimType(), parseLoopControl(), parseNumGangs(), parseOffloadingHandler(), parseOperationOpAttributes(), mlir::detail::Parser::parseOptionalAttribute(), mlir::AsmParser::parseOptionalAttribute(), parseOptionalKeywordAlternative(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalKeywordOrString(), mlir::AsmParser::parseOptionalSymbolName(), parseParallelRegion(), parseRoutineGangClause(), parseScheduleClause(), parseSequenceOpOperands(), parseStorageType(), parseStructMemberDecorations(), parseStructType(), parseSwitchCases(), parseSwitchOpCases(), parseSynchronizationHint(), parseTargetEnvAttr(), parseTokenOrdering(), mlir::DynamicDialect::parseType(), parseTypedInitialValue(), mlir::tosa::parseTypeOrAttr(), parseUniformType(), parseWaitClause(), parseWsLoop(), mlir::DynamicDialect::printAttribute(), mlir::AsmPrinter::Impl::printLocationInternal(), mlir::AsmPrinter::printStrippedAttrOrType(), mlir::DynamicDialect::printType(), reifyOrComputeDynamicSizes(), mlir::detail::replaceImmediateSubElementsImpl(), mlir::lsp::JSONTransport::run(), simplifyRegions(), mlir::vector::splitFullAndPartialTransfer(), mlir::DiagnosedSilenceableFailure::succeeded(), tileAndFuseFirstExtractUseThroughContainingOpBlockArgument(), trailingNDimsContiguous(), tryIsolateBands(), vectorizeAsTensorPackOp(), vectorizeAsTensorPadOp(), vectorizeLinalgOpPrecondition(), vectorizeLoops(), mlir::irdl::AnyOfConstraint::verify(), mlir::irdl::ConstraintVerifier::verify(), walkIndicesAsAttr(), wrap(), and mlir::scf::yieldReplacementForFusedProducer().
|
inline |
Utility function to generate a LogicalResult.
If isSuccess is true a success
result is generated, otherwise a 'failure' result is generated.
Definition at line 56 of file LogicalResult.h.
References mlir::LogicalResult::success().
Referenced by mlir::affine::FlatAffineValueConstraints::addAffineForOpDomain(), mlir::affine::FlatAffineValueConstraints::addAffineParallelOpDomain(), mlir::FlatLinearConstraints::addBound(), mlir::affine::FlatAffineValueConstraints::addDomainFromSliceMaps(), addInitOperandsToLoopNest(), addMissingLoopIVBounds(), addShardOp(), mlir::affine::FlatAffineValueConstraints::addSliceBounds(), mlir::PassPipelineCLParser::addToPipeline(), mlir::AsmParser::addTypesToList(), mlir::AsmParser::addTypeToList(), mlir::affine::affineDataCopyGenerate(), mlir::affine::affineForOpBodySkew(), mlir::affine::affineParallelize(), analyzeProfitability(), appendMangledType(), mlir::NVVM::SerializeGPUModuleBase::appendStandardLibs(), mlir::ROCDL::SerializeGPUModuleBase::appendStandardLibs(), mlir::PassReproducerOptions::apply(), applyOpPatternsAndFold(), applyPassManagerCLOptions(), applyTilingToAll(), mlir::lsp::TextDocumentContentChangeEvent::applyTo(), mlir::transform::detail::assembleTransformLibraryFromPaths(), barePtrFuncArgTypeConverter(), mlir::affine::AffineValueMap::canonicalize(), canonicalizeLoopBounds(), canonicalizeMapExprAndTermOrder(), mlir::vector::castAwayContractionLeadingOneDim(), checkAffineLoopNestMappable(), checkAffineLoopNestMappableImpl(), checkAndCollapseInnerZeroIndices(), mlir::transform::detail::checkApplyToOne(), checkCapabilityRequirements(), ValueEquivalenceCache::checkCommutativeEquivalent(), checkCompatibleReturnType< float >(), checkCompatibleReturnType< int32_t >(), checkCompatibleReturnType< int64_t >(), checkDeviceTypes(), checkDoubleConsume(), ValueEquivalenceCache::checkEquivalent(), checkExtensionRequirements(), checkIfHyperRectangular(), mlir::transform::detail::checkNestedConsumption(), checkOperandAffineExprRecursively(), checkSourceOpTypes(), checkTensorElementType(), mlir::affine::coalesceLoops(), coalesceLoops(), collapseBranch(), collectValidReferencesFor(), combineOneSpec(), compileAndExecute(), compileAndExecuteSingleReturnFunction(), mlir::FlatLinearConstraints::composeMatchingMap(), mlir::ValueBoundsConstraintSet::computeBound(), mlir::FlatLinearConstraints::computeLocalVars(), computePaddedShape(), mlir::detail::ExpectedDiag::computeRegex(), mlir::AffineMap::constantFold(), mlir::presburger::IntegerRelation::constantFoldVar(), convertAffineLoopNestToGPULaunch(), mlir::LLVM::ModuleImport::convertComdats(), mlir::LLVM::ModuleImport::convertDataLayout(), convertDenseArrayFromAttr(), convertFromAttribute(), convertFuncOpTypes(), mlir::LLVM::ModuleImport::convertFunctions(), mlir::LLVM::ModuleImport::convertGlobals(), mlir::LLVM::ModuleImport::convertIntrinsicArguments(), mlir::LLVM::ModuleImport::convertLinkerOptionsMetadata(), mlir::LLVM::ModuleImport::convertMetadata(), mlir::detail::ConversionPatternRewriterImpl::convertNonEntryRegionTypes(), convertOmpAtomicCapture(), convertOmpAtomicRead(), convertOmpAtomicUpdate(), convertOmpAtomicWrite(), convertOmpCritical(), convertOmpMaster(), convertOmpOrdered(), convertOmpOrderedRegion(), convertOmpParallel(), convertOmpReductionOp(), convertOmpSections(), convertOmpSimdLoop(), convertOmpSingle(), convertOmpTarget(), convertOmpTaskgroupOp(), convertOmpTaskOp(), convertOmpThreadprivate(), convertOmpWsLoop(), convertOperationImpl(), mlir::OperationConverter::convertOperations(), mlir::LLVMTranslationDialectInterface::convertParameterAttr(), mlir::LLVMTranslationInterface::convertParameterAttr(), mlir::TypeConverter::convertSignatureArg(), mlir::TypeConverter::convertSignatureArgs(), convertSparseTensorType(), mlir::TypeConverter::convertType(), mlir::TypeConverter::convertTypes(), mlir::linalg::copyToGPUPrivateMemory(), mlir::linalg::copyToWorkgroupMemory(), mlir::ConvertToLLVMPattern::copyUnrankedDescriptors(), mlir::bufferization::BufferizationOptions::createMemCpy(), mlir::ControlFlowToSCFTransformation::createStructuredBranchRegionTerminatorOp(), mlir::linalg::deallocateGPUPrivateMemory(), mlir::linalg::deallocateWorkgroupMemory(), defaultDeallocBufferCallBack(), deleteDeadness(), mlir::spirv::Deserializer::deserialize(), 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::Inliner::doInlining(), mlir::bufferization::dropEquivalentBufferResults(), mlir::linalg::dropUnitDims(), emitElementwiseComputation(), encodeError(), encodeKernelName(), mlir::tosa::EqualizeRanks(), mlir::OperationEquivalence::exactValueMatch(), mlir::transform::detail::expandPathsToMLIRFiles(), extractStrides(), failableParallelForEach(), mlir::detail::OpPassManagerImpl::finalizePassList(), findIndicesForOffset(), findOptimal(), mlir::FlatLinearConstraints::flattenAlignedMapAndMergeLocals(), mlir::Operation::fold(), foldDynamicIndexList(), foldExtractOpFromExtractChain(), foldInsertAfterInsertSlice(), foldLoopBounds(), mlir::bufferization::foldToMemrefToTensorPair(), forwardPassthroughAttributes(), mlir::presburger::IntegerRelation::gaussianEliminateVar(), generalizeNamedOpPrecondition(), generateCleanupLoopForUnroll(), generateCopy(), mlir::affine::generateCopyForMemRegion(), generateLoopNestUsingForallOp(), generateLoopNestUsingForOp(), mlir::OpState::genericParseProperties(), mlir::affine::MemRefAccess::getAccessRelation(), mlir::affine::ComputationSliceState::getAsConstraints(), mlir::ROCDL::SerializeGPUModuleBase::getCommonBitcodeLibs(), mlir::AsmParser::getCurrentLocation(), getDefaultABIAttrs(), getDivRepr(), getFlattenedAffineExprs(), getFlattenedAffineExprs(), mlir::transform::TransformState::getHandlesForPayloadValue(), getInterfaceVariables(), getKernelGlobalVariables(), getMemRefAlignment(), mlir::bufferization::DeallocationState::getMemrefsAndConditionsToDeallocate(), getMultiAffineFunctionFromMap(), mlir::affine::getRelationFromMap(), mlir::ConversionPatternRewriter::getRemappedValues(), mlir::shape::getShapeVec(), mlir::affine::ComputationSliceState::getSourceAsConstraints(), getStridesAndOffset(), getStridesAndOffset(), getTileSizePos(), mlir::LLVM::ModuleToObject::handleBitcodeFile(), mlir::ROCDL::SerializeGPUModuleBase::handleBitcodeFile(), mlir::affine::hoistAffineIfOp(), mlir::OperationEquivalence::ignoreValueEquivalence(), incSlicePosition(), mlir::detail::inferReturnTensorTypes(), inferSparseBufferType(), mlir::Pass::initialize(), mlir::ExternalPass::initialize(), mlir::ReductionNode::initialize(), mlir::DataFlowSolver::initializeAndRun(), VectorizationState::initState(), mlir::sparse_tensor::CodegenEnv::initTensorExp(), inlineConvertOmpRegions(), mlir::Inliner::Impl::inlineSCC(), interchangeGenericOpPrecondition(), interleaveWithError(), mlir::transform::detail::interpreterBaseInitializeImpl(), mlir::ExecutionEngine::invokePacked(), irdlAttrOrTypeVerifier(), isAllowedSizeM(), isAllowedSizeN(), isAllowedWGMMADataType(), isLinalgOpExpandable(), isMatchingWidth(), isMemRefTypeSupported(), isValidMaskedInputVector(), mlir::LLVM::ModuleToObject::linkFiles(), mlir::LLVMTypeConverter::LLVMTypeConverter(), mlir::LLVM::ModuleToObject::loadBitcodeFilesFromList(), lookupSymbolInImpl(), mlir::affine::loopUnrollByFactor(), loopUnrollByFactor(), mlir::affine::loopUnrollFull(), mlir::affine::loopUnrollJamByFactor(), lowerEntryPointABIAttr(), lvlIsInBounds(), CanonicalizeContractAdd< AddOpType >::matchAndRewrite(), mlir::ComposeCollapseOfExpandOp< CollapseOpTy, ExpandOpTy, CastOpTy >::matchAndRewrite(), mlir::ComposeExpandOfCollapseOp< ExpandOpTy, CollapseOpTy >::matchAndRewrite(), ConvertTypesInSCFForOp::matchAndRewrite(), mlir::LLVM::CanonicalizeAlignedGep::matchAndRewrite(), mlir::LLVM::SplitGEP::matchAndRewrite(), mlir::GPUFuncOpLowering::matchAndRewrite(), mlir::GPUPrintfOpToHIPLowering::matchAndRewrite(), mlir::GPUPrintfOpToLLVMCallLowering::matchAndRewrite(), mlir::GPUPrintfOpToVPrintfLowering::matchAndRewrite(), InsertSliceOfInsertSliceFolder< OpTy >::matchAndRewrite(), mlir::ComposeReassociativeReshapeOps< ReshapeOpTy >::matchAndRewrite(), ConvertAccessChain::matchAndRewrite(), ConvertAddressOf::matchAndRewrite(), ConvertVariable::matchAndRewrite(), ConvertLoad::matchAndRewrite(), ConvertStore::matchAndRewrite(), UModSimplification::matchAndRewrite(), mlir::LLVM::SplitStores::matchAndRewrite(), mlir::LLVM::BitcastStores::matchAndRewrite(), DeduplicateAffineMinMaxExpressions< T >::matchAndRewrite(), MergeAffineMinMaxOp< T >::matchAndRewrite(), CanonicalizeAffineMinMaxOpExprAndTermOrder< T >::matchAndRewrite(), CanonicalizeSingleResultAffineMinMaxOp< T >::matchAndRewrite(), SwapExtractSliceOfFill::matchAndRewrite(), mlir::linalg::ExtractSliceOfPadTensorSwapPattern::matchAndRewrite(), mlir::linalg::GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(), mlir::linalg::GeneralizePadOpPattern::matchAndRewrite(), mlir::linalg::GeneralizeOuterUnitDimsUnPackOpPattern::matchAndRewrite(), ConcatSliceOptimization::matchAndRewrite(), ConsolidateTransposeOptimization::matchAndRewrite(), mlir::linalg::LinalgCopyVTRForwardingPattern::matchAndRewrite(), mlir::linalg::LinalgCopyVTWForwardingPattern::matchAndRewrite(), mlir::LLVM::ModuleImport::matchFloatAttr(), mlir::scf::matchForLikeLoop(), mlir::LLVM::ModuleImport::matchIntegerAttr(), mlir::BytecodeReader::Impl::materializeAll(), mlir::affine::mergeOffsetsSizesAndStrides(), mlirExecutionEngineInvokePacked(), MlirOptMain(), mlirQueryMain(), mlirReduceMain(), mlir::presburger::LexSimplexBase::moveRowUnknownToColumn(), mlir::LLVM::detail::LLVMStructTypeStorage::mutate(), mlir::spirv::detail::StructTypeStorage::mutate(), NAryInferReturnTypes(), nextIndex(), mlir::FailureOr< T >::operator LogicalResult(), mlir::gpu::SerializeToBlobPass::optimizeLlvm(), mlir::LLVM::ModuleToObject::optimizeModule(), mlir::nvgpu::optimizeSharedMemoryReadsAndWrites(), mlir::amdgpu::optimizeSharedMemoryReadsAndWrites(), mlir::amdgpu::optimizeSharedMemoryReadsAndWritesOp(), outlineIfOp(), mlir::detail::ParallelDiagnosticHandlerImpl::ParallelDiagnosticHandlerImpl(), parallelForEach(), mlir::FieldParser< ContainerT, std::enable_if_t< llvm::is_detected< detail::has_push_back_t, ContainerT >::value, ContainerT > >::parse(), mlir::DynamicAttr::parse(), mlir::DynamicType::parse(), mlir::affine::AffineDmaStartOp::parse(), mlir::affine::AffineDmaWaitOp::parse(), mlir::detail::Parser::parseAffineMapReference(), parseAlignedClause(), parseAllocateAndAllocator(), parseArithmeticExtendedBinaryOp(), mlir::detail::AsmParserImpl< BaseT >::parseArrowTypeList(), parseAtomicReductionRegion(), mlir::detail::AsmParserImpl< BaseT >::parseAttribute(), mlir::AsmParser::parseAttribute(), mlir::detail::Parser::parseAttribute(), mlir::detail::Parser::parseAttributeDict(), parseAttributesOp(), parseAttributions(), parseAwaitResultType(), mlir::detail::AsmParserImpl< BaseT >::parseBase64Bytes(), parseBindName(), parseBound(), mlir::detail::Parser::parseCallSiteLocation(), parseCallTypeAndResolveOperands(), parseCaptureType(), parseClauseAttr(), parseClauseWithRegionArgs(), parseCmpOp(), mlir::AsmParser::parseColonType(), parseCombinedConstructsLoop(), mlir::detail::Parser::parseCommaSeparatedList(), mlir::detail::pass_options::parseCommaSeparatedList(), mlir::detail::Parser::parseCommaSeparatedListUntil(), parseCommonStructuredOpParts(), parseCopyPrivateVarList(), parseCreateOperationOpAttributes(), parseCreateOperationOpResults(), mlir::detail::AsmParserImpl< BaseT >::parseCustomAttributeWithFallback(), mlir::AsmParser::parseCustomAttributeWithFallback(), mlir::detail::AsmParserImpl< BaseT >::parseCustomTypeWithFallback(), mlir::AsmParser::parseCustomTypeWithFallback(), parseDenseI64ArrayAttr(), parseDependVarList(), parseDeviceTypeArrayAttr(), parseDeviceTypeOperands(), parseDeviceTypeOperandsWithKeywordOnly(), parseDeviceTypeOperandsWithSegment(), parseDialectGrouping(), mlir::detail::Parser::parseDialectSymbolBody(), parseDimensionList(), mlir::detail::Parser::parseDimensionListRanked(), parseDstStyleOp(), parseDynamicIndexList(), parseElementAttrHexValues(), mlir::spirv::parseEnumKeywordAttr(), mlir::spirv::parseEnumStrAttr(), parseExpressionArg(), parseExtTypeParams(), mlir::detail::AsmParserImpl< BaseT >::parseFloat(), mlir::detail::Parser::parseFloatFromIntegerLiteral(), parseForeachMatchSymbols(), mlir::detail::PassOptions::parseFromString(), parseFunctionArgumentList(), mlir::function_interface_impl::parseFunctionOp(), parseFunctionResultList(), mlir::detail::Parser::parseFunctionResultTypes(), mlir::function_interface_impl::parseFunctionSignature(), parseFunctionTypes(), mlir::detail::Parser::parseFusedLocation(), parseGangClause(), parseGangValue(), parseGEPIndices(), parseGlobalMemrefOpTypeAndInitialValue(), mlir::spirv::parseImageOperands(), parseInferType(), parseInsertExtractValueElementType(), mlir::detail::Parser::parseIntegerInDimensionList(), mlir::detail::Parser::parseIntegerSetReference(), mlir::AsmParser::parseKeyword(), mlir::detail::AsmParserImpl< BaseT >::parseKeyword(), parseKeywordList(), mlir::detail::AsmParserImpl< BaseT >::parseKeywordOrCompletion(), mlir::AsmParser::parseKeywordOrString(), parseLaunchDimType(), parseLaunchFuncOperands(), parseLinearClause(), mlir::detail::Parser::parseLocationInstance(), parseMapClause(), parseMapEntries(), mlir::detail::Parser::parseMemRefType(), parseMultitileSizesTypes(), parseNamedStructuredOp(), parseNamedStructuredOpRegion(), parseNamedStructuredOpResults(), mlir::detail::Parser::parseNameOrFileLineColLocation(), parseNumGangs(), parseOffloadingHandler(), parseOneResultSameOperandTypeOp(), parseOperationOpAttributes(), parseOptionalArrayStride(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalArrow(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalArrowTypeList(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalAttrDict(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalAttrDictWithKeyword(), mlir::detail::Parser::parseOptionalAttribute(), parseOptionalCallFuncPtr(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalColon(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalColonTypeList(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalComma(), mlir::ExtensibleDialect::parseOptionalDynamicAttr(), mlir::ExtensibleDialect::parseOptionalDynamicType(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalEllipsis(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalEqual(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalGreater(), mlir::detail::Parser::parseOptionalInteger(), mlir::AsmParser::parseOptionalInteger(), parseOptionalInterchange(), mlir::detail::Parser::parseOptionalKeyword(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalKeyword(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalKeywordOrString(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalLBrace(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalLess(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalLParen(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalLSquare(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalPlus(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalQuestion(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalRBrace(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalRParen(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalRSquare(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalStar(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalString(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalSymbolName(), mlir::AsmParser::parseOptionalSymbolName(), mlir::detail::AsmParserImpl< BaseT >::parseOptionalVerticalBar(), mlir::impl::parseOptionalVisibilityKeyword(), mlir::transform::parsePackedOrDynamicIndexList(), parsePassPipeline(), parseQuantParams(), parseRangeType(), parseReductionVarList(), parseResultsValueType(), parseRoutineGangClause(), parseScheduleClause(), parseSemiFunctionType(), parseSequenceOpOperands(), parseShuffleType(), parseSingleBlockRegion(), parseStorageRange(), mlir::AsmParser::parseString(), parseStructMemberDecorations(), parseSwitchCases(), parseSwitchOpCases(), mlir::AsmParser::parseSymbolName(), parseSymOperandList(), parseSynchronizationHint(), mlir::detail::Parser::parseToken(), parseTokenOrdering(), mlir::OpAsmParser::parseTrailingOperandList(), mlir::transform::parseTransformMatchDims(), mlir::transform::detail::parseTransformModuleFromFile(), mlir::AsmParser::parseType(), parseTypedInitialValue(), mlir::detail::Parser::parseTypeListNoParens(), mlir::detail::Parser::parseTypeListParens(), mlir::tosa::parseTypeOrAttr(), parseValuesWithVariadicity(), parseValueWithVariadicity(), mlir::detail::Parser::parseVectorDimensionList(), parseVerCapExtAttr(), parseWaitClause(), mlir::detail::Parser::parseXInDimensionList(), mlir::PassPipelineRegistration< EmptyPipelineOptions >::PassPipelineRegistration(), mlir::PassPipelineRegistration< Options >::PassPipelineRegistration(), peelForLoop(), poolingInferReturnTypes(), preconditionsFoldExtractOrInsertWithTransferOp(), preconditionsFoldSubViewOpImpl(), printBinaryOperation(), printCallOperation(), printConstantOp(), mlir::ExtensibleDialect::printIfDynamicAttr(), mlir::ExtensibleDialect::printIfDynamicType(), printOperation(), printRegisteredDialects(), printUnaryOperation(), mlir::LLVM::ModuleImport::processFunction(), mlir::bufferization::promoteBufferResultsToOutParams(), mlir::affine::promoteIfSingleIteration(), mlir::detail::AsmParserImpl< BaseT >::pushCyclicParsing(), mlir::detail::AsmStateImpl::pushCyclicPrinting(), mlir::pdll::Lexer::pushInclude(), mlir::DialectBytecodeReader::readAttribute(), readLine(), mlir::DialectBytecodeReader::readList(), mlir::DialectBytecodeReader::readOptionalAttribute(), readResourceHandle(), mlir::DialectBytecodeReader::readSparseArray(), mlir::DialectBytecodeReader::readType(), mlir::DialectBytecodeReader::readVarIntWithFlag(), ReduceInferReturnTypes(), mlir::DiagnosticEngine::registerHandler(), mlir::detail::ConversionPatternRewriterImpl::remapValues(), replaceDimOrSym(), replaceWithConstant(), reshapeLikeShapesAreCompatible(), resolveBroadcastShape(), resolveEntry(), mlir::OpAsmParser::resolveOperands(), resolveSourceIndicesCollapseShape(), resolveSourceIndicesExpandShape(), mlir::linalg::rewriteAsPaddedOp(), PadOpVectorizationWithInsertSlicePattern::rewriteUser(), PadOpVectorizationWithTransferReadPattern::rewriteUser(), PadOpVectorizationWithTransferWritePattern::rewriteUser(), roundTripModule(), mlir::query::NoOpQuery::run(), mlir::query::HelpQuery::run(), mlir::query::QuitQuery::run(), mlir::query::MatchQuery::run(), mlir::lsp::JSONTransport::run(), mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::runAfterInterpreter(), mlir::transform::TransformInterpreterPassBase< Concrete, GeneratedBase >::runBeforeInterpreter(), mlir::lsp::runMlirLSPServer(), mlir::lsp::runPdllLSPServer(), mlir::lsp::runTableGenLSPServer(), runTransformOnCGSCCs(), mlir::affine::separateFullTiles(), serializeModule(), mlir::spirv::Serializer::processTypeDecoration< spirv::ArrayType >(), mlir::spirv::Serializer::processTypeDecoration< spirv::RuntimeArrayType >(), mlir::transform::TransformResults::setMappedValues(), mlir::MlirOptMainConfig::setPassPipelineParser(), mlir::OperationName::UnregisteredOpModel::setPropertiesFromAttr(), mlir::Operation::setPropertiesFromAttribute(), mlir::MlirOptMainConfig::setupPassPipeline(), mlir::DiagnosedSilenceableFailure::silence(), simplifyRegions(), splitAndProcessBuffer(), mlir::vector::splitFullAndPartialTransfer(), splitFullAndPartialTransferPrecondition(), mlir::mesh::spmdizeOperation(), staticallyNonNegative(), structFuncArgTypeConverter(), mlir::DiagnosedSilenceableFailure::success(), mlir::affine::tilePerfectlyNested(), mlir::affine::tilePerfectlyNestedParametric(), mlir::LLVM::detail::LoopAnnotationImporter::translateAccessGroup(), translateDataLayout(), tryIsolateBands(), mlir::detail::OpToOpPassAdaptor::tryMergeInto(), tryToDestructureMemorySlots(), tryToPromoteMemorySlots(), GenericPadOpVectorizationPattern::tryVectorizeCopy(), typeOrAttrParser(), mlir::presburger::IntegerRelation::unionBoundingBox(), unwrap(), updateDeallocIfChanged(), updateFuncOp(), mlir::BytecodeDialectInterface::upgradeFromVersion(), vectorizeAsTensorPackOp(), vectorizeAsTensorPadOp(), vectorizeAsTensorUnpackOp(), mlir::linalg::vectorizeCopy(), vectorizeDynamicConvOpPrecondition(), vectorizeLinalgOpPrecondition(), vectorizePackOpPrecondition(), vectorizePadOpPrecondition(), vectorizeUnPackOpPrecondition(), mlir::OpState::verify(), mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::verify(), mlir::DataLayoutSpecAttr::verify(), mlir::gpu::MMAMatrixType::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::AnyAttributeConstraint::verify(), mlir::irdl::ConstraintVerifier::verify(), mlir::spirv::InterfaceVarABIAttr::verify(), mlir::spirv::VerCapExtAttr::verify(), mlir::LLVM::LLVMStructType::verify(), mlir::spirv::MatrixType::verify(), mlir::quant::CalibratedQuantizedType::verify(), mlir::spirv::SampledImageType::verify(), mlir::quant::UniformQuantizedPerAxisType::verify(), mlir::quant::UniformQuantizedType::verify(), mlir::quant::QuantizedType::verify(), mlir::quant::AnyQuantizedType::verify(), mlir::irdl::RegionConstraint::verify(), mlir::spirv::verifyAccessChain(), mlir::detail::verifyAffineMapAsLayout(), verifyAllToAllOperandAndResultShape(), verifyAtomicMemOp(), verifyCallOpDebugInfo(), verifyCompatibleDims(), verifyCompatibleShape(), verifyCompatibleShapes(), mlir::detail::verifyDataLayoutSpec(), verifyDependencies(), verifyDimensionCompatibility(), mlir::LLVM::LLVMStructType::verifyEntries(), mlir::DataLayoutDialectInterface::verifyEntry(), verifyGatherOperandAndResultShape(), mlir::spirv::verifyGroupNonUniformArithmeticOp(), verifyImageOperands(), verifyInGroupDevice(), mlir::DynamicOpDefinition::verifyInherentAttrs(), mlir::OperationName::UnregisteredOpModel::verifyInherentAttrs(), mlir::RegisteredOperationName::Model< ConcreteOp >::verifyInherentAttrs(), mlir::OperationName::UnregisteredOpModel::verifyInvariants(), mlir::affine::AffineDmaStartOp::verifyInvariantsImpl(), mlir::affine::AffineDmaWaitOp::verifyInvariantsImpl(), verifyLoopNesting(), verifyMeshAxes(), mlir::Dialect::verifyOperationAttribute(), verifyPermutationMap(), verifyReduceOpAndType(), mlir::Dialect::verifyRegionArgAttribute(), verifyRegionAttribute(), mlir::OperationName::UnregisteredOpModel::verifyRegionInvariants(), mlir::Dialect::verifyRegionResultAttribute(), mlir::OpState::verifyRegions(), mlir::op_definition_impl::verifyRegionTrait(), verifyScatterOrSliceOperandAndResultShape(), verifyScheduleModifiers(), verifyStructIndices(), mlir::op_definition_impl::verifyTrait(), verifyVectorConstructionInvariants(), mlir::dataflow::DeadCodeAnalysis::visit(), mlir::SimpleAffineExprFlattener::visitAddExpr(), mlir::SimpleAffineExprFlattener::visitConstantExpr(), mlir::SimpleAffineExprFlattener::visitDimExpr(), mlir::SimpleAffineExprFlattener::visitModExpr(), mlir::SimpleAffineExprFlattener::visitMulExpr(), mlir::SimpleAffineExprFlattener::visitSymbolExpr(), walkReturnOperations(), and mlir::scf::yieldReplacementForFusedProducer().
|
inline |
Wrap a value on the success path in a FailureOr of the same value type.
Definition at line 106 of file LogicalResult.h.
LogicalResult mlir::TableGenLspServerMain | ( | int | argc, |
char ** | argv | ||
) |
Implementation for tools like tblgen-lsp-server
.
Definition at line 20 of file TableGenLspServerMain.cpp.
References mlir::lsp::Logger::Debug, mlir::lsp::Delimited, mlir::lsp::Logger::Error, mlir::lsp::Logger::Info, options, mlir::lsp::runTableGenLSPServer(), mlir::lsp::Logger::setLogLevel(), and mlir::lsp::Standard.
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.
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 825 of file Utils.cpp.
References stripmineSink().
Referenced by extractFixedOuterLoops(), mlir::linalg::GeneralizeOuterUnitDimsPackOpPattern::matchAndRewrite(), mlir::linalg::pack(), and tile().
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 848 of file Utils.cpp.
References getPerfectlyNestedLoopsImpl(), and mlir::affine::tile().
Multi-root DAG topological sort.
Performs a topological sort of the Operation in the toSort
SetVector. Returns a topologically sorted SetVector.
Definition at line 201 of file SliceAnalysis.cpp.
Referenced by destructureSlot(), and promoteSingleIterReductionLoop().
StringRef mlir::toString | ( | AsmResourceEntryKind | kind | ) |
Definition at line 1702 of file AsmPrinter.cpp.
Referenced by mlir::detail::AsmParserImpl< BaseT >::parseBase64Bytes(), and mlir::BytecodeReader::Impl::read().
bool mlir::trailingNDimsContiguous | ( | MemRefType | type, |
int64_t | n | ||
) |
Return "true" if the last N dimensions of the given type are contiguous.
Examples:
Definition at line 971 of file BuiltinTypes.cpp.
References getStridesAndOffset(), isLastMemrefDimUnitStride(), and succeeded().
Referenced by mlir::vector::isContiguousSlice().
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(), failed(), failure(), 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().
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().
Referenced by prepareLLVMModule().
OwningOpRef< ModuleOp > mlir::translateLLVMIRToModule | ( | std::unique_ptr< llvm::Module > | llvmModule, |
MLIRContext * | context, | ||
bool | emitExpensiveWarnings = true |
||
) |
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.
Definition at line 2067 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(), failed(), mlir::OwningOpRef< OpTy >::get(), get(), mlir::MLIRContext::getAvailableDialects(), mlir::LLVM::ModuleImport::initializeImportInterface(), and mlir::MLIRContext::loadAllAvailableDialects().
Referenced by registerFromLLVMIRTranslation().
std::unique_ptr<llvm::Module> mlir::translateModuleToLLVMIR | ( | Operation * | module, |
llvm::LLVMContext & | llvmContext, | ||
llvm::StringRef | name = "LLVMDialectModule" |
||
) |
Translate operation that satisfies LLVM dialect module requirements into an LLVM IR module living in the given context.
This translates operations from any dilalect that has a registered implementation of LLVMTranslationDialectInterface.
Referenced by mlir::ExecutionEngine::create(), mlirTranslateModuleToLLVMIR(), mlir::gpu::SerializeToBlobPass::translateToLLVMIR(), and mlir::LLVM::ModuleToObject::translateToLLVMIR().
LogicalResult mlir::tryToDestructureMemorySlots | ( | ArrayRef< DestructurableAllocationOpInterface > | allocators, |
RewriterBase & | rewriter, | ||
SROAStatistics | statistics = {} |
||
) |
Attempts to destructure the slots of destructurable allocators.
Returns failure if no slot was destructured.
Definition at line 187 of file SROA.cpp.
References computeDestructuringInfo(), destructureSlot(), and success().
LogicalResult mlir::tryToPromoteMemorySlots | ( | ArrayRef< PromotableAllocationOpInterface > | allocators, |
RewriterBase & | rewriter, | ||
Mem2RegStatistics | statistics = {} |
||
) |
Attempts to promote the memory slots of the provided allocators.
Succeeds if at least one memory slot was promoted.
Definition at line 611 of file Mem2Reg.cpp.
References mlir::MemorySlot::ptr, success(), and mlir::Value::use_empty().
LogicalResult mlir::verify | ( | Operation * | op, |
bool | verifyRecursively = true |
||
) |
Perform (potentially expensive) checks of invariants, used to detect compiler bugs, on this operation and any nested operations.
On error, this reports the error through the MLIRContext and returns failure. If verifyRecursively
is false, this assumes that nested operations have already been properly verified, and does not recursively invoke the verifier on nested operations.
Definition at line 421 of file Verifier.cpp.
Referenced by applyPatternsAndFoldGreedily(), mlir::pdll::codegenPDLLToMLIR(), mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::get(), mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getChecked(), mlir::transform::detail::interpreterBaseInitializeImpl(), mlir::Tester::isInteresting(), mlir::detail::Parser::parseStridedLayoutAttr(), mlir::transform::detail::parseTransformModuleFromFile(), mlir::DynamicOpDefinition::setVerifyFn(), mlir::DynamicOpDefinition::setVerifyRegionFn(), impl::MemRefDataVerifier< T >::verify(), mlir::MlirOptMainConfig::verifyDiagnostics(), mlir::MlirOptMainConfig::verifyPasses(), and mlir::MlirOptMainConfig::verifyRoundtrip().
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.
References success().
Referenced by verifyCompatibleShapes().
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.
References failure(), and success().
Referenced by verifyCompatibleShape(), and verifyCompatibleShapes().
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 failure(), success(), and verifyCompatibleShape().
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 failed(), failure(), success(), and verifyCompatibleDims().
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 failed(), failure(), success(), and verifyCompatibleShape().
Referenced by areValidCastInputsAndOutputs().
|
static |
Definition at line 58 of file JointMatrixOps.cpp.
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.
|
static |
Definition at line 21 of file JointMatrixOps.cpp.
|
static |
Common verifier for reshape-like types.
Fills expandedType
and collapsedType
with the proper src
or result
type.
Definition at line 109 of file ReshapeOpsUtils.h.
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 57 of file RegionUtils.cpp.
References visitUsedValuesDefinedAbove().
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 36 of file RegionUtils.cpp.
References mlir::Region::getParentRegion(), mlir::Region::isAncestor(), and mlir::Region::walk().
Referenced by getUsedValuesDefinedAbove(), isOpSibling(), and visitUsedValuesDefinedAbove().
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 153 of file SideEffectInterfaces.cpp.
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 1306 of file BytecodeWriter.cpp.
|
inlineconstexpr |
Definition at line 317 of file AttrTypeSubElements.h.
Referenced by mlir::detail::replaceImmediateSubElementsImpl(), and mlir::detail::walkImmediateSubElementsImpl().
|
externinline |
|
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().