|
MLIR
22.0.0git
|
#include "Globals.h"#include "IRModule.h"#include "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/IR.h"#include "mlir-c/Support.h"#include "mlir/Bindings/Python/Nanobind.h"#include "mlir/Bindings/Python/NanobindAdaptors.h"#include "nanobind/nanobind.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/SmallVector.h"#include <optional>Go to the source code of this file.
Classes | |
| struct | PyGlobalDebugFlag |
| Wrapper for the global LLVM debugging flag. More... | |
| struct | PyAttrBuilderMap |
| class | PyOpResult |
| Python wrapper for MlirOpResult. More... | |
| class | PyOpResultList |
| A list of operation results. More... | |
Macros | |
| #define | _Py_CAST(type, expr) ((type)(expr)) |
| #define | _Py_NULL NULL |
| #define | Py_XNewRef(obj) _Py_XNewRef(_PyObject_CAST(obj)) |
| #define | Py_NewRef(obj) _Py_NewRef(_PyObject_CAST(obj)) |
Functions | |
| template<class Func , typename... Args> | |
| static nb::object | classmethod (Func f, Args... args) |
| Helper for creating an @classmethod. More... | |
| static nb::object | createCustomDialectWrapper (const std::string &dialectNamespace, nb::object dialectDescriptor) |
| static MlirStringRef | toMlirStringRef (const std::string &s) |
| static MlirStringRef | toMlirStringRef (std::string_view s) |
| static MlirStringRef | toMlirStringRef (const nb::bytes &s) |
| static MlirBlock | createBlock (const nb::sequence &pyArgTypes, const std::optional< nb::sequence > &pyArgLocs) |
| Create a block, using the current location context if no locations are specified. More... | |
| static void | maybeInsertOperation (PyOperationRef &op, const nb::object &maybeIp) |
| template<typename Container > | |
| static std::vector< nb::typed< nb::object, PyType > > | getValueTypes (Container &container, PyMlirContextRef &context) |
| Returns the list of types of the values held by container. More... | |
| static void | populateResultTypes (StringRef name, nb::list resultTypeList, const nb::object &resultSegmentSpecObj, std::vector< int32_t > &resultSegmentLengths, std::vector< PyType * > &resultTypes) |
| static MlirValue | getUniqueResult (MlirOperation operation) |
| static MlirValue | getOpResultOrValue (nb::handle operand) |
Variables | |
| static const char | kContextParseTypeDocstring [] |
| static const char | kContextGetCallSiteLocationDocstring [] |
| static const char | kContextGetFileLocationDocstring [] |
| static const char | kContextGetFileRangeDocstring [] |
| static const char | kContextGetFusedLocationDocstring [] |
| static const char | kContextGetNameLocationDocString [] |
| static const char | kModuleParseDocstring [] |
| static const char | kModuleCAPICreate [] |
| static const char | kOperationCreateDocstring [] |
| static const char | kOperationPrintDocstring [] |
| static const char | kOperationPrintStateDocstring [] |
| static const char | kOperationGetAsmDocstring [] |
| static const char | kOperationPrintBytecodeDocstring [] |
| static const char | kOperationStrDunderDocstring [] |
| static const char | kDumpDocstring [] |
| static const char | kAppendBlockDocstring [] |
| static const char | kValueDunderStrDocstring [] |
| static const char | kGetNameAsOperand [] |
| static const char | kValueReplaceAllUsesWithDocstring [] |
| static const char | kValueReplaceAllUsesExceptDocstring [] |
| #define _Py_CAST | ( | type, | |
| expr | |||
| ) | ((type)(expr)) |
Definition at line 2805 of file IRCore.cpp.
| #define _Py_NULL NULL |
Definition at line 2816 of file IRCore.cpp.
| #define Py_NewRef | ( | obj | ) | _Py_NewRef(_PyObject_CAST(obj)) |
Definition at line 2838 of file IRCore.cpp.
| #define Py_XNewRef | ( | obj | ) | _Py_XNewRef(_PyObject_CAST(obj)) |
Definition at line 2829 of file IRCore.cpp.
|
static |
Helper for creating an @classmethod.
Definition at line 205 of file IRCore.cpp.
|
static |
Create a block, using the current location context if no locations are specified.
Definition at line 237 of file IRCore.cpp.
References mlirBlockCreate().
Referenced by mlirRewriterBaseCreateBlockBefore().
|
static |
Definition at line 211 of file IRCore.cpp.
References mlir::get().
|
static |
Definition at line 1822 of file IRCore.cpp.
References mlir::python::PyValue::get(), mlir::python::PyOperation::get(), PyOpResultList::getOperation(), mlir::python::PyOperationBase::getOperation(), and getUniqueResult().
Referenced by mlir::python::PyOpView::buildGeneric().
|
static |
Definition at line 1807 of file IRCore.cpp.
References mlirIdentifierStr(), mlirOperationGetName(), mlirOperationGetNumResults(), and mlirOperationGetResult().
Referenced by getOpResultOrValue().
|
static |
Returns the list of types of the values held by container.
Definition at line 1645 of file IRCore.cpp.
References mlir::python::PyMlirContext::getRef(), mlir::python::PyType::maybeDownCast(), and mlirValueGetType().
Referenced by PyOpResultList::bindDerived().
|
static |
Definition at line 1407 of file IRCore.cpp.
References mlir::python::PyObjectRef< T >::get(), mlir::python::PyThreadContextEntry::getDefaultInsertionPoint(), and mlir::python::PyInsertionPoint::insert().
Referenced by mlir::python::PyOperation::clone().
|
static |
Definition at line 1710 of file IRCore.cpp.
References mlir::detail::enumerate().
Referenced by mlir::python::PyOpView::buildGeneric().
|
static |
Definition at line 231 of file IRCore.cpp.
References mlirStringRefCreate().
|
static |
Definition at line 223 of file IRCore.cpp.
References mlirStringRefCreate().
Referenced by mlir::python::PyStringAttribute::bindDerived(), mlir::python::PyOperation::parse(), mlir::python::PyNamedAttribute::PyNamedAttribute(), mlir::python::PySymbolTable::replaceAllSymbolUses(), mlir::python::PySymbolTable::setSymbolName(), and mlir::python::PySymbolTable::setVisibility().
|
static |
Definition at line 227 of file IRCore.cpp.
References mlirStringRefCreate().
|
static |
Definition at line 169 of file IRCore.cpp.
|
static |
Definition at line 47 of file IRCore.cpp.
|
static |
Definition at line 50 of file IRCore.cpp.
|
static |
Definition at line 53 of file IRCore.cpp.
|
static |
Definition at line 56 of file IRCore.cpp.
|
static |
Definition at line 59 of file IRCore.cpp.
|
static |
Definition at line 39 of file IRCore.cpp.
|
static |
Definition at line 166 of file IRCore.cpp.
|
static |
Definition at line 184 of file IRCore.cpp.
|
static |
Definition at line 70 of file IRCore.cpp.
|
static |
Definition at line 62 of file IRCore.cpp.
|
static |
Definition at line 76 of file IRCore.cpp.
|
static |
Definition at line 135 of file IRCore.cpp.
|
static |
Definition at line 148 of file IRCore.cpp.
|
static |
Definition at line 95 of file IRCore.cpp.
|
static |
Definition at line 126 of file IRCore.cpp.
|
static |
Definition at line 158 of file IRCore.cpp.
|
static |
Definition at line 176 of file IRCore.cpp.
|
static |
Definition at line 193 of file IRCore.cpp.
|
static |
Definition at line 188 of file IRCore.cpp.