Lines Matching refs:operation
69 name: Operation name (e.g. "dialect.operation").
198 PyRegionIterator(PyOperationRef operation) in PyRegionIterator() argument
199 : operation(std::move(operation)) {} in PyRegionIterator()
204 operation->checkValid(); in dunderNext()
205 if (nextIndex >= mlirOperationGetNumRegions(operation->get())) { in dunderNext()
208 MlirRegion region = mlirOperationGetRegion(operation->get(), nextIndex++); in dunderNext()
209 return PyRegion(operation, region); in dunderNext()
219 PyOperationRef operation; member in __anon7f4419ab0111::PyRegionIterator
227 PyRegionList(PyOperationRef operation) : operation(std::move(operation)) {} in PyRegionList() argument
230 operation->checkValid(); in dunderLen()
231 return mlirOperationGetNumRegions(operation->get()); in dunderLen()
240 MlirRegion region = mlirOperationGetRegion(operation->get(), index); in dunderGetItem()
241 return PyRegion(operation, region); in dunderGetItem()
251 PyOperationRef operation; member in __anon7f4419ab0111::PyRegionList
256 PyBlockIterator(PyOperationRef operation, MlirBlock next) in PyBlockIterator() argument
257 : operation(std::move(operation)), next(next) {} in PyBlockIterator()
262 operation->checkValid(); in dunderNext()
267 PyBlock returnBlock(operation, next); in dunderNext()
279 PyOperationRef operation; member in __anon7f4419ab0111::PyBlockIterator
288 PyBlockList(PyOperationRef operation, MlirRegion region) in PyBlockList() argument
289 : operation(std::move(operation)), region(region) {} in PyBlockList()
292 operation->checkValid(); in dunderIter()
293 return PyBlockIterator(operation, mlirRegionGetFirstBlock(region)); in dunderIter()
297 operation->checkValid(); in dunderLen()
308 operation->checkValid(); in dunderGetItem()
316 return PyBlock(operation, block); in dunderGetItem()
325 operation->checkValid(); in appendBlock()
340 return PyBlock(operation, block); in appendBlock()
352 PyOperationRef operation; member in __anon7f4419ab0111::PyBlockList
916 PyOperation::PyOperation(PyMlirContextRef contextRef, MlirOperation operation) in PyOperation() argument
917 : BaseContextObject(std::move(contextRef)), operation(operation) {} in PyOperation()
924 assert(liveOperations.count(operation.ptr) == 1 && in ~PyOperation()
926 liveOperations.erase(operation.ptr); in ~PyOperation()
928 mlirOperationDestroy(operation); in ~PyOperation()
933 MlirOperation operation, in createInstance() argument
938 new PyOperation(std::move(contextRef), operation); in createInstance()
948 liveOperations[operation.ptr] = std::make_pair(pyRef, unownedOperation); in createInstance()
953 MlirOperation operation, in forOperation() argument
956 auto it = liveOperations.find(operation.ptr); in forOperation()
959 return createInstance(std::move(contextRef), operation, in forOperation()
969 MlirOperation operation, in createDetached() argument
972 assert(liveOperations.count(operation.ptr) == 0 && in createDetached()
976 PyOperationRef created = createInstance(std::move(contextRef), operation, in createDetached()
993 PyOperation &operation = getOperation(); in print() local
994 operation.checkValid(); in print()
999 !mlirOperationVerify(operation)) { in print()
1020 mlirOperationPrintWithFlags(operation, flags, accum.getCallback(), in print()
1048 PyOperation &operation = getOperation(); in moveAfter() local
1050 operation.checkValid(); in moveAfter()
1052 mlirOperationMoveAfter(operation, otherOp); in moveAfter()
1053 operation.parentKeepAlive = otherOp.parentKeepAlive; in moveAfter()
1057 PyOperation &operation = getOperation(); in moveBefore() local
1059 operation.checkValid(); in moveBefore()
1061 mlirOperationMoveBefore(operation, otherOp); in moveBefore()
1062 operation.parentKeepAlive = otherOp.parentKeepAlive; in moveBefore()
1069 MlirOperation operation = mlirOperationGetParentOperation(get()); in getParentOperation() local
1070 if (mlirOperationIsNull(operation)) in getParentOperation()
1072 return PyOperation::forOperation(getContext(), operation); in getParentOperation()
1227 MlirOperation operation = mlirOperationCreate(&state); in create() local
1229 PyOperation::createDetached(location->getContext(), operation); in create()
1236 MlirOperation clonedOperation = mlirOperationClone(operation); in clone()
1261 if (liveOperations.count(operation.ptr)) in erase()
1262 liveOperations.erase(operation.ptr); in erase()
1263 mlirOperationDestroy(operation); in erase()
1531 : operation(py::cast<PyOperationBase &>(operationObject).getOperation()), in PyOpView()
1532 operationObject(operation.getRef().getObject()) {} in PyOpView()
1580 PyOperation &operation = operationBase.getOperation(); in insert() local
1581 if (operation.isAttached()) in insert()
1601 mlirBlockInsertOwnedOperationBefore(block.get(), beforeOp, operation); in insert()
1602 operation.setAttached(); in insert()
1718 PySymbolTable::PySymbolTable(PyOperationBase &operation) in PySymbolTable() argument
1719 : operation(operation.getOperation().getRef()) { in PySymbolTable()
1720 symbolTable = mlirSymbolTableCreate(operation.getOperation().get()); in PySymbolTable()
1727 operation->checkValid(); in dunderGetItem()
1733 return PyOperation::forOperation(operation->getContext(), symbol, in dunderGetItem()
1734 operation.getObject()) in dunderGetItem()
1739 operation->checkValid(); in erase()
1749 py::object operation = dunderGetItem(name); in dunderDel() local
1750 erase(py::cast<PyOperationBase &>(operation)); in dunderDel()
1754 operation->checkValid(); in insert()
1767 PyOperation &operation = symbol.getOperation(); in getSymbolName() local
1768 operation.checkValid(); in getSymbolName()
1771 mlirOperationGetAttributeByName(operation.get(), attrName); in getSymbolName()
1780 PyOperation &operation = symbol.getOperation(); in setSymbolName() local
1781 operation.checkValid(); in setSymbolName()
1784 mlirOperationGetAttributeByName(operation.get(), attrName); in setSymbolName()
1788 mlirStringAttrGet(operation.getContext()->get(), toMlirStringRef(name)); in setSymbolName()
1789 mlirOperationSetAttributeByName(operation.get(), attrName, newNameAttr); in setSymbolName()
1793 PyOperation &operation = symbol.getOperation(); in getVisibility() local
1794 operation.checkValid(); in getVisibility()
1797 mlirOperationGetAttributeByName(operation.get(), attrName); in getVisibility()
1809 PyOperation &operation = symbol.getOperation(); in setVisibility() local
1810 operation.checkValid(); in setVisibility()
1813 mlirOperationGetAttributeByName(operation.get(), attrName); in setVisibility()
1816 MlirAttribute newVisAttr = mlirStringAttrGet(operation.getContext()->get(), in setVisibility()
1818 mlirOperationSetAttributeByName(operation.get(), attrName, newVisAttr); in setVisibility()
1987 PyBlockArgumentList(PyOperationRef operation, MlirBlock block, in PyBlockArgumentList() argument
1993 operation(std::move(operation)), block(block) {} in PyBlockArgumentList()
1997 return getValueTypes(self, self.operation->getContext()); in bindDerived()
2007 operation->checkValid(); in getRawNumElements()
2014 return PyBlockArgument(operation, argument); in getRawElement()
2020 return PyBlockArgumentList(operation, block, startIndex, length, step); in slice()
2023 PyOperationRef operation; member in __anon7f4419ab0511::PyBlockArgumentList
2035 PyOpOperandList(PyOperationRef operation, intptr_t startIndex = 0, in PyOpOperandList() argument
2038 length == -1 ? mlirOperationGetNumOperands(operation->get()) in PyOpOperandList()
2041 operation(operation) {} in PyOpOperandList()
2045 mlirOperationSetOperand(operation->get(), index, value.get()); in dunderSetItem()
2057 operation->checkValid(); in getRawNumElements()
2058 return mlirOperationGetNumOperands(operation->get()); in getRawNumElements()
2062 MlirValue operand = mlirOperationGetOperand(operation->get(), pos); in getRawElement()
2071 PyOperation::forOperation(operation->getContext(), owner); in getRawElement()
2076 return PyOpOperandList(operation, startIndex, length, step); in slice()
2079 PyOperationRef operation; member in __anon7f4419ab0511::PyOpOperandList
2090 PyOpResultList(PyOperationRef operation, intptr_t startIndex = 0, in PyOpResultList() argument
2093 length == -1 ? mlirOperationGetNumResults(operation->get()) in PyOpResultList()
2096 operation(operation) {} in PyOpResultList()
2100 return getValueTypes(self, self.operation->getContext()); in bindDerived()
2109 operation->checkValid(); in getRawNumElements()
2110 return mlirOperationGetNumResults(operation->get()); in getRawNumElements()
2114 PyValue value(operation, mlirOperationGetResult(operation->get(), index)); in getRawElement()
2119 return PyOpResultList(operation, startIndex, length, step); in slice()
2122 PyOperationRef operation; member in __anon7f4419ab0511::PyOpResultList
2129 PyOpAttributeMap(PyOperationRef operation) in PyOpAttributeMap() argument
2130 : operation(std::move(operation)) {} in PyOpAttributeMap()
2133 MlirAttribute attr = mlirOperationGetAttributeByName(operation->get(), in dunderGetItemNamed()
2139 return PyAttribute(operation->getContext(), attr); in dunderGetItemNamed()
2148 mlirOperationGetAttribute(operation->get(), index); in dunderGetItemIndexed()
2156 mlirOperationSetAttributeByName(operation->get(), toMlirStringRef(name), in dunderSetItem()
2161 int removed = mlirOperationRemoveAttributeByName(operation->get(), in dunderDelItem()
2169 return mlirOperationGetNumAttributes(operation->get()); in dunderLen()
2174 operation->get(), toMlirStringRef(name))); in dunderContains()
2188 PyOperationRef operation; member in __anon7f4419ab0511::PyOpAttributeMap
2585 auto &operation = self.getOperation(); in populateIRCore() local
2586 auto numResults = mlirOperationGetNumResults(operation); in populateIRCore()
2588 auto name = mlirIdentifierStr(mlirOperationGetName(operation)); in populateIRCore()
2597 return PyOpResult(operation.getRef(), in populateIRCore()
2598 mlirOperationGetResult(operation, 0)); in populateIRCore()
2605 PyOperation &operation = self.getOperation(); in populateIRCore() local
2606 return PyLocation(operation.getContext(), in populateIRCore()
2607 mlirOperationGetLocation(operation.get())); in populateIRCore()
2657 PyOperation &operation = self.getOperation(); in populateIRCore() local
2658 operation.checkValid(); in populateIRCore()
2659 if (!operation.isAttached()) in populateIRCore()
2662 operation.detachFromParent(); in populateIRCore()
2663 return operation.createOpView(); in populateIRCore()
2690 MlirOperation operation = self.get(); in populateIRCore() local
2692 mlirOperationGetName(operation)); in populateIRCore()
2891 [](PyBlock &self, PyOperationBase &operation) { in populateIRCore() argument
2892 if (operation.getOperation().isAttached()) in populateIRCore()
2893 operation.getOperation().detachFromParent(); in populateIRCore()
2895 MlirOperation mlirOperation = operation.getOperation().get(); in populateIRCore()
2897 operation.getOperation().setAttached( in populateIRCore()