MLIR 23.0.0git
IR.cpp File Reference
#include "mlir-c/IR.h"
#include "mlir-c/Support.h"
#include "mlir/AsmParser/AsmParser.h"
#include "mlir/Bytecode/BytecodeWriter.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/IRMapping.h"
#include "mlir/CAPI/Support.h"
#include "mlir/CAPI/Utils.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/Location.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/IR/OwningOpRef.h"
#include "mlir/IR/Types.h"
#include "mlir/IR/Value.h"
#include "mlir/IR/Verifier.h"
#include "mlir/IR/Visitors.h"
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "mlir/Parser/Parser.h"
#include "llvm/ADT/SmallPtrSet.h"
#include <cstddef>
#include <memory>
#include <optional>

Go to the source code of this file.

Macros

#define APPEND_ELEMS(type, sizeName, elemName)

Functions

MlirContext mlirContextCreate ()
 Creates an MLIR context and transfers its ownership to the caller.
static MLIRContext::Threading toThreadingEnum (bool threadingEnabled)
MlirContext mlirContextCreateWithThreading (bool threadingEnabled)
 Creates an MLIR context with an explicit setting of the multithreading setting and transfers its ownership to the caller.
MlirContext mlirContextCreateWithRegistry (MlirDialectRegistry registry, bool threadingEnabled)
 Creates an MLIR context, setting the multithreading setting explicitly and pre-loading the dialects from the provided DialectRegistry.
bool mlirContextEqual (MlirContext ctx1, MlirContext ctx2)
 Checks if two contexts are equal.
void mlirContextDestroy (MlirContext context)
 Takes an MLIR context owned by the caller and destroys it.
void mlirContextSetAllowUnregisteredDialects (MlirContext context, bool allow)
 Sets whether unregistered dialects are allowed in this context.
bool mlirContextGetAllowUnregisteredDialects (MlirContext context)
 Returns whether the context allows unregistered dialects.
intptr_t mlirContextGetNumRegisteredDialects (MlirContext context)
 Returns the number of dialects registered with the given context.
void mlirContextAppendDialectRegistry (MlirContext ctx, MlirDialectRegistry registry)
 Append the contents of the given dialect registry to the registry associated with the context.
intptr_t mlirContextGetNumLoadedDialects (MlirContext context)
 Returns the number of dialects loaded by the context.
MlirDialect mlirContextGetOrLoadDialect (MlirContext context, MlirStringRef name)
 Gets the dialect instance owned by the given context using the dialect namespace to identify it, loads (i.e., constructs the instance of) the dialect if necessary.
bool mlirContextIsRegisteredOperation (MlirContext context, MlirStringRef name)
 Returns whether the given fully-qualified operation (i.e.
void mlirContextEnableMultithreading (MlirContext context, bool enable)
 Set threading mode (must be set to false to mlir-print-ir-after-all).
void mlirContextLoadAllAvailableDialects (MlirContext context)
 Eagerly loads all available dialects registered with a context, making them available for use for IR construction.
void mlirContextSetThreadPool (MlirContext context, MlirLlvmThreadPool threadPool)
 Sets the thread pool of the context explicitly, enabling multithreading in the process.
unsigned mlirContextGetNumThreads (MlirContext context)
 Gets the number of threads of the thread pool of the context when multithreading is enabled.
MlirLlvmThreadPool mlirContextGetThreadPool (MlirContext context)
 Gets the thread pool of the context when enabled multithreading, otherwise an assertion is raised.
MlirContext mlirDialectGetContext (MlirDialect dialect)
 Returns the context that owns the dialect.
bool mlirDialectEqual (MlirDialect dialect1, MlirDialect dialect2)
 Checks if two dialects that belong to the same context are equal.
MlirStringRef mlirDialectGetNamespace (MlirDialect dialect)
 Returns the namespace of the given dialect.
MlirDialectRegistry mlirDialectRegistryCreate ()
 Creates a dialect registry and transfers its ownership to the caller.
void mlirDialectRegistryDestroy (MlirDialectRegistry registry)
 Takes a dialect registry owned by the caller and destroys it.
MlirAsmState mlirAsmStateCreateForOperation (MlirOperation op, MlirOpPrintingFlags flags)
static OperationfindParent (Operation *op, bool shouldUseLocalScope)
MlirAsmState mlirAsmStateCreateForValue (MlirValue value, MlirOpPrintingFlags flags)
void mlirAsmStateDestroy (MlirAsmState state)
 Destroys printing flags created with mlirAsmStateCreate.
MlirOpPrintingFlags mlirOpPrintingFlagsCreate ()
void mlirOpPrintingFlagsDestroy (MlirOpPrintingFlags flags)
void mlirOpPrintingFlagsElideLargeElementsAttrs (MlirOpPrintingFlags flags, intptr_t largeElementLimit)
void mlirOpPrintingFlagsElideLargeResourceString (MlirOpPrintingFlags flags, intptr_t largeResourceLimit)
void mlirOpPrintingFlagsEnableDebugInfo (MlirOpPrintingFlags flags, bool enable, bool prettyForm)
void mlirOpPrintingFlagsPrintGenericOpForm (MlirOpPrintingFlags flags)
void mlirOpPrintingFlagsPrintNameLocAsPrefix (MlirOpPrintingFlags flags)
void mlirOpPrintingFlagsUseLocalScope (MlirOpPrintingFlags flags)
void mlirOpPrintingFlagsAssumeVerified (MlirOpPrintingFlags flags)
void mlirOpPrintingFlagsSkipRegions (MlirOpPrintingFlags flags)
MlirBytecodeWriterConfig mlirBytecodeWriterConfigCreate ()
void mlirBytecodeWriterConfigDestroy (MlirBytecodeWriterConfig config)
void mlirBytecodeWriterConfigDesiredEmitVersion (MlirBytecodeWriterConfig flags, int64_t version)
MlirAttribute mlirLocationGetAttribute (MlirLocation location)
 Returns the underlying location attribute of this location.
MlirLocation mlirLocationFromAttribute (MlirAttribute attribute)
 Creates a location from a location attribute.
MlirLocation mlirLocationFileLineColGet (MlirContext context, MlirStringRef filename, unsigned line, unsigned col)
 Creates an File/Line/Column location owned by the given context.
MlirLocation mlirLocationFileLineColRangeGet (MlirContext context, MlirStringRef filename, unsigned startLine, unsigned startCol, unsigned endLine, unsigned endCol)
 Creates an File/Line/Column range location owned by the given context.
MlirIdentifier mlirLocationFileLineColRangeGetFilename (MlirLocation location)
 Getter for filename of FileLineColRange.
int mlirLocationFileLineColRangeGetStartLine (MlirLocation location)
 Getter for start_line of FileLineColRange.
int mlirLocationFileLineColRangeGetStartColumn (MlirLocation location)
 Getter for start_column of FileLineColRange.
int mlirLocationFileLineColRangeGetEndLine (MlirLocation location)
 Getter for end_line of FileLineColRange.
int mlirLocationFileLineColRangeGetEndColumn (MlirLocation location)
 Getter for end_column of FileLineColRange.
MlirTypeID mlirLocationFileLineColRangeGetTypeID ()
 TypeID Getter for FileLineColRange.
bool mlirLocationIsAFileLineColRange (MlirLocation location)
 Checks whether the given location is an FileLineColRange.
MlirLocation mlirLocationCallSiteGet (MlirLocation callee, MlirLocation caller)
 Creates a call site location with a callee and a caller.
MlirLocation mlirLocationCallSiteGetCallee (MlirLocation location)
 Getter for callee of CallSite.
MlirLocation mlirLocationCallSiteGetCaller (MlirLocation location)
 Getter for caller of CallSite.
MlirTypeID mlirLocationCallSiteGetTypeID ()
 TypeID Getter for CallSite.
bool mlirLocationIsACallSite (MlirLocation location)
 Checks whether the given location is an CallSite.
MlirLocation mlirLocationFusedGet (MlirContext ctx, intptr_t nLocations, MlirLocation const *locations, MlirAttribute metadata)
 Creates a fused location with an array of locations and metadata.
unsigned mlirLocationFusedGetNumLocations (MlirLocation location)
 Getter for number of locations fused together.
void mlirLocationFusedGetLocations (MlirLocation location, MlirLocation *locationsCPtr)
 Getter for locations of Fused.
MlirAttribute mlirLocationFusedGetMetadata (MlirLocation location)
 Getter for metadata of Fused.
MlirTypeID mlirLocationFusedGetTypeID ()
 TypeID Getter for Fused.
bool mlirLocationIsAFused (MlirLocation location)
 Checks whether the given location is an Fused.
MlirLocation mlirLocationNameGet (MlirContext context, MlirStringRef name, MlirLocation childLoc)
 Creates a name location owned by the given context.
MlirIdentifier mlirLocationNameGetName (MlirLocation location)
 Getter for name of Name.
MlirLocation mlirLocationNameGetChildLoc (MlirLocation location)
 Getter for childLoc of Name.
MlirTypeID mlirLocationNameGetTypeID ()
 TypeID Getter for Name.
bool mlirLocationIsAName (MlirLocation location)
 Checks whether the given location is an Name.
MlirLocation mlirLocationUnknownGet (MlirContext context)
 Creates a location with unknown position owned by the given context.
MlirTypeID mlirLocationUnknownGetTypeID ()
 TypeID Getter for Unknown.
bool mlirLocationIsAUnknown (MlirLocation location)
 Checks whether the given location is an Unknown.
bool mlirLocationEqual (MlirLocation l1, MlirLocation l2)
 Checks if two locations are equal.
MlirContext mlirLocationGetContext (MlirLocation location)
 Gets the context that a location was created with.
void mlirLocationPrint (MlirLocation location, MlirStringCallback callback, void *userData)
MlirModule mlirModuleCreateEmpty (MlirLocation location)
MlirModule mlirModuleCreateParse (MlirContext context, MlirStringRef module)
MlirModule mlirModuleCreateParseFromFile (MlirContext context, MlirStringRef fileName)
MlirContext mlirModuleGetContext (MlirModule module)
MlirBlock mlirModuleGetBody (MlirModule module)
void mlirModuleDestroy (MlirModule module)
MlirOperation mlirModuleGetOperation (MlirModule module)
MlirModule mlirModuleFromOperation (MlirOperation op)
bool mlirModuleEqual (MlirModule lhs, MlirModule rhs)
size_t mlirModuleHashValue (MlirModule mod)
MlirOperationState mlirOperationStateGet (MlirStringRef name, MlirLocation loc)
void mlirOperationStateAddResults (MlirOperationState *state, intptr_t n, MlirType const *results)
void mlirOperationStateAddOperands (MlirOperationState *state, intptr_t n, MlirValue const *operands)
void mlirOperationStateAddOwnedRegions (MlirOperationState *state, intptr_t n, MlirRegion const *regions)
void mlirOperationStateAddSuccessors (MlirOperationState *state, intptr_t n, MlirBlock const *successors)
void mlirOperationStateAddAttributes (MlirOperationState *state, intptr_t n, MlirNamedAttribute const *attributes)
void mlirOperationStateEnableResultTypeInference (MlirOperationState *state)
static LogicalResult inferOperationTypes (OperationState &state)
MlirOperation mlirOperationCreate (MlirOperationState *state)
MlirOperation mlirOperationCreateParse (MlirContext context, MlirStringRef sourceStr, MlirStringRef sourceName)
MlirOperation mlirOperationClone (MlirOperation op)
void mlirOperationDestroy (MlirOperation op)
void mlirOperationRemoveFromParent (MlirOperation op)
bool mlirOperationEqual (MlirOperation op, MlirOperation other)
size_t mlirOperationHashValue (MlirOperation op)
MlirContext mlirOperationGetContext (MlirOperation op)
bool mlirOperationNameHasTrait (MlirStringRef opName, MlirTypeID traitTypeID, MlirContext context)
MlirLocation mlirOperationGetLocation (MlirOperation op)
void mlirOperationSetLocation (MlirOperation op, MlirLocation loc)
MlirTypeID mlirOperationGetTypeID (MlirOperation op)
MlirIdentifier mlirOperationGetName (MlirOperation op)
MlirBlock mlirOperationGetBlock (MlirOperation op)
MlirOperation mlirOperationGetParentOperation (MlirOperation op)
intptr_t mlirOperationGetNumRegions (MlirOperation op)
MlirRegion mlirOperationGetRegion (MlirOperation op, intptr_t pos)
MlirRegion mlirOperationGetFirstRegion (MlirOperation op)
 Returns first region attached to the operation.
MlirRegion mlirRegionGetNextInOperation (MlirRegion region)
 Returns the region immediately following the given region in its parent operation.
MlirOperation mlirOperationGetNextInBlock (MlirOperation op)
intptr_t mlirOperationGetNumOperands (MlirOperation op)
MlirValue mlirOperationGetOperand (MlirOperation op, intptr_t pos)
MlirOpOperand mlirOperationGetOpOperand (MlirOperation op, intptr_t pos)
void mlirOperationSetOperand (MlirOperation op, intptr_t pos, MlirValue newValue)
void mlirOperationSetOperands (MlirOperation op, intptr_t nOperands, MlirValue const *operands)
intptr_t mlirOperationGetNumResults (MlirOperation op)
MlirValue mlirOperationGetResult (MlirOperation op, intptr_t pos)
intptr_t mlirOperationGetNumSuccessors (MlirOperation op)
MlirBlock mlirOperationGetSuccessor (MlirOperation op, intptr_t pos)
MLIR_CAPI_EXPORTED bool mlirOperationHasInherentAttributeByName (MlirOperation op, MlirStringRef name)
MlirAttribute mlirOperationGetInherentAttributeByName (MlirOperation op, MlirStringRef name)
void mlirOperationSetInherentAttributeByName (MlirOperation op, MlirStringRef name, MlirAttribute attr)
intptr_t mlirOperationGetNumDiscardableAttributes (MlirOperation op)
MlirNamedAttribute mlirOperationGetDiscardableAttribute (MlirOperation op, intptr_t pos)
MlirAttribute mlirOperationGetDiscardableAttributeByName (MlirOperation op, MlirStringRef name)
void mlirOperationSetDiscardableAttributeByName (MlirOperation op, MlirStringRef name, MlirAttribute attr)
bool mlirOperationRemoveDiscardableAttributeByName (MlirOperation op, MlirStringRef name)
void mlirOperationSetSuccessor (MlirOperation op, intptr_t pos, MlirBlock block)
intptr_t mlirOperationGetNumAttributes (MlirOperation op)
MlirNamedAttribute mlirOperationGetAttribute (MlirOperation op, intptr_t pos)
MlirAttribute mlirOperationGetAttributeByName (MlirOperation op, MlirStringRef name)
void mlirOperationSetAttributeByName (MlirOperation op, MlirStringRef name, MlirAttribute attr)
bool mlirOperationRemoveAttributeByName (MlirOperation op, MlirStringRef name)
void mlirOperationPrint (MlirOperation op, MlirStringCallback callback, void *userData)
 Prints a location by sending chunks of the string representation and forwarding userData to callback`.
void mlirOperationPrintWithFlags (MlirOperation op, MlirOpPrintingFlags flags, MlirStringCallback callback, void *userData)
 Same as mlirOperationPrint but accepts flags controlling the printing behavior.
void mlirOperationPrintWithState (MlirOperation op, MlirAsmState state, MlirStringCallback callback, void *userData)
 Same as mlirOperationPrint but accepts AsmState controlling the printing behavior as well as caching computed names.
void mlirOperationWriteBytecode (MlirOperation op, MlirStringCallback callback, void *userData)
 Same as mlirOperationPrint but writing the bytecode format.
MlirLogicalResult mlirOperationWriteBytecodeWithConfig (MlirOperation op, MlirBytecodeWriterConfig config, MlirStringCallback callback, void *userData)
 Same as mlirOperationWriteBytecode but with writer config and returns failure only if desired bytecode could not be honored.
void mlirOperationDump (MlirOperation op)
 Prints an operation to stderr.
bool mlirOperationVerify (MlirOperation op)
 Verify the operation and return true if it passes, false if it fails.
void mlirOperationMoveAfter (MlirOperation op, MlirOperation other)
 Moves the given operation immediately after the other operation in its parent block.
void mlirOperationMoveBefore (MlirOperation op, MlirOperation other)
 Moves the given operation immediately before the other operation in its parent block.
bool mlirOperationIsBeforeInBlock (MlirOperation op, MlirOperation other)
 Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block.
static mlir::WalkResult unwrap (MlirWalkResult result)
void mlirOperationWalk (MlirOperation op, MlirOperationWalkCallback callback, void *userData, MlirWalkOrder walkOrder)
 Walks operation op in walkOrder and calls callback on that operation.
void mlirOperationReplaceUsesOfWith (MlirOperation op, MlirValue oldValue, MlirValue newValue)
 Replace uses of 'of' value with the 'with' value inside the 'op' operation.
MlirRegion mlirRegionCreate ()
 Creates a new empty region and transfers ownership to the caller.
bool mlirRegionEqual (MlirRegion region, MlirRegion other)
 Checks whether two region handles point to the same region.
MlirBlock mlirRegionGetFirstBlock (MlirRegion region)
 Gets the first block in the region.
void mlirRegionAppendOwnedBlock (MlirRegion region, MlirBlock block)
 Takes a block owned by the caller and appends it to the given region.
void mlirRegionInsertOwnedBlock (MlirRegion region, intptr_t pos, MlirBlock block)
 Takes a block owned by the caller and inserts it at pos to the given region.
void mlirRegionInsertOwnedBlockAfter (MlirRegion region, MlirBlock reference, MlirBlock block)
 Takes a block owned by the caller and inserts it after the (non-owned) reference block in the given region.
void mlirRegionInsertOwnedBlockBefore (MlirRegion region, MlirBlock reference, MlirBlock block)
 Takes a block owned by the caller and inserts it before the (non-owned) reference block in the given region.
void mlirRegionDestroy (MlirRegion region)
 Takes a region owned by the caller and destroys it.
void mlirRegionTakeBody (MlirRegion target, MlirRegion source)
 Moves the entire content of the source region to the target region.
MlirBlock mlirBlockCreate (intptr_t nArgs, MlirType const *args, MlirLocation const *locs)
 Creates a new empty block with the given argument types and transfers ownership to the caller.
bool mlirBlockEqual (MlirBlock block, MlirBlock other)
 Checks whether two blocks handles point to the same block.
MlirOperation mlirBlockGetParentOperation (MlirBlock block)
 Returns the closest surrounding operation that contains this block.
MlirRegion mlirBlockGetParentRegion (MlirBlock block)
 Returns the region that contains this block.
MlirBlock mlirBlockGetNextInRegion (MlirBlock block)
 Returns the block immediately following the given block in its parent region.
MlirOperation mlirBlockGetFirstOperation (MlirBlock block)
 Returns the first operation in the block.
MlirOperation mlirBlockGetTerminator (MlirBlock block)
 Returns the terminator operation in the block or null if no terminator.
void mlirBlockAppendOwnedOperation (MlirBlock block, MlirOperation operation)
 Takes an operation owned by the caller and appends it to the block.
void mlirBlockInsertOwnedOperation (MlirBlock block, intptr_t pos, MlirOperation operation)
 Takes an operation owned by the caller and inserts it as pos to the block.
void mlirBlockInsertOwnedOperationAfter (MlirBlock block, MlirOperation reference, MlirOperation operation)
 Takes an operation owned by the caller and inserts it after the (non-owned) reference operation in the given block.
void mlirBlockInsertOwnedOperationBefore (MlirBlock block, MlirOperation reference, MlirOperation operation)
 Takes an operation owned by the caller and inserts it before the (non-owned) reference operation in the given block.
void mlirBlockDestroy (MlirBlock block)
 Takes a block owned by the caller and destroys it.
void mlirBlockDetach (MlirBlock block)
 Detach a block from the owning region and assume ownership.
intptr_t mlirBlockGetNumArguments (MlirBlock block)
 Returns the number of arguments of the block.
MlirValue mlirBlockAddArgument (MlirBlock block, MlirType type, MlirLocation loc)
 Appends an argument of the specified type to the block.
void mlirBlockEraseArgument (MlirBlock block, unsigned index)
 Erase the argument at 'index' and remove it from the argument list.
MlirValue mlirBlockInsertArgument (MlirBlock block, intptr_t pos, MlirType type, MlirLocation loc)
 Inserts an argument of the specified type at a specified index to the block.
MlirValue mlirBlockGetArgument (MlirBlock block, intptr_t pos)
 Returns pos-th argument of the block.
void mlirBlockPrint (MlirBlock block, MlirStringCallback callback, void *userData)
intptr_t mlirBlockGetNumSuccessors (MlirBlock block)
MlirBlock mlirBlockGetSuccessor (MlirBlock block, intptr_t pos)
intptr_t mlirBlockGetNumPredecessors (MlirBlock block)
MlirBlock mlirBlockGetPredecessor (MlirBlock block, intptr_t pos)
bool mlirValueEqual (MlirValue value1, MlirValue value2)
bool mlirValueIsABlockArgument (MlirValue value)
bool mlirValueIsAOpResult (MlirValue value)
MlirBlock mlirBlockArgumentGetOwner (MlirValue value)
intptr_t mlirBlockArgumentGetArgNumber (MlirValue value)
void mlirBlockArgumentSetType (MlirValue value, MlirType type)
void mlirBlockArgumentSetLocation (MlirValue value, MlirLocation loc)
MlirOperation mlirOpResultGetOwner (MlirValue value)
intptr_t mlirOpResultGetResultNumber (MlirValue value)
MlirType mlirValueGetType (MlirValue value)
void mlirValueSetType (MlirValue value, MlirType type)
void mlirValueDump (MlirValue value)
void mlirValuePrint (MlirValue value, MlirStringCallback callback, void *userData)
 Prints a block by sending chunks of the string representation and forwarding userData to callback`.
void mlirValuePrintAsOperand (MlirValue value, MlirAsmState state, MlirStringCallback callback, void *userData)
 Prints a value as an operand (i.e., the ValueID).
MlirOpOperand mlirValueGetFirstUse (MlirValue value)
 Returns an op operand representing the first use of the value, or a null op operand if there are no uses.
void mlirValueReplaceAllUsesOfWith (MlirValue oldValue, MlirValue newValue)
 Replace all uses of 'of' value with the 'with' value, updating anything in the IR that uses 'of' to use the other value instead.
void mlirValueReplaceAllUsesExcept (MlirValue oldValue, MlirValue newValue, intptr_t numExceptions, MlirOperation *exceptions)
 Replace all uses of 'of' value with 'with' value, updating anything in the IR that uses 'of' to use 'with' instead, except if the user is listed in 'exceptions'.
MlirLocation mlirValueGetLocation (MlirValue v)
 Gets the location of the value.
MlirContext mlirValueGetContext (MlirValue v)
 Gets the context that a value was created with.
bool mlirOpOperandIsNull (MlirOpOperand opOperand)
 Returns whether the op operand is null.
MlirOperation mlirOpOperandGetOwner (MlirOpOperand opOperand)
 Returns the owner operation of an op operand.
MlirValue mlirOpOperandGetValue (MlirOpOperand opOperand)
 Returns the value of an op operand.
unsigned mlirOpOperandGetOperandNumber (MlirOpOperand opOperand)
 Returns the operand number of an op operand.
MlirOpOperand mlirOpOperandGetNextUse (MlirOpOperand opOperand)
 Returns an op operand representing the next use of the value, or a null op operand if there is no next use.
MlirType mlirTypeParseGet (MlirContext context, MlirStringRef type)
 Parses a type. The type is owned by the context.
MlirContext mlirTypeGetContext (MlirType type)
 Gets the context that a type was created with.
MlirTypeID mlirTypeGetTypeID (MlirType type)
 Gets the type ID of the type.
MlirDialect mlirTypeGetDialect (MlirType type)
 Gets the dialect a type belongs to.
bool mlirTypeEqual (MlirType t1, MlirType t2)
 Checks if two types are equal.
void mlirTypePrint (MlirType type, MlirStringCallback callback, void *userData)
void mlirTypeDump (MlirType type)
MlirAttribute mlirAttributeParseGet (MlirContext context, MlirStringRef attr)
MlirContext mlirAttributeGetContext (MlirAttribute attribute)
MlirType mlirAttributeGetType (MlirAttribute attribute)
MlirTypeID mlirAttributeGetTypeID (MlirAttribute attr)
MlirDialect mlirAttributeGetDialect (MlirAttribute attr)
bool mlirAttributeEqual (MlirAttribute a1, MlirAttribute a2)
void mlirAttributePrint (MlirAttribute attr, MlirStringCallback callback, void *userData)
 Prints a location by sending chunks of the string representation and forwarding userData to callback`.
void mlirAttributeDump (MlirAttribute attr)
 Prints the attribute to the standard error stream.
MlirNamedAttribute mlirNamedAttributeGet (MlirIdentifier name, MlirAttribute attr)
 Associates an attribute with the name. Takes ownership of neither.
MlirIdentifier mlirIdentifierGet (MlirContext context, MlirStringRef str)
 Gets an identifier with the given string value.
MlirContext mlirIdentifierGetContext (MlirIdentifier ident)
 Returns the context associated with this identifier.
bool mlirIdentifierEqual (MlirIdentifier ident, MlirIdentifier other)
 Checks whether two identifiers are the same.
MlirStringRef mlirIdentifierStr (MlirIdentifier ident)
 Gets the string value of the identifier.
MlirStringRef mlirSymbolTableGetSymbolAttributeName ()
 Returns the name of the attribute used to store symbol names compatible with symbol tables.
MlirStringRef mlirSymbolTableGetVisibilityAttributeName ()
 Returns the name of the attribute used to store symbol visibility.
MlirSymbolTable mlirSymbolTableCreate (MlirOperation operation)
 Creates a symbol table for the given operation.
void mlirSymbolTableDestroy (MlirSymbolTable symbolTable)
 Destroys the symbol table created with mlirSymbolTableCreate.
MlirOperation mlirSymbolTableLookup (MlirSymbolTable symbolTable, MlirStringRef name)
 Looks up a symbol with the given name in the given symbol table and returns the operation that corresponds to the symbol.
MlirAttribute mlirSymbolTableInsert (MlirSymbolTable symbolTable, MlirOperation operation)
 Inserts the given operation into the given symbol table.
void mlirSymbolTableErase (MlirSymbolTable symbolTable, MlirOperation operation)
 Removes the given operation from the symbol table and erases it.
MlirLogicalResult mlirSymbolTableReplaceAllSymbolUses (MlirStringRef oldSymbol, MlirStringRef newSymbol, MlirOperation from)
 Attempt to replace all uses that are nested within the given operation of the given symbol 'oldSymbol' with the provided 'newSymbol'.
void mlirSymbolTableWalkSymbolTables (MlirOperation from, bool allSymUsesVisible, void(*callback)(MlirOperation, bool, void *userData), void *userData)
 Walks all symbol table operations nested within, and including, op.
MlirIRMapping mlirIRMappingCreate (void)
 Creates a new empty IRMapping.
void mlirIRMappingDestroy (MlirIRMapping mapping)
 Destroys the given IRMapping.
void mlirIRMappingMapValue (MlirIRMapping mapping, MlirValue from, MlirValue to)
 Maps a Value in the mapping.
void mlirIRMappingMapBlock (MlirIRMapping mapping, MlirBlock from, MlirBlock to)
 Maps a Block in the mapping.
void mlirIRMappingMapOperation (MlirIRMapping mapping, MlirOperation from, MlirOperation to)
 Maps an Operation in the mapping.
void mlirIRMappingClear (MlirIRMapping mapping)
 Clears all mappings.
MlirValue mlirIRMappingLookupOrDefaultValue (MlirIRMapping mapping, MlirValue from)
 Looks up a mapped Value.
MlirValue mlirIRMappingLookupOrNullValue (MlirIRMapping mapping, MlirValue from)
 Looks up a mapped Value. Returns a null MlirValue if no mapping exists.
MlirBlock mlirIRMappingLookupOrDefaultBlock (MlirIRMapping mapping, MlirBlock from)
 Looks up a mapped Block.
MlirBlock mlirIRMappingLookupOrNullBlock (MlirIRMapping mapping, MlirBlock from)
 Looks up a mapped Block. Returns a null MlirBlock if no mapping exists.
MlirOperation mlirIRMappingLookupOrDefaultOperation (MlirIRMapping mapping, MlirOperation from)
 Looks up a mapped Operation.
MlirOperation mlirIRMappingLookupOrNullOperation (MlirIRMapping mapping, MlirOperation from)
 Looks up a mapped Operation.
bool mlirIRMappingContainsValue (MlirIRMapping mapping, MlirValue value)
 Returns true if the mapping contains a mapping for the given value.
bool mlirIRMappingContainsBlock (MlirIRMapping mapping, MlirBlock block)
 Returns true if the mapping contains a mapping for the given block.
bool mlirIRMappingContainsOperation (MlirIRMapping mapping, MlirOperation op)
 Returns true if the mapping contains a mapping for the given operation.
void mlirIRMappingEraseValue (MlirIRMapping mapping, MlirValue value)
 Erases a value mapping.
void mlirIRMappingEraseBlock (MlirIRMapping mapping, MlirBlock block)
 Erases a block mapping.
void mlirIRMappingEraseOperation (MlirIRMapping mapping, MlirOperation op)
 Erases an operation mapping.
MlirOperation mlirOperationCloneWithMapping (MlirOperation op, MlirIRMapping mapping)
 Clones the operation with the given mapping.

Macro Definition Documentation

◆ APPEND_ELEMS

#define APPEND_ELEMS ( type,
sizeName,
elemName )
Value:
state->elemName = \
(type *)realloc(state->elemName, (state->sizeName + n) * sizeof(type)); \
memcpy(state->elemName + state->sizeName, elemName, n * sizeof(type)); \
state->sizeName += n;

Definition at line 506 of file IR.cpp.

Referenced by mlirOperationStateAddAttributes(), mlirOperationStateAddOperands(), mlirOperationStateAddOwnedRegions(), mlirOperationStateAddResults(), and mlirOperationStateAddSuccessors().

Function Documentation

◆ findParent()

Operation * findParent ( Operation * op,
bool shouldUseLocalScope )
static

◆ inferOperationTypes()

◆ mlirAsmStateCreateForOperation()

MlirAsmState mlirAsmStateCreateForOperation ( MlirOperation op,
MlirOpPrintingFlags flags )

Definition at line 157 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirAsmStateCreateForValue()

MlirAsmState mlirAsmStateCreateForValue ( MlirValue value,
MlirOpPrintingFlags flags )

◆ mlirAsmStateDestroy()

void mlirAsmStateDestroy ( MlirAsmState state)

Destroys printing flags created with mlirAsmStateCreate.

Definition at line 196 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirAttributeDump()

void mlirAttributeDump ( MlirAttribute attr)

Prints the attribute to the standard error stream.

Definition at line 1328 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirAttributeEqual()

bool mlirAttributeEqual ( MlirAttribute a1,
MlirAttribute a2 )

Definition at line 1318 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyAttribute::getCapsule().

◆ mlirAttributeGetContext()

◆ mlirAttributeGetDialect()

MlirDialect mlirAttributeGetDialect ( MlirAttribute attr)

Definition at line 1314 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyLocation::maybeDownCast().

◆ mlirAttributeGetType()

◆ mlirAttributeGetTypeID()

MlirTypeID mlirAttributeGetTypeID ( MlirAttribute attr)

◆ mlirAttributeParseGet()

MlirAttribute mlirAttributeParseGet ( MlirContext context,
MlirStringRef attr )

◆ mlirAttributePrint()

void mlirAttributePrint ( MlirAttribute attr,
MlirStringCallback callback,
void * userData )

Prints a location by sending chunks of the string representation and forwarding userData to callback`.

Note that the callback may be called / several times with consecutive chunks of the string. MLIR_CAPI_EXPORTED void mlirTypePrint(MlirType type, MlirStringCallback callback, void *userData);

/ Prints the type to the standard error stream. MLIR_CAPI_EXPORTED void mlirTypeDump(MlirType type);

===-------------------------------------------------------------------—===// Attribute API. ===-------------------------------------------------------------------—===//

/ Parses an attribute. The attribute is owned by the context. MLIR_CAPI_EXPORTED MlirAttribute mlirAttributeParseGet(MlirContext context, MlirStringRef attr);

/ Gets the context that an attribute was created with. MLIR_CAPI_EXPORTED MlirContext mlirAttributeGetContext(MlirAttribute attribute);

/ Gets the type of this attribute. MLIR_CAPI_EXPORTED MlirType mlirAttributeGetType(MlirAttribute attribute);

/ Gets the type id of the attribute. MLIR_CAPI_EXPORTED MlirTypeID mlirAttributeGetTypeID(MlirAttribute attribute);

/ Gets the dialect of the attribute. MLIR_CAPI_EXPORTED MlirDialect mlirAttributeGetDialect(MlirAttribute attribute);

/ Checks whether an attribute is null. static inline bool mlirAttributeIsNull(MlirAttribute attr) { return !attr.ptr; }

/ Checks if two attributes are equal. MLIR_CAPI_EXPORTED bool mlirAttributeEqual(MlirAttribute a1, MlirAttribute a2);

/ Prints an attribute by sending chunks of the string representation and / forwarding userData to callback`. Note that the callback may be called several times with consecutive chunks of the string.

Definition at line 1322 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteAttribute< DerivedTy, BaseTy >::bind(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockAddArgument()

MlirValue mlirBlockAddArgument ( MlirBlock block,
MlirType type,
MlirLocation loc )

Appends an argument of the specified type to the block.

Returns the newly added argument.

Definition at line 1082 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockAppendOwnedOperation()

void mlirBlockAppendOwnedOperation ( MlirBlock block,
MlirOperation operation )

Takes an operation owned by the caller and appends it to the block.

Definition at line 1034 of file IR.cpp.

References unwrap().

Referenced by mlirBlockInsertOwnedOperationBefore(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockArgumentGetArgNumber()

intptr_t mlirBlockArgumentGetArgNumber ( MlirValue value)

Definition at line 1146 of file IR.cpp.

References unwrap().

◆ mlirBlockArgumentGetOwner()

MlirBlock mlirBlockArgumentGetOwner ( MlirValue value)

Definition at line 1142 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockArgumentSetLocation()

void mlirBlockArgumentSetLocation ( MlirValue value,
MlirLocation loc )

Definition at line 1156 of file IR.cpp.

References unwrap().

◆ mlirBlockArgumentSetType()

void mlirBlockArgumentSetType ( MlirValue value,
MlirType type )

Definition at line 1151 of file IR.cpp.

References unwrap().

◆ mlirBlockCreate()

MlirBlock mlirBlockCreate ( intptr_t nArgs,
MlirType const * args,
MlirLocation const * locs )

Creates a new empty block with the given argument types and transfers ownership to the caller.

Definition at line 993 of file IR.cpp.

References b, unwrap(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::createBlock().

◆ mlirBlockDestroy()

void mlirBlockDestroy ( MlirBlock block)

Takes a block owned by the caller and destroys it.

Definition at line 1071 of file IR.cpp.

References unwrap().

◆ mlirBlockDetach()

void mlirBlockDetach ( MlirBlock block)

Detach a block from the owning region and assume ownership.

Definition at line 1073 of file IR.cpp.

References b, and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockEqual()

bool mlirBlockEqual ( MlirBlock block,
MlirBlock other )

Checks whether two blocks handles point to the same block.

This does not perform deep comparison.

Definition at line 1001 of file IR.cpp.

References unwrap().

◆ mlirBlockEraseArgument()

void mlirBlockEraseArgument ( MlirBlock block,
unsigned index )

Erase the argument at 'index' and remove it from the argument list.

Definition at line 1087 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockGetArgument()

MlirValue mlirBlockGetArgument ( MlirBlock block,
intptr_t pos )

Returns pos-th argument of the block.

Definition at line 1096 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirBlockGetFirstOperation()

MlirOperation mlirBlockGetFirstOperation ( MlirBlock block)

Returns the first operation in the block.

Definition at line 1017 of file IR.cpp.

References mlir::Block::empty(), mlir::Block::front(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockGetNextInRegion()

MlirBlock mlirBlockGetNextInRegion ( MlirBlock block)

◆ mlirBlockGetNumArguments()

intptr_t mlirBlockGetNumArguments ( MlirBlock block)

Returns the number of arguments of the block.

Definition at line 1078 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockArgumentList::bindDerived().

◆ mlirBlockGetNumPredecessors()

intptr_t mlirBlockGetNumPredecessors ( MlirBlock block)

Definition at line 1114 of file IR.cpp.

References b, and unwrap().

◆ mlirBlockGetNumSuccessors()

intptr_t mlirBlockGetNumSuccessors ( MlirBlock block)

Definition at line 1106 of file IR.cpp.

References unwrap().

◆ mlirBlockGetParentOperation()

MlirOperation mlirBlockGetParentOperation ( MlirBlock block)

Returns the closest surrounding operation that contains this block.

Definition at line 1005 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::getInsertionPoint().

◆ mlirBlockGetParentRegion()

MlirRegion mlirBlockGetParentRegion ( MlirBlock block)

Returns the region that contains this block.

Definition at line 1009 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBlockGetPredecessor()

MlirBlock mlirBlockGetPredecessor ( MlirBlock block,
intptr_t pos )

Definition at line 1119 of file IR.cpp.

References b, unwrap(), and wrap().

◆ mlirBlockGetSuccessor()

MlirBlock mlirBlockGetSuccessor ( MlirBlock block,
intptr_t pos )

Definition at line 1110 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirBlockGetTerminator()

MlirOperation mlirBlockGetTerminator ( MlirBlock block)

Returns the terminator operation in the block or null if no terminator.

Definition at line 1024 of file IR.cpp.

References mlir::Block::back(), mlir::Block::empty(), mlir::Operation::hasTrait(), unwrap(), and wrap().

◆ mlirBlockInsertArgument()

MlirValue mlirBlockInsertArgument ( MlirBlock block,
intptr_t pos,
MlirType type,
MlirLocation loc )

Inserts an argument of the specified type at a specified index to the block.

Returns the newly added argument.

Definition at line 1091 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirBlockInsertOwnedOperation()

void mlirBlockInsertOwnedOperation ( MlirBlock block,
intptr_t pos,
MlirOperation operation )

Takes an operation owned by the caller and inserts it as pos to the block.

This is an expensive operation that scans the block linearly, prefer insertBefore/After instead.

Definition at line 1038 of file IR.cpp.

References unwrap(), and unwrap().

◆ mlirBlockInsertOwnedOperationAfter()

void mlirBlockInsertOwnedOperationAfter ( MlirBlock block,
MlirOperation reference,
MlirOperation operation )

Takes an operation owned by the caller and inserts it after the (non-owned) reference operation in the given block.

If the reference is null, prepends the operation. Otherwise, the reference must belong to the block.

Definition at line 1044 of file IR.cpp.

References mlir::Block::begin(), mlir::Block::getOperations(), unwrap(), and unwrap().

◆ mlirBlockInsertOwnedOperationBefore()

void mlirBlockInsertOwnedOperationBefore ( MlirBlock block,
MlirOperation reference,
MlirOperation operation )

Takes an operation owned by the caller and inserts it before the (non-owned) reference operation in the given block.

If the reference is null, appends the operation. Otherwise, the reference must belong to the block.

Definition at line 1059 of file IR.cpp.

References mlirBlockAppendOwnedOperation(), and unwrap().

◆ mlirBlockPrint()

void mlirBlockPrint ( MlirBlock block,
MlirStringCallback callback,
void * userData )

Definition at line 1100 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirBytecodeWriterConfigCreate()

MlirBytecodeWriterConfig mlirBytecodeWriterConfigCreate ( void )

Definition at line 248 of file IR.cpp.

References wrap().

◆ mlirBytecodeWriterConfigDesiredEmitVersion()

void mlirBytecodeWriterConfigDesiredEmitVersion ( MlirBytecodeWriterConfig flags,
int64_t version )

Definition at line 256 of file IR.cpp.

References unwrap().

◆ mlirBytecodeWriterConfigDestroy()

void mlirBytecodeWriterConfigDestroy ( MlirBytecodeWriterConfig config)

Definition at line 252 of file IR.cpp.

References unwrap().

◆ mlirContextAppendDialectRegistry()

void mlirContextAppendDialectRegistry ( MlirContext ctx,
MlirDialectRegistry registry )

Append the contents of the given dialect registry to the registry associated with the context.

Definition at line 84 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextCreate()

MlirContext mlirContextCreate ( void )

Creates an MLIR context and transfers its ownership to the caller.

This sets the default multithreading option (enabled).

Definition at line 45 of file IR.cpp.

References wrap().

◆ mlirContextCreateWithRegistry()

MlirContext mlirContextCreateWithRegistry ( MlirDialectRegistry registry,
bool threadingEnabled )

Creates an MLIR context, setting the multithreading setting explicitly and pre-loading the dialects from the provided DialectRegistry.

Definition at line 60 of file IR.cpp.

References toThreadingEnum(), unwrap(), and wrap().

◆ mlirContextCreateWithThreading()

MlirContext mlirContextCreateWithThreading ( bool threadingEnabled)

Creates an MLIR context with an explicit setting of the multithreading setting and transfers its ownership to the caller.

Definition at line 55 of file IR.cpp.

References toThreadingEnum(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextDestroy()

void mlirContextDestroy ( MlirContext context)

Takes an MLIR context owned by the caller and destroys it.

Definition at line 71 of file IR.cpp.

References unwrap().

◆ mlirContextEnableMultithreading()

void mlirContextEnableMultithreading ( MlirContext context,
bool enable )

Set threading mode (must be set to false to mlir-print-ir-after-all).

Definition at line 104 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextEqual()

bool mlirContextEqual ( MlirContext ctx1,
MlirContext ctx2 )

Checks if two contexts are equal.

Definition at line 67 of file IR.cpp.

References unwrap().

◆ mlirContextGetAllowUnregisteredDialects()

bool mlirContextGetAllowUnregisteredDialects ( MlirContext context)

Returns whether the context allows unregistered dialects.

Definition at line 77 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextGetNumLoadedDialects()

intptr_t mlirContextGetNumLoadedDialects ( MlirContext context)

Returns the number of dialects loaded by the context.

Definition at line 91 of file IR.cpp.

References unwrap().

◆ mlirContextGetNumRegisteredDialects()

intptr_t mlirContextGetNumRegisteredDialects ( MlirContext context)

Returns the number of dialects registered with the given context.

A registered dialect will be loaded if needed by the parser.

Definition at line 80 of file IR.cpp.

References unwrap().

◆ mlirContextGetNumThreads()

unsigned mlirContextGetNumThreads ( MlirContext context)

Gets the number of threads of the thread pool of the context when multithreading is enabled.

Returns 1 if no multithreading.

Definition at line 117 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextGetOrLoadDialect()

MlirDialect mlirContextGetOrLoadDialect ( MlirContext context,
MlirStringRef name )

Gets the dialect instance owned by the given context using the dialect namespace to identify it, loads (i.e., constructs the instance of) the dialect if necessary.

If the dialect is not registered with the context, returns null. Use mlirContextLoad<Name>Dialect to load an unregistered dialect.

Definition at line 95 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDialects::getDialectForKey(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextGetThreadPool()

MlirLlvmThreadPool mlirContextGetThreadPool ( MlirContext context)

Gets the thread pool of the context when enabled multithreading, otherwise an assertion is raised.

Definition at line 121 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextIsRegisteredOperation()

bool mlirContextIsRegisteredOperation ( MlirContext context,
MlirStringRef name )

Returns whether the given fully-qualified operation (i.e.

'dialect.operation') is registered with the context. This will return true if the dialect is loaded and the operation is registered within the dialect.

Definition at line 100 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextLoadAllAvailableDialects()

void mlirContextLoadAllAvailableDialects ( MlirContext context)

Eagerly loads all available dialects registered with a context, making them available for use for IR construction.

Definition at line 108 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextSetAllowUnregisteredDialects()

void mlirContextSetAllowUnregisteredDialects ( MlirContext context,
bool allow )

Sets whether unregistered dialects are allowed in this context.

Definition at line 73 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirContextSetThreadPool()

void mlirContextSetThreadPool ( MlirContext context,
MlirLlvmThreadPool threadPool )

Sets the thread pool of the context explicitly, enabling multithreading in the process.

This API should be used to avoid re-creating thread pools in long-running applications that perform multiple compilations, see the C++ documentation for MLIRContext for details.

Definition at line 112 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirDialectEqual()

bool mlirDialectEqual ( MlirDialect dialect1,
MlirDialect dialect2 )

Checks if two dialects that belong to the same context are equal.

Dialects from different contexts will not compare equal.

Definition at line 133 of file IR.cpp.

References unwrap().

◆ mlirDialectGetContext()

MlirContext mlirDialectGetContext ( MlirDialect dialect)

Returns the context that owns the dialect.

Definition at line 129 of file IR.cpp.

References getContext(), unwrap(), and wrap().

◆ mlirDialectGetNamespace()

◆ mlirDialectRegistryCreate()

MlirDialectRegistry mlirDialectRegistryCreate ( void )

Creates a dialect registry and transfers its ownership to the caller.

Definition at line 145 of file IR.cpp.

References wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDialectRegistry::PyDialectRegistry().

◆ mlirDialectRegistryDestroy()

void mlirDialectRegistryDestroy ( MlirDialectRegistry registry)

Takes a dialect registry owned by the caller and destroys it.

Definition at line 149 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDialectRegistry::~PyDialectRegistry().

◆ mlirIdentifierEqual()

bool mlirIdentifierEqual ( MlirIdentifier ident,
MlirIdentifier other )

Checks whether two identifiers are the same.

Definition at line 1347 of file IR.cpp.

References unwrap().

◆ mlirIdentifierGet()

MlirIdentifier mlirIdentifierGet ( MlirContext context,
MlirStringRef str )

Gets an identifier with the given string value.

Definition at line 1339 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDictAttribute::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNamedAttribute::PyNamedAttribute().

◆ mlirIdentifierGetContext()

MlirContext mlirIdentifierGetContext ( MlirIdentifier ident)

Returns the context associated with this identifier.

Definition at line 1343 of file IR.cpp.

References getContext(), unwrap(), and wrap().

◆ mlirIdentifierStr()

◆ mlirIRMappingClear()

void mlirIRMappingClear ( MlirIRMapping mapping)

Clears all mappings.

Definition at line 1437 of file IR.cpp.

References unwrap().

◆ mlirIRMappingContainsBlock()

bool mlirIRMappingContainsBlock ( MlirIRMapping mapping,
MlirBlock block )

Returns true if the mapping contains a mapping for the given block.

Definition at line 1473 of file IR.cpp.

References unwrap().

◆ mlirIRMappingContainsOperation()

bool mlirIRMappingContainsOperation ( MlirIRMapping mapping,
MlirOperation op )

Returns true if the mapping contains a mapping for the given operation.

Definition at line 1477 of file IR.cpp.

References unwrap().

◆ mlirIRMappingContainsValue()

bool mlirIRMappingContainsValue ( MlirIRMapping mapping,
MlirValue value )

Returns true if the mapping contains a mapping for the given value.

Definition at line 1469 of file IR.cpp.

References unwrap().

◆ mlirIRMappingCreate()

MlirIRMapping mlirIRMappingCreate ( void )

Creates a new empty IRMapping.

Definition at line 1418 of file IR.cpp.

References wrap().

◆ mlirIRMappingDestroy()

void mlirIRMappingDestroy ( MlirIRMapping mapping)

Destroys the given IRMapping.

Definition at line 1420 of file IR.cpp.

References unwrap().

◆ mlirIRMappingEraseBlock()

void mlirIRMappingEraseBlock ( MlirIRMapping mapping,
MlirBlock block )

Erases a block mapping.

Definition at line 1485 of file IR.cpp.

References unwrap().

◆ mlirIRMappingEraseOperation()

void mlirIRMappingEraseOperation ( MlirIRMapping mapping,
MlirOperation op )

Erases an operation mapping.

Definition at line 1489 of file IR.cpp.

References unwrap().

◆ mlirIRMappingEraseValue()

void mlirIRMappingEraseValue ( MlirIRMapping mapping,
MlirValue value )

Erases a value mapping.

Definition at line 1481 of file IR.cpp.

References unwrap().

◆ mlirIRMappingLookupOrDefaultBlock()

MlirBlock mlirIRMappingLookupOrDefaultBlock ( MlirIRMapping mapping,
MlirBlock from )

Looks up a mapped Block.

Returns the mapped block, or the input block if no mapping exists.

Definition at line 1449 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirIRMappingLookupOrDefaultOperation()

MlirOperation mlirIRMappingLookupOrDefaultOperation ( MlirIRMapping mapping,
MlirOperation from )

Looks up a mapped Operation.

Returns the mapped operation, or the input operation if no mapping exists.

Definition at line 1459 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirIRMappingLookupOrDefaultValue()

MlirValue mlirIRMappingLookupOrDefaultValue ( MlirIRMapping mapping,
MlirValue from )

Looks up a mapped Value.

Returns the mapped value, or the input value if no mapping exists.

Definition at line 1439 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirIRMappingLookupOrNullBlock()

MlirBlock mlirIRMappingLookupOrNullBlock ( MlirIRMapping mapping,
MlirBlock from )

Looks up a mapped Block. Returns a null MlirBlock if no mapping exists.

Definition at line 1454 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirIRMappingLookupOrNullOperation()

MlirOperation mlirIRMappingLookupOrNullOperation ( MlirIRMapping mapping,
MlirOperation from )

Looks up a mapped Operation.

Returns a null MlirOperation if no mapping exists.

Definition at line 1464 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirIRMappingLookupOrNullValue()

MlirValue mlirIRMappingLookupOrNullValue ( MlirIRMapping mapping,
MlirValue from )

Looks up a mapped Value. Returns a null MlirValue if no mapping exists.

Definition at line 1444 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirIRMappingMapBlock()

void mlirIRMappingMapBlock ( MlirIRMapping mapping,
MlirBlock from,
MlirBlock to )

Maps a Block in the mapping.

Definition at line 1427 of file IR.cpp.

References unwrap().

◆ mlirIRMappingMapOperation()

void mlirIRMappingMapOperation ( MlirIRMapping mapping,
MlirOperation from,
MlirOperation to )

Maps an Operation in the mapping.

Definition at line 1432 of file IR.cpp.

References unwrap().

◆ mlirIRMappingMapValue()

void mlirIRMappingMapValue ( MlirIRMapping mapping,
MlirValue from,
MlirValue to )

Maps a Value in the mapping.

Definition at line 1422 of file IR.cpp.

References unwrap().

◆ mlirLocationCallSiteGet()

MlirLocation mlirLocationCallSiteGet ( MlirLocation callee,
MlirLocation caller )

Creates a call site location with a callee and a caller.

Definition at line 325 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyCallSiteLocation::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationCallSiteGetCallee()

MlirLocation mlirLocationCallSiteGetCallee ( MlirLocation location)

Getter for callee of CallSite.

Definition at line 329 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyCallSiteLocation::bindDerived().

◆ mlirLocationCallSiteGetCaller()

MlirLocation mlirLocationCallSiteGetCaller ( MlirLocation location)

Getter for caller of CallSite.

Definition at line 334 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyCallSiteLocation::bindDerived().

◆ mlirLocationCallSiteGetTypeID()

MlirTypeID mlirLocationCallSiteGetTypeID ( void )

TypeID Getter for CallSite.

Definition at line 339 of file IR.cpp.

References wrap().

◆ mlirLocationEqual()

bool mlirLocationEqual ( MlirLocation l1,
MlirLocation l2 )

Checks if two locations are equal.

Definition at line 415 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationFileLineColGet()

MlirLocation mlirLocationFileLineColGet ( MlirContext context,
MlirStringRef filename,
unsigned line,
unsigned col )

Creates an File/Line/Column location owned by the given context.

Definition at line 273 of file IR.cpp.

References mlir::FileLineColLoc::get(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationFileLineColRangeGet()

MlirLocation mlirLocationFileLineColRangeGet ( MlirContext context,
MlirStringRef filename,
unsigned startLine,
unsigned startCol,
unsigned endLine,
unsigned endCol )

Creates an File/Line/Column range location owned by the given context.

Definition at line 281 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationFileLineColRangeGetEndColumn()

int mlirLocationFileLineColRangeGetEndColumn ( MlirLocation location)

Getter for end_column of FileLineColRange.

Definition at line 311 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived().

◆ mlirLocationFileLineColRangeGetEndLine()

int mlirLocationFileLineColRangeGetEndLine ( MlirLocation location)

Getter for end_line of FileLineColRange.

Definition at line 305 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived().

◆ mlirLocationFileLineColRangeGetFilename()

MlirIdentifier mlirLocationFileLineColRangeGetFilename ( MlirLocation location)

Getter for filename of FileLineColRange.

Definition at line 289 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived().

◆ mlirLocationFileLineColRangeGetStartColumn()

int mlirLocationFileLineColRangeGetStartColumn ( MlirLocation location)

Getter for start_column of FileLineColRange.

Definition at line 299 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived().

◆ mlirLocationFileLineColRangeGetStartLine()

int mlirLocationFileLineColRangeGetStartLine ( MlirLocation location)

Getter for start_line of FileLineColRange.

Definition at line 293 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFileLineColLocation::bindDerived().

◆ mlirLocationFileLineColRangeGetTypeID()

MlirTypeID mlirLocationFileLineColRangeGetTypeID ( void )

TypeID Getter for FileLineColRange.

Definition at line 317 of file IR.cpp.

References wrap().

◆ mlirLocationFromAttribute()

MlirLocation mlirLocationFromAttribute ( MlirAttribute attribute)

Creates a location from a location attribute.

Definition at line 269 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationFusedGet()

MlirLocation mlirLocationFusedGet ( MlirContext ctx,
intptr_t nLocations,
MlirLocation const * locations,
MlirAttribute metadata )

Creates a fused location with an array of locations and metadata.

Definition at line 347 of file IR.cpp.

References unwrap(), unwrapList(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFusedLocation::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationFusedGetLocations()

void mlirLocationFusedGetLocations ( MlirLocation location,
MlirLocation * locationsCPtr )

Getter for locations of Fused.

Requires pre-allocated memory of #fusedLocations X sizeof(MlirLocation).

Definition at line 361 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFusedLocation::bindDerived().

◆ mlirLocationFusedGetMetadata()

MlirAttribute mlirLocationFusedGetMetadata ( MlirLocation location)

Getter for metadata of Fused.

Definition at line 369 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFusedLocation::bindDerived().

◆ mlirLocationFusedGetNumLocations()

unsigned mlirLocationFusedGetNumLocations ( MlirLocation location)

Getter for number of locations fused together.

Definition at line 355 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFusedLocation::bindDerived().

◆ mlirLocationFusedGetTypeID()

MlirTypeID mlirLocationFusedGetTypeID ( void )

TypeID Getter for Fused.

Definition at line 373 of file IR.cpp.

References wrap().

◆ mlirLocationGetAttribute()

MlirAttribute mlirLocationGetAttribute ( MlirLocation location)

Returns the underlying location attribute of this location.

Definition at line 265 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyLocation::maybeDownCast(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationGetContext()

MlirContext mlirLocationGetContext ( MlirLocation location)

Gets the context that a location was created with.

Definition at line 419 of file IR.cpp.

References getContext(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::llvm::StructType::bindDerived().

◆ mlirLocationIsACallSite()

bool mlirLocationIsACallSite ( MlirLocation location)

Checks whether the given location is an CallSite.

Definition at line 343 of file IR.cpp.

References unwrap().

◆ mlirLocationIsAFileLineColRange()

bool mlirLocationIsAFileLineColRange ( MlirLocation location)

Checks whether the given location is an FileLineColRange.

Definition at line 321 of file IR.cpp.

References unwrap().

◆ mlirLocationIsAFused()

bool mlirLocationIsAFused ( MlirLocation location)

Checks whether the given location is an Fused.

Definition at line 375 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFusedLocation::bindDerived().

◆ mlirLocationIsAName()

bool mlirLocationIsAName ( MlirLocation location)

Checks whether the given location is an Name.

Definition at line 399 of file IR.cpp.

References unwrap().

◆ mlirLocationIsAUnknown()

bool mlirLocationIsAUnknown ( MlirLocation location)

Checks whether the given location is an Unknown.

Definition at line 411 of file IR.cpp.

References unwrap().

◆ mlirLocationNameGet()

MlirLocation mlirLocationNameGet ( MlirContext context,
MlirStringRef name,
MlirLocation childLoc )

Creates a name location owned by the given context.

Providing null location for childLoc is allowed and if childLoc is null location, then the behavior is the same as having unknown child location.

Definition at line 379 of file IR.cpp.

References mlirLocationIsNull(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNameLocation::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirLocationNameGetChildLoc()

MlirLocation mlirLocationNameGetChildLoc ( MlirLocation location)

Getter for childLoc of Name.

Definition at line 392 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNameLocation::bindDerived().

◆ mlirLocationNameGetName()

MlirIdentifier mlirLocationNameGetName ( MlirLocation location)

Getter for name of Name.

Definition at line 388 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNameLocation::bindDerived().

◆ mlirLocationNameGetTypeID()

MlirTypeID mlirLocationNameGetTypeID ( void )

TypeID Getter for Name.

Definition at line 397 of file IR.cpp.

References wrap().

◆ mlirLocationPrint()

◆ mlirLocationUnknownGet()

MlirLocation mlirLocationUnknownGet ( MlirContext context)

◆ mlirLocationUnknownGetTypeID()

MlirTypeID mlirLocationUnknownGetTypeID ( void )

TypeID Getter for Unknown.

Definition at line 407 of file IR.cpp.

References wrap().

◆ mlirModuleCreateEmpty()

MlirModule mlirModuleCreateEmpty ( MlirLocation location)

Definition at line 433 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirModuleCreateParse()

MlirModule mlirModuleCreateParse ( MlirContext context,
MlirStringRef module )

◆ mlirModuleCreateParseFromFile()

MlirModule mlirModuleCreateParseFromFile ( MlirContext context,
MlirStringRef fileName )

◆ mlirModuleDestroy()

void mlirModuleDestroy ( MlirModule module)

Definition at line 462 of file IR.cpp.

References unwrap().

◆ mlirModuleEqual()

bool mlirModuleEqual ( MlirModule lhs,
MlirModule rhs )

Definition at line 476 of file IR.cpp.

References lhs, rhs, and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirModuleFromOperation()

MlirModule mlirModuleFromOperation ( MlirOperation op)

Definition at line 472 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirModuleGetBody()

MlirBlock mlirModuleGetBody ( MlirModule module)

Definition at line 458 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirModuleGetContext()

MlirContext mlirModuleGetContext ( MlirModule module)

Definition at line 454 of file IR.cpp.

References getContext(), unwrap(), and wrap().

◆ mlirModuleGetOperation()

MlirOperation mlirModuleGetOperation ( MlirModule module)

◆ mlirModuleHashValue()

size_t mlirModuleHashValue ( MlirModule mod)

◆ mlirNamedAttributeGet()

MlirNamedAttribute mlirNamedAttributeGet ( MlirIdentifier name,
MlirAttribute attr )

Associates an attribute with the name. Takes ownership of neither.

Definition at line 1330 of file IR.cpp.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyDictAttribute::bindDerived(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyNamedAttribute::PyNamedAttribute().

◆ mlirOperationClone()

MlirOperation mlirOperationClone ( MlirOperation op)

Definition at line 643 of file IR.cpp.

References mlir::clone(), unwrap(), and wrap().

◆ mlirOperationCloneWithMapping()

MlirOperation mlirOperationCloneWithMapping ( MlirOperation op,
MlirIRMapping mapping )

Clones the operation with the given mapping.

The mapping is updated with the cloned operation's results and regions.

Definition at line 1493 of file IR.cpp.

References mlir::clone(), unwrap(), and wrap().

◆ mlirOperationCreate()

◆ mlirOperationCreateParse()

MlirOperation mlirOperationCreateParse ( MlirContext context,
MlirStringRef sourceStr,
MlirStringRef sourceName )

Definition at line 634 of file IR.cpp.

References mlir::parseSourceString(), unwrap(), and wrap().

◆ mlirOperationDestroy()

void mlirOperationDestroy ( MlirOperation op)

Definition at line 647 of file IR.cpp.

References unwrap().

◆ mlirOperationDump()

void mlirOperationDump ( MlirOperation op)

Prints an operation to stderr.

Definition at line 874 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOperationEqual()

bool mlirOperationEqual ( MlirOperation op,
MlirOperation other )

Definition at line 651 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOperationGetAttribute()

MlirNamedAttribute mlirOperationGetAttribute ( MlirOperation op,
intptr_t pos )

◆ mlirOperationGetAttributeByName()

MlirAttribute mlirOperationGetAttributeByName ( MlirOperation op,
MlirStringRef name )

Definition at line 825 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpAttributeMap::forEachAttr().

◆ mlirOperationGetBlock()

MlirBlock mlirOperationGetBlock ( MlirOperation op)

Definition at line 687 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetContext()

◆ mlirOperationGetDiscardableAttribute()

MlirNamedAttribute mlirOperationGetDiscardableAttribute ( MlirOperation op,
intptr_t pos )

◆ mlirOperationGetDiscardableAttributeByName()

MlirAttribute mlirOperationGetDiscardableAttributeByName ( MlirOperation op,
MlirStringRef name )

Definition at line 795 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetFirstRegion()

MlirRegion mlirOperationGetFirstRegion ( MlirOperation op)

Returns first region attached to the operation.

Definition at line 703 of file IR.cpp.

References mlir::Operation::getNumRegions(), mlir::Operation::getRegion(), unwrap(), and wrap().

◆ mlirOperationGetInherentAttributeByName()

MlirAttribute mlirOperationGetInherentAttributeByName ( MlirOperation op,
MlirStringRef name )

Definition at line 768 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetLocation()

MlirLocation mlirOperationGetLocation ( MlirOperation op)

Definition at line 669 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOperationGetName()

◆ mlirOperationGetNextInBlock()

MlirOperation mlirOperationGetNextInBlock ( MlirOperation op)

Definition at line 719 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetNumAttributes()

intptr_t mlirOperationGetNumAttributes ( MlirOperation op)

◆ mlirOperationGetNumDiscardableAttributes()

intptr_t mlirOperationGetNumDiscardableAttributes ( MlirOperation op)

Definition at line 783 of file IR.cpp.

References unwrap().

◆ mlirOperationGetNumOperands()

intptr_t mlirOperationGetNumOperands ( MlirOperation op)

◆ mlirOperationGetNumRegions()

intptr_t mlirOperationGetNumRegions ( MlirOperation op)

Definition at line 695 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRegionList::PyRegionList().

◆ mlirOperationGetNumResults()

intptr_t mlirOperationGetNumResults ( MlirOperation op)

Definition at line 746 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpResultList::bindDerived().

◆ mlirOperationGetNumSuccessors()

intptr_t mlirOperationGetNumSuccessors ( MlirOperation op)

◆ mlirOperationGetOperand()

MlirValue mlirOperationGetOperand ( MlirOperation op,
intptr_t pos )

Definition at line 727 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetOpOperand()

MlirOpOperand mlirOperationGetOpOperand ( MlirOperation op,
intptr_t pos )

Definition at line 731 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpOperands::PyOpOperands().

◆ mlirOperationGetParentOperation()

MlirOperation mlirOperationGetParentOperation ( MlirOperation op)

Definition at line 691 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetRegion()

MlirRegion mlirOperationGetRegion ( MlirOperation op,
intptr_t pos )

Definition at line 699 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetResult()

MlirValue mlirOperationGetResult ( MlirOperation op,
intptr_t pos )

Definition at line 750 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetSuccessor()

MlirBlock mlirOperationGetSuccessor ( MlirOperation op,
intptr_t pos )

Definition at line 758 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationGetTypeID()

MlirTypeID mlirOperationGetTypeID ( MlirOperation op)

Definition at line 677 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOperationHashValue()

size_t mlirOperationHashValue ( MlirOperation op)

◆ mlirOperationHasInherentAttributeByName()

MLIR_CAPI_EXPORTED bool mlirOperationHasInherentAttributeByName ( MlirOperation op,
MlirStringRef name )

Definition at line 763 of file IR.cpp.

References unwrap().

◆ mlirOperationIsBeforeInBlock()

bool mlirOperationIsBeforeInBlock ( MlirOperation op,
MlirOperation other )

Given an operation 'other' that is within the same parent block, return whether the current operation is before 'other' in the operation list of the parent block.

Note: This function has an average complexity of O(1), but worst case may take O(N) where N is the number of operations within the parent block.

Definition at line 888 of file IR.cpp.

References unwrap().

◆ mlirOperationMoveAfter()

void mlirOperationMoveAfter ( MlirOperation op,
MlirOperation other )

Moves the given operation immediately after the other operation in its parent block.

The given operation may be owned by the caller or by its current block. The other operation must belong to a block. In any case, the ownership is transferred to the block of the other operation.

Definition at line 880 of file IR.cpp.

References unwrap().

◆ mlirOperationMoveBefore()

void mlirOperationMoveBefore ( MlirOperation op,
MlirOperation other )

Moves the given operation immediately before the other operation in its parent block.

The given operation may be owner by the caller or by its current block. The other operation must belong to a block. In any case, the ownership is transferred to the block of the other operation.

Definition at line 884 of file IR.cpp.

References unwrap().

◆ mlirOperationNameHasTrait()

bool mlirOperationNameHasTrait ( MlirStringRef opName,
MlirTypeID traitTypeID,
MlirContext context )

◆ mlirOperationPrint()

void mlirOperationPrint ( MlirOperation op,
MlirStringCallback callback,
void * userData )

Prints a location by sending chunks of the string representation and forwarding userData to callback`.

Note that the callback may be called / several times with consecutive chunks of the string. MLIR_CAPI_EXPORTED void mlirLocationPrint(MlirLocation location, MlirStringCallback callback, void *userData);

===-------------------------------------------------------------------—===// Module API. ===-------------------------------------------------------------------—===//

/ Creates a new, empty module and transfers ownership to the caller. MLIR_CAPI_EXPORTED MlirModule mlirModuleCreateEmpty(MlirLocation location);

/ Parses a module from the string and transfers ownership to the caller. MLIR_CAPI_EXPORTED MlirModule mlirModuleCreateParse(MlirContext context, MlirStringRef module);

/ Parses a module from file and transfers ownership to the caller. MLIR_CAPI_EXPORTED MlirModule mlirModuleCreateParseFromFile(MlirContext context, MlirStringRef fileName);

/ Gets the context that a module was created with. MLIR_CAPI_EXPORTED MlirContext mlirModuleGetContext(MlirModule module);

/ Gets the body of the module, i.e. the only block it contains. MLIR_CAPI_EXPORTED MlirBlock mlirModuleGetBody(MlirModule module);

/ Checks whether a module is null. static inline bool mlirModuleIsNull(MlirModule module) { return !module.ptr; }

/ Takes a module owned by the caller and deletes it. MLIR_CAPI_EXPORTED void mlirModuleDestroy(MlirModule module);

/ Views the module as a generic operation. MLIR_CAPI_EXPORTED MlirOperation mlirModuleGetOperation(MlirModule module);

/ Views the generic operation as a module. / The returned module is null when the input operation was not a ModuleOp. MLIR_CAPI_EXPORTED MlirModule mlirModuleFromOperation(MlirOperation op);

/ Checks if two modules are equal. MLIR_CAPI_EXPORTED bool mlirModuleEqual(MlirModule lhs, MlirModule rhs);

/ Compute a hash for the given module. MLIR_CAPI_EXPORTED size_t mlirModuleHashValue(MlirModule mod);

===-------------------------------------------------------------------—===// Operation state. ===-------------------------------------------------------------------—===//

/ An auxiliary class for constructing operations. / / This class contains all the information necessary to construct the / operation. It owns the MlirRegions it has pointers to and does not own / anything else. By default, the state can be constructed from a name and / location, the latter being also used to access the context, and has no other / components. These components can be added progressively until the operation / is constructed. Users are not expected to rely on the internals of this / class and should use mlirOperationState* functions instead.

struct MlirOperationState { MlirStringRef name; MlirLocation location; intptr_t nResults; MlirType *results; intptr_t nOperands; MlirValue *operands; intptr_t nRegions; MlirRegion *regions; intptr_t nSuccessors; MlirBlock *successors; intptr_t nAttributes; MlirNamedAttribute *attributes; bool enableResultTypeInference; }; typedef struct MlirOperationState MlirOperationState;

/ Constructs an operation state from a name and a location. MLIR_CAPI_EXPORTED MlirOperationState mlirOperationStateGet(MlirStringRef name, MlirLocation loc);

/ Adds a list of components to the operation state. MLIR_CAPI_EXPORTED void mlirOperationStateAddResults(MlirOperationState *state, intptr_t n, MlirType const *results); MLIR_CAPI_EXPORTED void mlirOperationStateAddOperands(MlirOperationState *state, intptr_t n, MlirValue const *operands); MLIR_CAPI_EXPORTED void mlirOperationStateAddOwnedRegions(MlirOperationState *state, intptr_t n, MlirRegion const *regions); MLIR_CAPI_EXPORTED void mlirOperationStateAddSuccessors(MlirOperationState *state, intptr_t n, MlirBlock const *successors); MLIR_CAPI_EXPORTED void mlirOperationStateAddAttributes(MlirOperationState *state, intptr_t n, MlirNamedAttribute const *attributes);

/ Enables result type inference for the operation under construction. If / enabled, then the caller must not have called / mlirOperationStateAddResults(). Note that if enabled, the / mlirOperationCreate() call is failable: it will return a null operation / on inference failure and will emit diagnostics. MLIR_CAPI_EXPORTED void mlirOperationStateEnableResultTypeInference(MlirOperationState *state);

===-------------------------------------------------------------------—===// AsmState API. While many of these are simple settings that could be represented in a struct, they are wrapped in a heap allocated object and accessed via functions to maximize the possibility of compatibility over time. ===-------------------------------------------------------------------—===//

/ Creates new AsmState, as with AsmState the IR should not be mutated / in-between using this state. / Must be freed with a call to mlirAsmStateDestroy(). TODO: This should be expanded to handle location & resouce map. MLIR_CAPI_EXPORTED MlirAsmState mlirAsmStateCreateForOperation(MlirOperation op, MlirOpPrintingFlags flags);

/ Creates new AsmState from value. / Must be freed with a call to mlirAsmStateDestroy(). TODO: This should be expanded to handle location & resouce map. MLIR_CAPI_EXPORTED MlirAsmState mlirAsmStateCreateForValue(MlirValue value, MlirOpPrintingFlags flags);

/ Destroys printing flags created with mlirAsmStateCreate. MLIR_CAPI_EXPORTED void mlirAsmStateDestroy(MlirAsmState state);

===-------------------------------------------------------------------—===// Op Printing flags API. While many of these are simple settings that could be represented in a struct, they are wrapped in a heap allocated object and accessed via functions to maximize the possibility of compatibility over time. ===-------------------------------------------------------------------—===//

/ Creates new printing flags with defaults, intended for customization. / Must be freed with a call to mlirOpPrintingFlagsDestroy(). MLIR_CAPI_EXPORTED MlirOpPrintingFlags mlirOpPrintingFlagsCreate(void);

/ Destroys printing flags created with mlirOpPrintingFlagsCreate. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsDestroy(MlirOpPrintingFlags flags);

/ Enables the elision of large elements attributes by printing a lexically / valid but otherwise meaningless form instead of the element data. The / largeElementLimit is used to configure what is considered to be a "large" / ElementsAttr by providing an upper limit to the number of elements. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsElideLargeElementsAttrs(MlirOpPrintingFlags flags, intptr_t largeElementLimit);

/ Enables the elision of large resources strings by omitting them from the / dialect_resources section. The largeResourceLimit is used to configure / what is considered to be a "large" resource by providing an upper limit to / the string size. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsElideLargeResourceString(MlirOpPrintingFlags flags, intptr_t largeResourceLimit);

/ Enable or disable printing of debug information (based on enable). If / 'prettyForm' is set to true, debug information is printed in a more readable / 'pretty' form. Note: The IR generated with 'prettyForm' is not parsable. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsEnableDebugInfo(MlirOpPrintingFlags flags, bool enable, bool prettyForm);

/ Always print operations in the generic form. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsPrintGenericOpForm(MlirOpPrintingFlags flags);

/ Print the name and location, if NamedLoc, as a prefix to the SSA ID. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsPrintNameLocAsPrefix(MlirOpPrintingFlags flags);

/ Use local scope when printing the operation. This allows for using the / printer in a more localized and thread-safe setting, but may not / necessarily be identical to what the IR will look like when dumping / the full module. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsUseLocalScope(MlirOpPrintingFlags flags);

/ Do not verify the operation when using custom operation printers. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsAssumeVerified(MlirOpPrintingFlags flags);

/ Skip printing regions. MLIR_CAPI_EXPORTED void mlirOpPrintingFlagsSkipRegions(MlirOpPrintingFlags flags);

===-------------------------------------------------------------------—===// Bytecode printing flags API. ===-------------------------------------------------------------------—===//

/ Creates new printing flags with defaults, intended for customization. / Must be freed with a call to mlirBytecodeWriterConfigDestroy(). MLIR_CAPI_EXPORTED MlirBytecodeWriterConfig mlirBytecodeWriterConfigCreate(void);

/ Destroys printing flags created with mlirBytecodeWriterConfigCreate. MLIR_CAPI_EXPORTED void mlirBytecodeWriterConfigDestroy(MlirBytecodeWriterConfig config);

/ Sets the version to emit in the writer config. MLIR_CAPI_EXPORTED void mlirBytecodeWriterConfigDesiredEmitVersion(MlirBytecodeWriterConfig flags, int64_t version);

===-------------------------------------------------------------------—===// Operation API. ===-------------------------------------------------------------------—===//

/ Creates an operation and transfers ownership to the caller. / Note that caller owned child objects are transferred in this call and must / not be further used. Particularly, this applies to any regions added to / the state (the implementation may invalidate any such pointers). / / This call can fail under the following conditions, in which case, it will / return a null operation and emit diagnostics: / - Result type inference is enabled and cannot be performed. MLIR_CAPI_EXPORTED MlirOperation mlirOperationCreate(MlirOperationState *state);

/ Parses an operation, giving ownership to the caller. If parsing fails a null / operation will be returned, and an error diagnostic emitted. / / sourceStr may be either the text assembly format, or binary bytecode / format. 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. MLIR_CAPI_EXPORTED MlirOperation mlirOperationCreateParse( MlirContext context, MlirStringRef sourceStr, MlirStringRef sourceName);

/ Creates a deep copy of an operation. The operation is not inserted and / ownership is transferred to the caller. MLIR_CAPI_EXPORTED MlirOperation mlirOperationClone(MlirOperation op);

/ Takes an operation owned by the caller and destroys it. MLIR_CAPI_EXPORTED void mlirOperationDestroy(MlirOperation op);

/ Removes the given operation from its parent block. The operation is not / destroyed. The ownership of the operation is transferred to the caller. MLIR_CAPI_EXPORTED void mlirOperationRemoveFromParent(MlirOperation op);

/ Checks whether the underlying operation is null. static inline bool mlirOperationIsNull(MlirOperation op) { return !op.ptr; }

/ Checks whether two operation handles point to the same operation. This does / not perform deep comparison. MLIR_CAPI_EXPORTED bool mlirOperationEqual(MlirOperation op, MlirOperation other);

/ Compute a hash for the given operation. MLIR_CAPI_EXPORTED size_t mlirOperationHashValue(MlirOperation op);

/ Gets the context this operation is associated with MLIR_CAPI_EXPORTED MlirContext mlirOperationGetContext(MlirOperation op);

/ Checks if the operation name has a trait identified by the given type id. MLIR_CAPI_EXPORTED bool mlirOperationNameHasTrait(MlirStringRef opName, MlirTypeID traitTypeID, MlirContext context);

/ Gets the location of the operation. MLIR_CAPI_EXPORTED MlirLocation mlirOperationGetLocation(MlirOperation op);

/ Sets the location of the operation. MLIR_CAPI_EXPORTED void mlirOperationSetLocation(MlirOperation op, MlirLocation loc);

/ Gets the type id of the operation. / Returns null if the operation does not have a registered operation / description. MLIR_CAPI_EXPORTED MlirTypeID mlirOperationGetTypeID(MlirOperation op);

/ Gets the name of the operation as an identifier. MLIR_CAPI_EXPORTED MlirIdentifier mlirOperationGetName(MlirOperation op);

/ Gets the block that owns this operation, returning null if the operation is / not owned. MLIR_CAPI_EXPORTED MlirBlock mlirOperationGetBlock(MlirOperation op);

/ Gets the operation that owns this operation, returning null if the operation / is not owned. MLIR_CAPI_EXPORTED MlirOperation mlirOperationGetParentOperation(MlirOperation op);

/ Returns the number of regions attached to the given operation. MLIR_CAPI_EXPORTED intptr_t mlirOperationGetNumRegions(MlirOperation op);

/ Returns pos-th region attached to the operation. MLIR_CAPI_EXPORTED MlirRegion mlirOperationGetRegion(MlirOperation op, intptr_t pos);

/ Returns an operation immediately following the given operation it its / enclosing block. MLIR_CAPI_EXPORTED MlirOperation mlirOperationGetNextInBlock(MlirOperation op);

/ Returns the number of operands of the operation. MLIR_CAPI_EXPORTED intptr_t mlirOperationGetNumOperands(MlirOperation op);

/ Returns pos-th operand of the operation. MLIR_CAPI_EXPORTED MlirValue mlirOperationGetOperand(MlirOperation op, intptr_t pos);

/ Returns pos-th OpOperand of the operation. MLIR_CAPI_EXPORTED MlirOpOperand mlirOperationGetOpOperand(MlirOperation op, intptr_t pos);

/ Sets the pos-th operand of the operation. MLIR_CAPI_EXPORTED void mlirOperationSetOperand(MlirOperation op, intptr_t pos, MlirValue newValue);

/ Replaces the operands of the operation. MLIR_CAPI_EXPORTED void mlirOperationSetOperands(MlirOperation op, intptr_t nOperands, MlirValue const *operands);

/ Returns the number of results of the operation. MLIR_CAPI_EXPORTED intptr_t mlirOperationGetNumResults(MlirOperation op);

/ Returns pos-th result of the operation. MLIR_CAPI_EXPORTED MlirValue mlirOperationGetResult(MlirOperation op, intptr_t pos);

/ Returns the number of successor blocks of the operation. MLIR_CAPI_EXPORTED intptr_t mlirOperationGetNumSuccessors(MlirOperation op);

/ Returns pos-th successor of the operation. MLIR_CAPI_EXPORTED MlirBlock mlirOperationGetSuccessor(MlirOperation op, intptr_t pos);

/ Set pos-th successor of the operation. MLIR_CAPI_EXPORTED void mlirOperationSetSuccessor(MlirOperation op, intptr_t pos, MlirBlock block);

/ Returns true if this operation defines an inherent attribute with this name. / Note: the attribute can be optional, so / mlirOperationGetInherentAttributeByName can still return a null attribute. MLIR_CAPI_EXPORTED bool mlirOperationHasInherentAttributeByName(MlirOperation op, MlirStringRef name);

/ Returns an inherent attribute attached to the operation given its name. MLIR_CAPI_EXPORTED MlirAttribute mlirOperationGetInherentAttributeByName(MlirOperation op, MlirStringRef name);

/ Sets an inherent attribute by name, replacing the existing if it exists. / This has no effect if "name" does not match an inherent attribute. MLIR_CAPI_EXPORTED void mlirOperationSetInherentAttributeByName(MlirOperation op, MlirStringRef name, MlirAttribute attr);

/ Returns the number of discardable attributes attached to the operation. MLIR_CAPI_EXPORTED intptr_t mlirOperationGetNumDiscardableAttributes(MlirOperation op);

/ Return pos-th discardable attribute of the operation. MLIR_CAPI_EXPORTED MlirNamedAttribute mlirOperationGetDiscardableAttribute(MlirOperation op, intptr_t pos);

/ Returns a discardable attribute attached to the operation given its name. MLIR_CAPI_EXPORTED MlirAttribute mlirOperationGetDiscardableAttributeByName( MlirOperation op, MlirStringRef name);

/ Sets a discardable attribute by name, replacing the existing if it exists or / adding a new one otherwise. The new attr Attribute is not allowed to be / null, use mlirOperationRemoveDiscardableAttributeByName to remove an / Attribute instead. MLIR_CAPI_EXPORTED void mlirOperationSetDiscardableAttributeByName(MlirOperation op, MlirStringRef name, MlirAttribute attr);

/ Removes a discardable attribute by name. Returns false if the attribute was / not found and true if removed. MLIR_CAPI_EXPORTED bool mlirOperationRemoveDiscardableAttributeByName(MlirOperation op, MlirStringRef name);

/ Returns the number of attributes attached to the operation. / Deprecated, please use mlirOperationGetNumInherentAttributes or / mlirOperationGetNumDiscardableAttributes. MLIR_CAPI_EXPORTED intptr_t mlirOperationGetNumAttributes(MlirOperation op);

/ Return pos-th attribute of the operation. / Deprecated, please use mlirOperationGetInherentAttribute or / mlirOperationGetDiscardableAttribute. MLIR_CAPI_EXPORTED MlirNamedAttribute mlirOperationGetAttribute(MlirOperation op, intptr_t pos);

/ Returns an attribute attached to the operation given its name. / Deprecated, please use mlirOperationGetInherentAttributeByName or / mlirOperationGetDiscardableAttributeByName. MLIR_CAPI_EXPORTED MlirAttribute mlirOperationGetAttributeByName(MlirOperation op, MlirStringRef name);

/ Sets an attribute by name, replacing the existing if it exists or / adding a new one otherwise. / Deprecated, please use mlirOperationSetInherentAttributeByName or / mlirOperationSetDiscardableAttributeByName. MLIR_CAPI_EXPORTED void mlirOperationSetAttributeByName(MlirOperation op, MlirStringRef name, MlirAttribute attr);

/ Removes an attribute by name. Returns false if the attribute was not found / and true if removed. / Deprecated, please use mlirOperationRemoveInherentAttributeByName or / mlirOperationRemoveDiscardableAttributeByName. MLIR_CAPI_EXPORTED bool mlirOperationRemoveAttributeByName(MlirOperation op, MlirStringRef name);

/ Prints an operation by sending chunks of the string representation and / forwarding userData to callback`. Note that the callback may be called several times with consecutive chunks of the string.

Definition at line 839 of file IR.cpp.

References unwrap().

◆ mlirOperationPrintWithFlags()

void mlirOperationPrintWithFlags ( MlirOperation op,
MlirOpPrintingFlags flags,
MlirStringCallback callback,
void * userData )

Same as mlirOperationPrint but accepts flags controlling the printing behavior.

Definition at line 845 of file IR.cpp.

References unwrap().

◆ mlirOperationPrintWithState()

void mlirOperationPrintWithState ( MlirOperation op,
MlirAsmState state,
MlirStringCallback callback,
void * userData )

Same as mlirOperationPrint but accepts AsmState controlling the printing behavior as well as caching computed names.

Definition at line 851 of file IR.cpp.

References unwrap().

◆ mlirOperationRemoveAttributeByName()

bool mlirOperationRemoveAttributeByName ( MlirOperation op,
MlirStringRef name )

Definition at line 835 of file IR.cpp.

References unwrap().

◆ mlirOperationRemoveDiscardableAttributeByName()

bool mlirOperationRemoveDiscardableAttributeByName ( MlirOperation op,
MlirStringRef name )

Definition at line 806 of file IR.cpp.

References unwrap().

◆ mlirOperationRemoveFromParent()

void mlirOperationRemoveFromParent ( MlirOperation op)

Definition at line 649 of file IR.cpp.

References unwrap().

◆ mlirOperationReplaceUsesOfWith()

void mlirOperationReplaceUsesOfWith ( MlirOperation op,
MlirValue oldValue,
MlirValue newValue )

Replace uses of 'of' value with the 'with' value inside the 'op' operation.

Definition at line 924 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOperationSetAttributeByName()

void mlirOperationSetAttributeByName ( MlirOperation op,
MlirStringRef name,
MlirAttribute attr )

◆ mlirOperationSetDiscardableAttributeByName()

void mlirOperationSetDiscardableAttributeByName ( MlirOperation op,
MlirStringRef name,
MlirAttribute attr )

Definition at line 800 of file IR.cpp.

References unwrap().

◆ mlirOperationSetInherentAttributeByName()

void mlirOperationSetInherentAttributeByName ( MlirOperation op,
MlirStringRef name,
MlirAttribute attr )

Definition at line 776 of file IR.cpp.

References getContext(), and unwrap().

◆ mlirOperationSetLocation()

void mlirOperationSetLocation ( MlirOperation op,
MlirLocation loc )

Definition at line 673 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOperationSetOperand()

void mlirOperationSetOperand ( MlirOperation op,
intptr_t pos,
MlirValue newValue )

Definition at line 735 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpOperandList::bindDerived().

◆ mlirOperationSetOperands()

void mlirOperationSetOperands ( MlirOperation op,
intptr_t nOperands,
MlirValue const * operands )

Definition at line 740 of file IR.cpp.

References unwrap(), and unwrapList().

◆ mlirOperationSetSuccessor()

void mlirOperationSetSuccessor ( MlirOperation op,
intptr_t pos,
MlirBlock block )

Definition at line 811 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpSuccessors::bindDerived().

◆ mlirOperationStateAddAttributes()

void mlirOperationStateAddAttributes ( MlirOperationState * state,
intptr_t n,
MlirNamedAttribute const * attributes )

Definition at line 529 of file IR.cpp.

References APPEND_ELEMS.

◆ mlirOperationStateAddOperands()

void mlirOperationStateAddOperands ( MlirOperationState * state,
intptr_t n,
MlirValue const * operands )

Definition at line 517 of file IR.cpp.

References APPEND_ELEMS.

◆ mlirOperationStateAddOwnedRegions()

void mlirOperationStateAddOwnedRegions ( MlirOperationState * state,
intptr_t n,
MlirRegion const * regions )

Definition at line 521 of file IR.cpp.

References APPEND_ELEMS.

◆ mlirOperationStateAddResults()

void mlirOperationStateAddResults ( MlirOperationState * state,
intptr_t n,
MlirType const * results )

Definition at line 512 of file IR.cpp.

References APPEND_ELEMS.

◆ mlirOperationStateAddSuccessors()

void mlirOperationStateAddSuccessors ( MlirOperationState * state,
intptr_t n,
MlirBlock const * successors )

Definition at line 525 of file IR.cpp.

References APPEND_ELEMS.

◆ mlirOperationStateEnableResultTypeInference()

void mlirOperationStateEnableResultTypeInference ( MlirOperationState * state)

Definition at line 534 of file IR.cpp.

◆ mlirOperationStateGet()

MlirOperationState mlirOperationStateGet ( MlirStringRef name,
MlirLocation loc )

Definition at line 488 of file IR.cpp.

◆ mlirOperationVerify()

bool mlirOperationVerify ( MlirOperation op)

Verify the operation and return true if it passes, false if it fails.

Definition at line 876 of file IR.cpp.

References unwrap(), and mlir::verify().

◆ mlirOperationWalk()

void mlirOperationWalk ( MlirOperation op,
MlirOperationWalkCallback callback,
void * userData,
MlirWalkOrder walkOrder )

Walks operation op in walkOrder and calls callback on that operation.

*userData is passed to the callback as well and can be used to tunnel some context or other data into the callback.

Definition at line 906 of file IR.cpp.

References MlirWalkPostOrder, MlirWalkPreOrder, mlir::PostOrder, mlir::PreOrder, unwrap(), and wrap().

◆ mlirOperationWriteBytecode()

void mlirOperationWriteBytecode ( MlirOperation op,
MlirStringCallback callback,
void * userData )

Same as mlirOperationPrint but writing the bytecode format.

Definition at line 860 of file IR.cpp.

References unwrap(), and mlir::writeBytecodeToFile().

◆ mlirOperationWriteBytecodeWithConfig()

MlirLogicalResult mlirOperationWriteBytecodeWithConfig ( MlirOperation op,
MlirBytecodeWriterConfig config,
MlirStringCallback callback,
void * userData )

Same as mlirOperationWriteBytecode but with writer config and returns failure only if desired bytecode could not be honored.

Definition at line 867 of file IR.cpp.

References unwrap(), wrap(), and mlir::writeBytecodeToFile().

◆ mlirOpOperandGetNextUse()

MlirOpOperand mlirOpOperandGetNextUse ( MlirOpOperand opOperand)

Returns an op operand representing the next use of the value, or a null op operand if there is no next use.

Definition at line 1247 of file IR.cpp.

References mlirOpOperandIsNull(), unwrap(), and wrap().

◆ mlirOpOperandGetOperandNumber()

unsigned mlirOpOperandGetOperandNumber ( MlirOpOperand opOperand)

Returns the operand number of an op operand.

Definition at line 1243 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpOperand::bind().

◆ mlirOpOperandGetOwner()

MlirOperation mlirOpOperandGetOwner ( MlirOpOperand opOperand)

Returns the owner operation of an op operand.

Definition at line 1235 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirOpOperandGetValue()

MlirValue mlirOpOperandGetValue ( MlirOpOperand opOperand)

Returns the value of an op operand.

Definition at line 1239 of file IR.cpp.

References mlir::get(), unwrap(), and wrap().

◆ mlirOpOperandIsNull()

bool mlirOpOperandIsNull ( MlirOpOperand opOperand)

Returns whether the op operand is null.

Definition at line 1233 of file IR.cpp.

Referenced by mlirOpOperandGetNextUse().

◆ mlirOpPrintingFlagsAssumeVerified()

void mlirOpPrintingFlagsAssumeVerified ( MlirOpPrintingFlags flags)

Definition at line 237 of file IR.cpp.

References unwrap().

◆ mlirOpPrintingFlagsCreate()

◆ mlirOpPrintingFlagsDestroy()

◆ mlirOpPrintingFlagsElideLargeElementsAttrs()

void mlirOpPrintingFlagsElideLargeElementsAttrs ( MlirOpPrintingFlags flags,
intptr_t largeElementLimit )

Definition at line 210 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populatePassManagerSubmodule().

◆ mlirOpPrintingFlagsElideLargeResourceString()

void mlirOpPrintingFlagsElideLargeResourceString ( MlirOpPrintingFlags flags,
intptr_t largeResourceLimit )

Definition at line 215 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populatePassManagerSubmodule().

◆ mlirOpPrintingFlagsEnableDebugInfo()

void mlirOpPrintingFlagsEnableDebugInfo ( MlirOpPrintingFlags flags,
bool enable,
bool prettyForm )

Definition at line 220 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populatePassManagerSubmodule().

◆ mlirOpPrintingFlagsPrintGenericOpForm()

void mlirOpPrintingFlagsPrintGenericOpForm ( MlirOpPrintingFlags flags)

Definition at line 225 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populatePassManagerSubmodule().

◆ mlirOpPrintingFlagsPrintNameLocAsPrefix()

void mlirOpPrintingFlagsPrintNameLocAsPrefix ( MlirOpPrintingFlags flags)

Definition at line 229 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOpPrintingFlagsSkipRegions()

void mlirOpPrintingFlagsSkipRegions ( MlirOpPrintingFlags flags)

Definition at line 241 of file IR.cpp.

References unwrap().

◆ mlirOpPrintingFlagsUseLocalScope()

void mlirOpPrintingFlagsUseLocalScope ( MlirOpPrintingFlags flags)

Definition at line 233 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOpResultGetOwner()

MlirOperation mlirOpResultGetOwner ( MlirValue value)

Definition at line 1161 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirOpResultGetResultNumber()

intptr_t mlirOpResultGetResultNumber ( MlirValue value)

Definition at line 1165 of file IR.cpp.

References unwrap().

◆ mlirRegionAppendOwnedBlock()

void mlirRegionAppendOwnedBlock ( MlirRegion region,
MlirBlock block )

Takes a block owned by the caller and appends it to the given region.

Definition at line 946 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyBlockList::appendBlock(), mlirRegionInsertOwnedBlockBefore(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirRegionCreate()

MlirRegion mlirRegionCreate ( void )

Creates a new empty region and transfers ownership to the caller.

Definition at line 933 of file IR.cpp.

References wrap().

◆ mlirRegionDestroy()

void mlirRegionDestroy ( MlirRegion region)

Takes a region owned by the caller and destroys it.

Definition at line 981 of file IR.cpp.

◆ mlirRegionEqual()

bool mlirRegionEqual ( MlirRegion region,
MlirRegion other )

Checks whether two region handles point to the same region.

This does not perform deep comparison.

Definition at line 935 of file IR.cpp.

References unwrap().

◆ mlirRegionGetFirstBlock()

◆ mlirRegionGetNextInOperation()

MlirRegion mlirRegionGetNextInOperation ( MlirRegion region)

Returns the region immediately following the given region in its parent operation.

Definition at line 710 of file IR.cpp.

References mlir::Operation::getNumRegions(), mlir::Region::getParentOp(), mlir::Operation::getRegion(), mlir::Region::getRegionNumber(), unwrap(), and wrap().

◆ mlirRegionInsertOwnedBlock()

void mlirRegionInsertOwnedBlock ( MlirRegion region,
intptr_t pos,
MlirBlock block )

Takes a block owned by the caller and inserts it at pos to the given region.

This is an expensive operation that linearly scans the region, prefer insertAfter/Before instead.

Definition at line 950 of file IR.cpp.

References unwrap(), and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirRegionInsertOwnedBlockAfter()

void mlirRegionInsertOwnedBlockAfter ( MlirRegion region,
MlirBlock reference,
MlirBlock block )

Takes a block owned by the caller and inserts it after the (non-owned) reference block in the given region.

The reference block must belong to the region. If the reference block is null, prepends the block to the region.

Definition at line 956 of file IR.cpp.

References mlir::Region::begin(), mlir::Region::getBlocks(), mlirBlockIsNull(), unwrap(), and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirRegionInsertOwnedBlockBefore()

void mlirRegionInsertOwnedBlockBefore ( MlirRegion region,
MlirBlock reference,
MlirBlock block )

Takes a block owned by the caller and inserts it before the (non-owned) reference block in the given region.

The reference block must belong to the region. If the reference block is null, appends the block to the region.

Definition at line 970 of file IR.cpp.

References mlirBlockIsNull(), mlirRegionAppendOwnedBlock(), and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirRegionTakeBody()

void mlirRegionTakeBody ( MlirRegion target,
MlirRegion source )

Moves the entire content of the source region to the target region.

Definition at line 985 of file IR.cpp.

References target, and unwrap().

◆ mlirSymbolTableCreate()

MlirSymbolTable mlirSymbolTableCreate ( MlirOperation operation)

Creates a symbol table for the given operation.

If the operation does not have the SymbolTable trait, returns a null symbol table.

Definition at line 1367 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::PySymbolTable().

◆ mlirSymbolTableDestroy()

void mlirSymbolTableDestroy ( MlirSymbolTable symbolTable)

Destroys the symbol table created with mlirSymbolTableCreate.

This does not affect the operations in the table.

Definition at line 1373 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::~PySymbolTable().

◆ mlirSymbolTableErase()

void mlirSymbolTableErase ( MlirSymbolTable symbolTable,
MlirOperation operation )

Removes the given operation from the symbol table and erases it.

Definition at line 1387 of file IR.cpp.

References unwrap().

◆ mlirSymbolTableGetSymbolAttributeName()

MlirStringRef mlirSymbolTableGetSymbolAttributeName ( void )

Returns the name of the attribute used to store symbol names compatible with symbol tables.

Definition at line 1359 of file IR.cpp.

References mlir::SymbolTable::getSymbolAttrName(), and wrap().

◆ mlirSymbolTableGetVisibilityAttributeName()

MlirStringRef mlirSymbolTableGetVisibilityAttributeName ( void )

Returns the name of the attribute used to store symbol visibility.

Definition at line 1363 of file IR.cpp.

References mlir::SymbolTable::getVisibilityAttrName(), and wrap().

◆ mlirSymbolTableInsert()

MlirAttribute mlirSymbolTableInsert ( MlirSymbolTable symbolTable,
MlirOperation operation )

Inserts the given operation into the given symbol table.

The operation must have the symbol trait. If the symbol table already has a symbol with the same name, renames the symbol being inserted to ensure name uniqueness. Note that this does not move the operation itself into the block of the symbol table operation, this should be done separately. Returns the name of the symbol after insertion.

Definition at line 1382 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PySymbolTable::getSymbolName().

◆ mlirSymbolTableLookup()

MlirOperation mlirSymbolTableLookup ( MlirSymbolTable symbolTable,
MlirStringRef name )

Looks up a symbol with the given name in the given symbol table and returns the operation that corresponds to the symbol.

If the symbol cannot be found, returns a null operation.

Definition at line 1377 of file IR.cpp.

References MlirStringRef::data, MlirStringRef::length, unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirSymbolTableReplaceAllSymbolUses()

MlirLogicalResult mlirSymbolTableReplaceAllSymbolUses ( MlirStringRef oldSymbol,
MlirStringRef newSymbol,
MlirOperation from )

Attempt to replace all uses that are nested within the given operation of the given symbol 'oldSymbol' with the provided 'newSymbol'.

This does not traverse into nested symbol tables. Will fail atomically if there are any unknown operations that may be potential symbol tables.

Definition at line 1392 of file IR.cpp.

References mlir::SymbolTable::replaceAllSymbolUses(), unwrap(), and wrap().

◆ mlirSymbolTableWalkSymbolTables()

void mlirSymbolTableWalkSymbolTables ( MlirOperation from,
bool allSymUsesVisible,
void(* callback )(MlirOperation, bool, void *userData),
void * userData )

Walks all symbol table operations nested within, and including, op.

For each symbol table operation, the provided callback is invoked with the op and a boolean signifying if the symbols within that symbol table can be treated as if all uses within the IR are visible to the caller. allSymUsesVisible identifies whether all of the symbol uses of symbols within op are visible.

Definition at line 1403 of file IR.cpp.

References unwrap(), mlir::SymbolTable::walkSymbolTables(), and wrap().

◆ mlirTypeDump()

void mlirTypeDump ( MlirType type)

Definition at line 1289 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirTypeEqual()

◆ mlirTypeGetContext()

◆ mlirTypeGetDialect()

MlirDialect mlirTypeGetDialect ( MlirType type)

Gets the dialect a type belongs to.

Definition at line 1276 of file IR.cpp.

References unwrap(), and wrap().

◆ mlirTypeGetTypeID()

MlirTypeID mlirTypeGetTypeID ( MlirType type)

Gets the type ID of the type.

Definition at line 1272 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirTypeParseGet()

MlirType mlirTypeParseGet ( MlirContext context,
MlirStringRef type )

Parses a type. The type is owned by the context.

Definition at line 1264 of file IR.cpp.

References mlir::parseType(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirTypePrint()

◆ mlirValueDump()

void mlirValueDump ( MlirValue value)

Definition at line 1178 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueEqual()

bool mlirValueEqual ( MlirValue value1,
MlirValue value2 )

Definition at line 1130 of file IR.cpp.

References unwrap().

◆ mlirValueGetContext()

MlirContext mlirValueGetContext ( MlirValue v)

Gets the context that a value was created with.

Definition at line 1225 of file IR.cpp.

References getContext(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueGetFirstUse()

MlirOpOperand mlirValueGetFirstUse ( MlirValue value)

Returns an op operand representing the first use of the value, or a null op operand if there are no uses.

Definition at line 1193 of file IR.cpp.

References mlir::ValueUseIterator< OperandType >::getOperand(), unwrap(), mlir::Value::use_begin(), mlir::Value::use_empty(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueGetLocation()

MlirLocation mlirValueGetLocation ( MlirValue v)

Gets the location of the value.

Definition at line 1221 of file IR.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueGetType()

MlirType mlirValueGetType ( MlirValue value)

Definition at line 1170 of file IR.cpp.

References mlir::getType(), unwrap(), and wrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueIsABlockArgument()

bool mlirValueIsABlockArgument ( MlirValue value)

Definition at line 1134 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueIsAOpResult()

bool mlirValueIsAOpResult ( MlirValue value)

Definition at line 1138 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValuePrint()

void mlirValuePrint ( MlirValue value,
MlirStringCallback callback,
void * userData )

Prints a block by sending chunks of the string representation and forwarding userData to callback`.

Note that the callback may be called / several times with consecutive chunks of the string. MLIR_CAPI_EXPORTED void mlirBlockPrint(MlirBlock block, MlirStringCallback callback, void *userData);

/ Returns the number of successor blocks of the block. MLIR_CAPI_EXPORTED intptr_t mlirBlockGetNumSuccessors(MlirBlock block);

/ Returns pos-th successor of the block. MLIR_CAPI_EXPORTED MlirBlock mlirBlockGetSuccessor(MlirBlock block, intptr_t pos);

/ Returns the number of predecessor blocks of the block. MLIR_CAPI_EXPORTED intptr_t mlirBlockGetNumPredecessors(MlirBlock block);

/ Returns pos-th predecessor of the block. / / WARNING: This getter is more expensive than the others here because / the impl actually iterates the use-def chain (of block operands) anew for / each indexed access. MLIR_CAPI_EXPORTED MlirBlock mlirBlockGetPredecessor(MlirBlock block, intptr_t pos);

===-------------------------------------------------------------------—===// Value API. ===-------------------------------------------------------------------—===//

/ Returns whether the value is null. static inline bool mlirValueIsNull(MlirValue value) { return !value.ptr; }

/ Returns 1 if two values are equal, 0 otherwise. MLIR_CAPI_EXPORTED bool mlirValueEqual(MlirValue value1, MlirValue value2);

/ Returns 1 if the value is a block argument, 0 otherwise. MLIR_CAPI_EXPORTED bool mlirValueIsABlockArgument(MlirValue value);

/ Returns 1 if the value is an operation result, 0 otherwise. MLIR_CAPI_EXPORTED bool mlirValueIsAOpResult(MlirValue value);

/ Returns the block in which this value is defined as an argument. Asserts if / the value is not a block argument. MLIR_CAPI_EXPORTED MlirBlock mlirBlockArgumentGetOwner(MlirValue value);

/ Returns the position of the value in the argument list of its block. MLIR_CAPI_EXPORTED intptr_t mlirBlockArgumentGetArgNumber(MlirValue value);

/ Sets the type of the block argument to the given type. MLIR_CAPI_EXPORTED void mlirBlockArgumentSetType(MlirValue value, MlirType type);

/ Sets the location of the block argument to the given location. MLIR_CAPI_EXPORTED void mlirBlockArgumentSetLocation(MlirValue value, MlirLocation loc);

/ Returns an operation that produced this value as its result. Asserts if the / value is not an op result. MLIR_CAPI_EXPORTED MlirOperation mlirOpResultGetOwner(MlirValue value);

/ Returns the position of the value in the list of results of the operation / that produced it. MLIR_CAPI_EXPORTED intptr_t mlirOpResultGetResultNumber(MlirValue value);

/ Returns the type of the value. MLIR_CAPI_EXPORTED MlirType mlirValueGetType(MlirValue value);

/ Set the type of the value. MLIR_CAPI_EXPORTED void mlirValueSetType(MlirValue value, MlirType type);

/ Prints the value to the standard error stream. MLIR_CAPI_EXPORTED void mlirValueDump(MlirValue value);

/ Prints a value by sending chunks of the string representation and / forwarding userData to callback`. Note that the callback may be called several times with consecutive chunks of the string.

Definition at line 1180 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConcreteValue< DerivedTy >::bind(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValuePrintAsOperand()

void mlirValuePrintAsOperand ( MlirValue value,
MlirAsmState state,
MlirStringCallback callback,
void * userData )

Prints a value as an operand (i.e., the ValueID).

Definition at line 1186 of file IR.cpp.

References mlir::Value::printAsOperand(), and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueReplaceAllUsesExcept()

void mlirValueReplaceAllUsesExcept ( MlirValue of,
MlirValue with,
intptr_t numExceptions,
MlirOperation * exceptions )

Replace all uses of 'of' value with 'with' value, updating anything in the IR that uses 'of' to use 'with' instead, except if the user is listed in 'exceptions'.

The 'exceptions' parameter is an array of MlirOperation pointers with a length of 'numExceptions'.

Definition at line 1207 of file IR.cpp.

References mlir::Value::replaceAllUsesExcept(), and unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueReplaceAllUsesOfWith()

void mlirValueReplaceAllUsesOfWith ( MlirValue of,
MlirValue with )

Replace all uses of 'of' value with the 'with' value, updating anything in the IR that uses 'of' to use the other value instead.

When this returns there are zero uses of 'of'.

Definition at line 1203 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ mlirValueSetType()

void mlirValueSetType ( MlirValue value,
MlirType type )

Definition at line 1174 of file IR.cpp.

References unwrap().

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore().

◆ toThreadingEnum()

MLIRContext::Threading toThreadingEnum ( bool threadingEnabled)
inlinestatic

◆ unwrap()

mlir::WalkResult unwrap ( MlirWalkResult result)
static

Definition at line 892 of file IR.cpp.

References mlir::WalkResult::advance(), mlir::WalkResult::interrupt(), MlirWalkResultAdvance, MlirWalkResultInterrupt, MlirWalkResultSkip, result, and mlir::WalkResult::skip().

Referenced by mlirAsmStateCreateForOperation(), mlirAsmStateCreateForValue(), mlirAsmStateDestroy(), mlirAttributeDump(), mlirAttributeEqual(), mlirAttributeGetContext(), mlirAttributeGetDialect(), mlirAttributeGetType(), mlirAttributeGetTypeID(), mlirAttributeParseGet(), mlirAttributePrint(), mlirBlockAddArgument(), mlirBlockAppendOwnedOperation(), mlirBlockArgumentGetArgNumber(), mlirBlockArgumentGetOwner(), mlirBlockArgumentSetLocation(), mlirBlockArgumentSetType(), mlirBlockCreate(), mlirBlockDestroy(), mlirBlockDetach(), mlirBlockEqual(), mlirBlockEraseArgument(), mlirBlockGetArgument(), mlirBlockGetFirstOperation(), mlirBlockGetNextInRegion(), mlirBlockGetNumArguments(), mlirBlockGetNumPredecessors(), mlirBlockGetNumSuccessors(), mlirBlockGetParentOperation(), mlirBlockGetParentRegion(), mlirBlockGetPredecessor(), mlirBlockGetSuccessor(), mlirBlockGetTerminator(), mlirBlockInsertArgument(), mlirBlockInsertOwnedOperation(), mlirBlockInsertOwnedOperationAfter(), mlirBlockInsertOwnedOperationBefore(), mlirBlockPrint(), mlirBytecodeWriterConfigDesiredEmitVersion(), mlirBytecodeWriterConfigDestroy(), mlirContextAppendDialectRegistry(), mlirContextCreateWithRegistry(), mlirContextDestroy(), mlirContextEnableMultithreading(), mlirContextEqual(), mlirContextGetAllowUnregisteredDialects(), mlirContextGetNumLoadedDialects(), mlirContextGetNumRegisteredDialects(), mlirContextGetNumThreads(), mlirContextGetOrLoadDialect(), mlirContextGetThreadPool(), mlirContextIsRegisteredOperation(), mlirContextLoadAllAvailableDialects(), mlirContextSetAllowUnregisteredDialects(), mlirContextSetThreadPool(), mlirDialectEqual(), mlirDialectGetContext(), mlirDialectGetNamespace(), mlirDialectRegistryDestroy(), mlirIdentifierEqual(), mlirIdentifierGet(), mlirIdentifierGetContext(), mlirIdentifierStr(), mlirIRMappingClear(), mlirIRMappingContainsBlock(), mlirIRMappingContainsOperation(), mlirIRMappingContainsValue(), mlirIRMappingDestroy(), mlirIRMappingEraseBlock(), mlirIRMappingEraseOperation(), mlirIRMappingEraseValue(), mlirIRMappingLookupOrDefaultBlock(), mlirIRMappingLookupOrDefaultOperation(), mlirIRMappingLookupOrDefaultValue(), mlirIRMappingLookupOrNullBlock(), mlirIRMappingLookupOrNullOperation(), mlirIRMappingLookupOrNullValue(), mlirIRMappingMapBlock(), mlirIRMappingMapOperation(), mlirIRMappingMapValue(), mlirLocationCallSiteGet(), mlirLocationCallSiteGetCallee(), mlirLocationCallSiteGetCaller(), mlirLocationEqual(), mlirLocationFileLineColGet(), mlirLocationFileLineColRangeGet(), mlirLocationFileLineColRangeGetEndColumn(), mlirLocationFileLineColRangeGetEndLine(), mlirLocationFileLineColRangeGetFilename(), mlirLocationFileLineColRangeGetStartColumn(), mlirLocationFileLineColRangeGetStartLine(), mlirLocationFromAttribute(), mlirLocationFusedGet(), mlirLocationFusedGetLocations(), mlirLocationFusedGetMetadata(), mlirLocationFusedGetNumLocations(), mlirLocationGetAttribute(), mlirLocationGetContext(), mlirLocationIsACallSite(), mlirLocationIsAFileLineColRange(), mlirLocationIsAFused(), mlirLocationIsAName(), mlirLocationIsAUnknown(), mlirLocationNameGet(), mlirLocationNameGetChildLoc(), mlirLocationNameGetName(), mlirLocationPrint(), mlirLocationUnknownGet(), mlirModuleCreateEmpty(), mlirModuleCreateParse(), mlirModuleCreateParseFromFile(), mlirModuleDestroy(), mlirModuleEqual(), mlirModuleFromOperation(), mlirModuleGetBody(), mlirModuleGetContext(), mlirModuleGetOperation(), mlirModuleHashValue(), mlirOperationClone(), mlirOperationCloneWithMapping(), mlirOperationCreate(), mlirOperationCreateParse(), mlirOperationDestroy(), mlirOperationDump(), mlirOperationEqual(), mlirOperationGetAttribute(), mlirOperationGetAttributeByName(), mlirOperationGetBlock(), mlirOperationGetContext(), mlirOperationGetDiscardableAttribute(), mlirOperationGetDiscardableAttributeByName(), mlirOperationGetFirstRegion(), mlirOperationGetInherentAttributeByName(), mlirOperationGetLocation(), mlirOperationGetName(), mlirOperationGetNextInBlock(), mlirOperationGetNumAttributes(), mlirOperationGetNumDiscardableAttributes(), mlirOperationGetNumOperands(), mlirOperationGetNumRegions(), mlirOperationGetNumResults(), mlirOperationGetNumSuccessors(), mlirOperationGetOperand(), mlirOperationGetOpOperand(), mlirOperationGetParentOperation(), mlirOperationGetRegion(), mlirOperationGetResult(), mlirOperationGetSuccessor(), mlirOperationGetTypeID(), mlirOperationHashValue(), mlirOperationHasInherentAttributeByName(), mlirOperationIsBeforeInBlock(), mlirOperationMoveAfter(), mlirOperationMoveBefore(), mlirOperationNameHasTrait(), mlirOperationPrint(), mlirOperationPrintWithFlags(), mlirOperationPrintWithState(), mlirOperationRemoveAttributeByName(), mlirOperationRemoveDiscardableAttributeByName(), mlirOperationRemoveFromParent(), mlirOperationReplaceUsesOfWith(), mlirOperationSetAttributeByName(), mlirOperationSetDiscardableAttributeByName(), mlirOperationSetInherentAttributeByName(), mlirOperationSetLocation(), mlirOperationSetOperand(), mlirOperationSetOperands(), mlirOperationSetSuccessor(), mlirOperationVerify(), mlirOperationWalk(), mlirOperationWriteBytecode(), mlirOperationWriteBytecodeWithConfig(), mlirOpOperandGetNextUse(), mlirOpOperandGetOperandNumber(), mlirOpOperandGetOwner(), mlirOpOperandGetValue(), mlirOpPrintingFlagsAssumeVerified(), mlirOpPrintingFlagsDestroy(), mlirOpPrintingFlagsElideLargeElementsAttrs(), mlirOpPrintingFlagsElideLargeResourceString(), mlirOpPrintingFlagsEnableDebugInfo(), mlirOpPrintingFlagsPrintGenericOpForm(), mlirOpPrintingFlagsPrintNameLocAsPrefix(), mlirOpPrintingFlagsSkipRegions(), mlirOpPrintingFlagsUseLocalScope(), mlirOpResultGetOwner(), mlirOpResultGetResultNumber(), mlirRegionAppendOwnedBlock(), mlirRegionEqual(), mlirRegionGetFirstBlock(), mlirRegionGetNextInOperation(), mlirRegionInsertOwnedBlock(), mlirRegionInsertOwnedBlockAfter(), mlirRegionInsertOwnedBlockBefore(), mlirRegionTakeBody(), mlirSymbolTableCreate(), mlirSymbolTableDestroy(), mlirSymbolTableErase(), mlirSymbolTableInsert(), mlirSymbolTableLookup(), mlirSymbolTableReplaceAllSymbolUses(), mlirSymbolTableWalkSymbolTables(), mlirTypeDump(), mlirTypeEqual(), mlirTypeGetContext(), mlirTypeGetDialect(), mlirTypeGetTypeID(), mlirTypeParseGet(), mlirTypePrint(), mlirValueDump(), mlirValueEqual(), mlirValueGetContext(), mlirValueGetFirstUse(), mlirValueGetLocation(), mlirValueGetType(), mlirValueIsABlockArgument(), mlirValueIsAOpResult(), mlirValuePrint(), mlirValuePrintAsOperand(), mlirValueReplaceAllUsesExcept(), mlirValueReplaceAllUsesOfWith(), and mlirValueSetType().