@@ -281,8 +281,9 @@ class PyInferTypeOpInterface
281
281
std::optional<std::vector<PyRegion>> regions,
282
282
DefaultingPyMlirContext context,
283
283
DefaultingPyLocation location) {
284
- llvm::SmallVector<MlirValue> mlirOperands = wrapOperands (operandList);
285
- llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions (regions);
284
+ llvm::SmallVector<MlirValue> mlirOperands =
285
+ wrapOperands (std::move (operandList));
286
+ llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions (std::move (regions));
286
287
287
288
std::vector<PyType> inferredTypes;
288
289
PyMlirContext &pyContext = context.resolve ();
@@ -319,10 +320,10 @@ class PyShapedTypeComponents {
319
320
public:
320
321
PyShapedTypeComponents (MlirType elementType) : elementType(elementType) {}
321
322
PyShapedTypeComponents (py::list shape, MlirType elementType)
322
- : shape(shape), elementType(elementType), ranked(true ) {}
323
+ : shape(std::move( shape) ), elementType(elementType), ranked(true ) {}
323
324
PyShapedTypeComponents (py::list shape, MlirType elementType,
324
325
MlirAttribute attribute)
325
- : shape(shape), elementType(elementType), attribute(attribute),
326
+ : shape(std::move( shape) ), elementType(elementType), attribute(attribute),
326
327
ranked (true ) {}
327
328
PyShapedTypeComponents (PyShapedTypeComponents &) = delete;
328
329
PyShapedTypeComponents (PyShapedTypeComponents &&other)
@@ -347,14 +348,15 @@ class PyShapedTypeComponents {
347
348
.def_static (
348
349
" get" ,
349
350
[](py::list shape, PyType &elementType) {
350
- return PyShapedTypeComponents (shape, elementType);
351
+ return PyShapedTypeComponents (std::move ( shape) , elementType);
351
352
},
352
353
py::arg (" shape" ), py::arg (" element_type" ),
353
354
" Create a ranked shaped type components object." )
354
355
.def_static (
355
356
" get" ,
356
357
[](py::list shape, PyType &elementType, PyAttribute &attribute) {
357
- return PyShapedTypeComponents (shape, elementType, attribute);
358
+ return PyShapedTypeComponents (std::move (shape), elementType,
359
+ attribute);
358
360
},
359
361
py::arg (" shape" ), py::arg (" element_type" ), py::arg (" attribute" ),
360
362
" Create a ranked shaped type components object with attribute." )
@@ -438,8 +440,9 @@ class PyInferShapedTypeOpInterface
438
440
std::optional<PyAttribute> attributes, void *properties,
439
441
std::optional<std::vector<PyRegion>> regions,
440
442
DefaultingPyMlirContext context, DefaultingPyLocation location) {
441
- llvm::SmallVector<MlirValue> mlirOperands = wrapOperands (operandList);
442
- llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions (regions);
443
+ llvm::SmallVector<MlirValue> mlirOperands =
444
+ wrapOperands (std::move (operandList));
445
+ llvm::SmallVector<MlirRegion> mlirRegions = wrapRegions (std::move (regions));
443
446
444
447
std::vector<PyShapedTypeComponents> inferredShapedTypeComponents;
445
448
PyMlirContext &pyContext = context.resolve ();
0 commit comments