MLIR 23.0.0git
IRCore.cpp File Reference
#include "mlir/Bindings/Python/Globals.h"
#include "mlir/Bindings/Python/IRCore.h"
#include "mlir/Bindings/Python/NanobindUtils.h"
#include "mlir-c/Bindings/Python/Interop.h"
#include "mlir-c/BuiltinAttributes.h"
#include "mlir-c/Debug.h"
#include "mlir-c/Diagnostics.h"
#include "mlir-c/ExtensibleDialect.h"
#include "mlir-c/IR.h"
#include "mlir-c/Support.h"
#include <array>
#include <functional>
#include <optional>
#include <string>

Go to the source code of this file.

Classes

class  mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyOpOperands
 A list of OpOperands. More...

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::python
namespace  mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN

Macros

#define _Py_CAST(type, expr)
#define _Py_NULL   NULL
#define Py_XNewRef(obj)
#define Py_NewRef(obj)

Functions

template<typename T>
static size_t hash (const T &value)
 Local helper to compute std::hash for a value.
static nb::object createCustomDialectWrapper (const std::string &dialectNamespace, nb::object dialectDescriptor)
MlirBlock mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::createBlock (const nb::sequence &pyArgTypes, const std::optional< nb::sequence > &pyArgLocs)
static void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::maybeInsertOperation (PyOperationRef &op, const nb::object &maybeIp)
template<typename Container>
static std::vector< nb::typed< nb::object, PyType > > mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getValueTypes (Container &container, PyMlirContextRef &context)
 Returns the list of types of the values held by container.
static void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateResultTypes (std::string_view name, nb::list resultTypeList, const nb::object &resultSegmentSpecObj, std::vector< int32_t > &resultSegmentLengths, std::vector< PyType * > &resultTypes)
MLIR_PYTHON_API_EXPORTED MlirValue mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getUniqueResult (MlirOperation operation)
static MlirValue mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getOpResultOrValue (nb::handle operand)
static PyOperationRef mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::getValueOwnerRef (MlirValue value)
static MlirLogicalResult mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::verifyTraitByMethod (MlirOperation op, void *userData, const char *methodName)
static bool mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::attachOpTrait (const nb::object &opName, MlirDynamicOpTrait trait, PyMlirContext &context)
void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateRoot (nb::module_ &m)
void mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::populateIRCore (nb::module_ &m)
template<typename... Ts>
std::string join (const Ts &...args)
 Helper function to concatenate arguments into a std::string.

Variables

static const char kModuleParseDocstring []
static const char kDumpDocstring []
static const char kValueReplaceAllUsesExceptDocstring []

Macro Definition Documentation

◆ _Py_CAST

#define _Py_CAST ( type,
expr )
Value:
((type)(expr))

Definition at line 2679 of file IRCore.cpp.

◆ _Py_NULL

#define _Py_NULL   NULL

Definition at line 2690 of file IRCore.cpp.

◆ Py_NewRef

#define Py_NewRef ( obj)
Value:
_Py_NewRef(_PyObject_CAST(obj))

Definition at line 2712 of file IRCore.cpp.

◆ Py_XNewRef

#define Py_XNewRef ( obj)
Value:
_Py_XNewRef(_PyObject_CAST(obj))

Definition at line 2703 of file IRCore.cpp.

Function Documentation

◆ createCustomDialectWrapper()

nb::object createCustomDialectWrapper ( const std::string & dialectNamespace,
nb::object dialectDescriptor )
static

◆ hash()

◆ join()

template<typename... Ts>
std::string nanobind::detail::join ( const Ts &... args)
inline

Variable Documentation

◆ kDumpDocstring

const char kDumpDocstring[]
static
Initial value:
=
"Dumps a debug representation of the object to stderr."

Definition at line 40 of file IRCore.cpp.

◆ kModuleParseDocstring

const char kModuleParseDocstring[]
static
Initial value:
=
R"(Parses a module's assembly format from a string.
Returns a new MlirModule or raises an MLIRError if the parsing fails.
See also: https://mlir.llvm.org/docs/LangRef/
)"

Definition at line 32 of file IRCore.cpp.

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

◆ kValueReplaceAllUsesExceptDocstring

const char kValueReplaceAllUsesExceptDocstring[]
static
Initial value:
=
R"(Replace all uses of this value with the `with` value, except for those
in `exceptions`. `exceptions` can be either a single operation or a list of
operations.
)"

Definition at line 43 of file IRCore.cpp.

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