Loading mlir/lib/Bindings/Python/IRInterfaces.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -281,8 +281,9 @@ public: std::optional<std::vector<PyRegion>> regions, DefaultingPyMlirContext context, DefaultingPyLocation location) { llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions); llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(std::move(operandList)); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions)); std::vector<PyType> inferredTypes; PyMlirContext &pyContext = context.resolve(); Loading Loading @@ -319,10 +320,10 @@ class PyShapedTypeComponents { public: PyShapedTypeComponents(MlirType elementType) : elementType(elementType) {} PyShapedTypeComponents(py::list shape, MlirType elementType) : shape(shape), elementType(elementType), ranked(true) {} : shape(std::move(shape)), elementType(elementType), ranked(true) {} PyShapedTypeComponents(py::list shape, MlirType elementType, MlirAttribute attribute) : shape(shape), elementType(elementType), attribute(attribute), : shape(std::move(shape)), elementType(elementType), attribute(attribute), ranked(true) {} PyShapedTypeComponents(PyShapedTypeComponents &) = delete; PyShapedTypeComponents(PyShapedTypeComponents &&other) Loading @@ -347,14 +348,15 @@ public: .def_static( "get", [](py::list shape, PyType &elementType) { return PyShapedTypeComponents(shape, elementType); return PyShapedTypeComponents(std::move(shape), elementType); }, py::arg("shape"), py::arg("element_type"), "Create a ranked shaped type components object.") .def_static( "get", [](py::list shape, PyType &elementType, PyAttribute &attribute) { return PyShapedTypeComponents(shape, elementType, attribute); return PyShapedTypeComponents(std::move(shape), elementType, attribute); }, py::arg("shape"), py::arg("element_type"), py::arg("attribute"), "Create a ranked shaped type components object with attribute.") Loading Loading @@ -438,8 +440,9 @@ public: std::optional<PyAttribute> attributes, void *properties, std::optional<std::vector<PyRegion>> regions, DefaultingPyMlirContext context, DefaultingPyLocation location) { llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions); llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(std::move(operandList)); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions)); std::vector<PyShapedTypeComponents> inferredShapedTypeComponents; PyMlirContext &pyContext = context.resolve(); Loading Loading
mlir/lib/Bindings/Python/IRInterfaces.cpp +11 −8 Original line number Diff line number Diff line Loading @@ -281,8 +281,9 @@ public: std::optional<std::vector<PyRegion>> regions, DefaultingPyMlirContext context, DefaultingPyLocation location) { llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions); llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(std::move(operandList)); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions)); std::vector<PyType> inferredTypes; PyMlirContext &pyContext = context.resolve(); Loading Loading @@ -319,10 +320,10 @@ class PyShapedTypeComponents { public: PyShapedTypeComponents(MlirType elementType) : elementType(elementType) {} PyShapedTypeComponents(py::list shape, MlirType elementType) : shape(shape), elementType(elementType), ranked(true) {} : shape(std::move(shape)), elementType(elementType), ranked(true) {} PyShapedTypeComponents(py::list shape, MlirType elementType, MlirAttribute attribute) : shape(shape), elementType(elementType), attribute(attribute), : shape(std::move(shape)), elementType(elementType), attribute(attribute), ranked(true) {} PyShapedTypeComponents(PyShapedTypeComponents &) = delete; PyShapedTypeComponents(PyShapedTypeComponents &&other) Loading @@ -347,14 +348,15 @@ public: .def_static( "get", [](py::list shape, PyType &elementType) { return PyShapedTypeComponents(shape, elementType); return PyShapedTypeComponents(std::move(shape), elementType); }, py::arg("shape"), py::arg("element_type"), "Create a ranked shaped type components object.") .def_static( "get", [](py::list shape, PyType &elementType, PyAttribute &attribute) { return PyShapedTypeComponents(shape, elementType, attribute); return PyShapedTypeComponents(std::move(shape), elementType, attribute); }, py::arg("shape"), py::arg("element_type"), py::arg("attribute"), "Create a ranked shaped type components object with attribute.") Loading Loading @@ -438,8 +440,9 @@ public: std::optional<PyAttribute> attributes, void *properties, std::optional<std::vector<PyRegion>> regions, DefaultingPyMlirContext context, DefaultingPyLocation location) { llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(operandList); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(regions); llvm::SmallVector<MlirValue> mlirOperands = wrapOperands(std::move(operandList)); llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions(std::move(regions)); std::vector<PyShapedTypeComponents> inferredShapedTypeComponents; PyMlirContext &pyContext = context.resolve(); Loading