diff --git a/compiler/include/zamalang/Conversion/Utils/GenericOpTypeConversionPattern.h b/compiler/include/zamalang/Conversion/Utils/GenericOpTypeConversionPattern.h index 4cdad5f9b..ec939c9fb 100644 --- a/compiler/include/zamalang/Conversion/Utils/GenericOpTypeConversionPattern.h +++ b/compiler/include/zamalang/Conversion/Utils/GenericOpTypeConversionPattern.h @@ -19,7 +19,7 @@ struct GenericTypeConverterPattern : public mlir::OpRewritePattern { rewriter.startRootUpdate(op); // Rewrite arguments { - for (auto i = 0; i < op->getNumOperands(); i++) { + for (unsigned i = 0; i < op->getNumOperands(); i++) { auto operand = op->getOperand(i); mlir::Type type = converter.convertType(operand.getType()); if (type != mlir::Type()) { @@ -29,7 +29,7 @@ struct GenericTypeConverterPattern : public mlir::OpRewritePattern { } // Rewrite results { - for (auto i = 0; i < op->getNumResults(); i++) { + for (unsigned i = 0; i < op->getNumResults(); i++) { auto result = op->getResult(i); mlir::Type type = converter.convertType(result.getType()); if (type != mlir::Type()) { diff --git a/compiler/include/zamalang/Conversion/Utils/LinalgGenericTypeConverterPattern.h b/compiler/include/zamalang/Conversion/Utils/LinalgGenericTypeConverterPattern.h index 564d1ba28..12b47139f 100644 --- a/compiler/include/zamalang/Conversion/Utils/LinalgGenericTypeConverterPattern.h +++ b/compiler/include/zamalang/Conversion/Utils/LinalgGenericTypeConverterPattern.h @@ -19,7 +19,7 @@ struct LinalgGenericTypeConverterPattern rewriter.startRootUpdate(op); // Rewrite arguments { - for (auto i = 0; i < op->getNumOperands(); i++) { + for (unsigned i = 0; i < op->getNumOperands(); i++) { auto operand = op->getOperand(i); mlir::Type type = converter.convertType(operand.getType()); if (type != mlir::Type()) { @@ -29,7 +29,7 @@ struct LinalgGenericTypeConverterPattern } // Rewrite results { - for (auto i = 0; i < op->getNumResults(); i++) { + for (unsigned i = 0; i < op->getNumResults(); i++) { auto result = op->getResult(i); mlir::Type type = converter.convertType(result.getType()); if (type != mlir::Type()) { diff --git a/compiler/lib/Conversion/MidLFHEGlobalParametrization/MidLFHEGlobalParametrization.cpp b/compiler/lib/Conversion/MidLFHEGlobalParametrization/MidLFHEGlobalParametrization.cpp index 0cb432010..c6593971b 100644 --- a/compiler/lib/Conversion/MidLFHEGlobalParametrization/MidLFHEGlobalParametrization.cpp +++ b/compiler/lib/Conversion/MidLFHEGlobalParametrization/MidLFHEGlobalParametrization.cpp @@ -33,7 +33,7 @@ public: [](GLWECipherTextType type, mlir::zamalang::V0FHEContext &fheContext) { auto glweSize = fheContext.parameter.getNBigGlweSize(); auto p = fheContext.constraint.p; - if (type.getDimension() == glweSize && type.getP() == p) { + if (type.getDimension() == (signed)glweSize && type.getP() == (signed)p) { return type; } return GLWECipherTextType::get(