@@ -64,7 +64,7 @@ static void pyListToVector(const nb::list &list,
64
64
}
65
65
66
66
template <typename PermutationTy>
67
- static bool isPermutation (std::vector<PermutationTy> permutation) {
67
+ static bool isPermutation (const std::vector<PermutationTy> & permutation) {
68
68
llvm::SmallVector<bool , 8 > seen (permutation.size (), false );
69
69
for (auto val : permutation) {
70
70
if (val < permutation.size ()) {
@@ -366,7 +366,7 @@ nb::object PyAffineExpr::getCapsule() {
366
366
return nb::steal<nb::object>(mlirPythonAffineExprToCapsule (*this ));
367
367
}
368
368
369
- PyAffineExpr PyAffineExpr::createFromCapsule (nb::object capsule) {
369
+ PyAffineExpr PyAffineExpr::createFromCapsule (const nb::object & capsule) {
370
370
MlirAffineExpr rawAffineExpr = mlirPythonCapsuleToAffineExpr (capsule.ptr ());
371
371
if (mlirAffineExprIsNull (rawAffineExpr))
372
372
throw nb::python_error ();
@@ -424,7 +424,7 @@ nb::object PyAffineMap::getCapsule() {
424
424
return nb::steal<nb::object>(mlirPythonAffineMapToCapsule (*this ));
425
425
}
426
426
427
- PyAffineMap PyAffineMap::createFromCapsule (nb::object capsule) {
427
+ PyAffineMap PyAffineMap::createFromCapsule (const nb::object & capsule) {
428
428
MlirAffineMap rawAffineMap = mlirPythonCapsuleToAffineMap (capsule.ptr ());
429
429
if (mlirAffineMapIsNull (rawAffineMap))
430
430
throw nb::python_error ();
@@ -500,7 +500,7 @@ nb::object PyIntegerSet::getCapsule() {
500
500
return nb::steal<nb::object>(mlirPythonIntegerSetToCapsule (*this ));
501
501
}
502
502
503
- PyIntegerSet PyIntegerSet::createFromCapsule (nb::object capsule) {
503
+ PyIntegerSet PyIntegerSet::createFromCapsule (const nb::object & capsule) {
504
504
MlirIntegerSet rawIntegerSet = mlirPythonCapsuleToIntegerSet (capsule.ptr ());
505
505
if (mlirIntegerSetIsNull (rawIntegerSet))
506
506
throw nb::python_error ();
@@ -708,7 +708,8 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
708
708
return static_cast <size_t >(llvm::hash_value (self.get ().ptr ));
709
709
})
710
710
.def_static (" compress_unused_symbols" ,
711
- [](nb::list affineMaps, DefaultingPyMlirContext context) {
711
+ [](const nb::list &affineMaps,
712
+ DefaultingPyMlirContext context) {
712
713
SmallVector<MlirAffineMap> maps;
713
714
pyListToVector<PyAffineMap, MlirAffineMap>(
714
715
affineMaps, maps, " attempting to create an AffineMap" );
@@ -734,7 +735,7 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
734
735
kDumpDocstring )
735
736
.def_static (
736
737
" get" ,
737
- [](intptr_t dimCount, intptr_t symbolCount, nb::list exprs,
738
+ [](intptr_t dimCount, intptr_t symbolCount, const nb::list & exprs,
738
739
DefaultingPyMlirContext context) {
739
740
SmallVector<MlirAffineExpr> affineExprs;
740
741
pyListToVector<PyAffineExpr, MlirAffineExpr>(
@@ -869,7 +870,8 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
869
870
.def (MLIR_PYTHON_CAPI_FACTORY_ATTR, &PyIntegerSet::createFromCapsule)
870
871
.def (" __eq__" , [](PyIntegerSet &self,
871
872
PyIntegerSet &other) { return self == other; })
872
- .def (" __eq__" , [](PyIntegerSet &self, nb::object other) { return false ; })
873
+ .def (" __eq__" ,
874
+ [](PyIntegerSet &self, const nb::object &other) { return false ; })
873
875
.def (" __str__" ,
874
876
[](PyIntegerSet &self) {
875
877
PyPrintAccumulator printAccum;
@@ -898,7 +900,7 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
898
900
kDumpDocstring )
899
901
.def_static (
900
902
" get" ,
901
- [](intptr_t numDims, intptr_t numSymbols, nb::list exprs,
903
+ [](intptr_t numDims, intptr_t numSymbols, const nb::list & exprs,
902
904
std::vector<bool > eqFlags, DefaultingPyMlirContext context) {
903
905
if (exprs.size () != eqFlags.size ())
904
906
throw nb::value_error (
@@ -934,8 +936,9 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
934
936
nb::arg (" context" ).none () = nb::none ())
935
937
.def (
936
938
" get_replaced" ,
937
- [](PyIntegerSet &self, nb::list dimExprs, nb::list symbolExprs,
938
- intptr_t numResultDims, intptr_t numResultSymbols) {
939
+ [](PyIntegerSet &self, const nb::list &dimExprs,
940
+ const nb::list &symbolExprs, intptr_t numResultDims,
941
+ intptr_t numResultSymbols) {
939
942
if (static_cast <intptr_t >(dimExprs.size ()) !=
940
943
mlirIntegerSetGetNumDims (self))
941
944
throw nb::value_error (
0 commit comments