@@ -64,7 +64,7 @@ static void pyListToVector(const nb::list &list,
6464}
6565
6666template <typename PermutationTy>
67- static bool isPermutation (std::vector<PermutationTy> permutation) {
67+ static bool isPermutation (const std::vector<PermutationTy> & permutation) {
6868 llvm::SmallVector<bool , 8 > seen (permutation.size (), false );
6969 for (auto val : permutation) {
7070 if (val < permutation.size ()) {
@@ -366,7 +366,7 @@ nb::object PyAffineExpr::getCapsule() {
366366 return nb::steal<nb::object>(mlirPythonAffineExprToCapsule (*this ));
367367}
368368
369- PyAffineExpr PyAffineExpr::createFromCapsule (nb::object capsule) {
369+ PyAffineExpr PyAffineExpr::createFromCapsule (const nb::object & capsule) {
370370 MlirAffineExpr rawAffineExpr = mlirPythonCapsuleToAffineExpr (capsule.ptr ());
371371 if (mlirAffineExprIsNull (rawAffineExpr))
372372 throw nb::python_error ();
@@ -424,7 +424,7 @@ nb::object PyAffineMap::getCapsule() {
424424 return nb::steal<nb::object>(mlirPythonAffineMapToCapsule (*this ));
425425}
426426
427- PyAffineMap PyAffineMap::createFromCapsule (nb::object capsule) {
427+ PyAffineMap PyAffineMap::createFromCapsule (const nb::object & capsule) {
428428 MlirAffineMap rawAffineMap = mlirPythonCapsuleToAffineMap (capsule.ptr ());
429429 if (mlirAffineMapIsNull (rawAffineMap))
430430 throw nb::python_error ();
@@ -500,7 +500,7 @@ nb::object PyIntegerSet::getCapsule() {
500500 return nb::steal<nb::object>(mlirPythonIntegerSetToCapsule (*this ));
501501}
502502
503- PyIntegerSet PyIntegerSet::createFromCapsule (nb::object capsule) {
503+ PyIntegerSet PyIntegerSet::createFromCapsule (const nb::object & capsule) {
504504 MlirIntegerSet rawIntegerSet = mlirPythonCapsuleToIntegerSet (capsule.ptr ());
505505 if (mlirIntegerSetIsNull (rawIntegerSet))
506506 throw nb::python_error ();
@@ -708,7 +708,8 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
708708 return static_cast <size_t >(llvm::hash_value (self.get ().ptr ));
709709 })
710710 .def_static (" compress_unused_symbols" ,
711- [](nb::list affineMaps, DefaultingPyMlirContext context) {
711+ [](const nb::list &affineMaps,
712+ DefaultingPyMlirContext context) {
712713 SmallVector<MlirAffineMap> maps;
713714 pyListToVector<PyAffineMap, MlirAffineMap>(
714715 affineMaps, maps, " attempting to create an AffineMap" );
@@ -734,7 +735,7 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
734735 kDumpDocstring )
735736 .def_static (
736737 " get" ,
737- [](intptr_t dimCount, intptr_t symbolCount, nb::list exprs,
738+ [](intptr_t dimCount, intptr_t symbolCount, const nb::list & exprs,
738739 DefaultingPyMlirContext context) {
739740 SmallVector<MlirAffineExpr> affineExprs;
740741 pyListToVector<PyAffineExpr, MlirAffineExpr>(
@@ -869,7 +870,8 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
869870 .def (MLIR_PYTHON_CAPI_FACTORY_ATTR, &PyIntegerSet::createFromCapsule)
870871 .def (" __eq__" , [](PyIntegerSet &self,
871872 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 ; })
873875 .def (" __str__" ,
874876 [](PyIntegerSet &self) {
875877 PyPrintAccumulator printAccum;
@@ -898,7 +900,7 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
898900 kDumpDocstring )
899901 .def_static (
900902 " get" ,
901- [](intptr_t numDims, intptr_t numSymbols, nb::list exprs,
903+ [](intptr_t numDims, intptr_t numSymbols, const nb::list & exprs,
902904 std::vector<bool > eqFlags, DefaultingPyMlirContext context) {
903905 if (exprs.size () != eqFlags.size ())
904906 throw nb::value_error (
@@ -934,8 +936,9 @@ void mlir::python::populateIRAffine(nb::module_ &m) {
934936 nb::arg (" context" ).none () = nb::none ())
935937 .def (
936938 " 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) {
939942 if (static_cast <intptr_t >(dimExprs.size ()) !=
940943 mlirIntegerSetGetNumDims (self))
941944 throw nb::value_error (
0 commit comments