diff --git a/compiler/include/concretelang/ClientLib/KeySet.h b/compiler/include/concretelang/ClientLib/KeySet.h index 3039dc1ca..2d00242ef 100644 --- a/compiler/include/concretelang/ClientLib/KeySet.h +++ b/compiler/include/concretelang/ClientLib/KeySet.h @@ -34,10 +34,6 @@ public: static outcome::checked, StringError> generate(ClientParameters ¶ms, uint64_t seed_msb, uint64_t seed_lsb); - static outcome::checked, StringError> - generateCached(ClientParameters ¶ms, uint64_t seed_msb, - uint64_t seed_lsb); - // isInputEncrypted return true if the input at the given pos is encrypted. bool isInputEncrypted(size_t pos); diff --git a/compiler/include/concretelang/Support/JitCompilerEngine.h b/compiler/include/concretelang/Support/JitCompilerEngine.h index c11b17e76..88e5ad477 100644 --- a/compiler/include/concretelang/Support/JitCompilerEngine.h +++ b/compiler/include/concretelang/Support/JitCompilerEngine.h @@ -67,22 +67,22 @@ typedVectorResult(JITLambda::Argument &arguments) { template <> inline llvm::Expected> typedResult(JITLambda::Argument &arguments) { - return std::move(typedVectorResult(arguments)); + return typedVectorResult(arguments); } template <> inline llvm::Expected> typedResult(JITLambda::Argument &arguments) { - return std::move(typedVectorResult(arguments)); + return typedVectorResult(arguments); } template <> inline llvm::Expected> typedResult(JITLambda::Argument &arguments) { - return std::move(typedVectorResult(arguments)); + return typedVectorResult(arguments); } template <> inline llvm::Expected> typedResult(JITLambda::Argument &arguments) { - return std::move(typedVectorResult(arguments)); + return typedVectorResult(arguments); } template @@ -98,7 +98,7 @@ buildTensorLambdaResult(JITLambda::Argument &arguments) { arguments.getResultDimensions(0); if (!tensorDimOrError) - return std::move(tensorDimOrError.takeError()); + return tensorDimOrError.takeError(); return std::move(std::make_unique>>( *tensorOrError, *tensorDimOrError)); @@ -113,7 +113,7 @@ typedResult(JITLambda::Argument &arguments) { arguments.getResultType(0); if (!resTy) - return std::move(resTy.takeError()); + return resTy.takeError(); switch (*resTy) { case JITLambda::Argument::ResultType::SCALAR: { @@ -122,14 +122,14 @@ typedResult(JITLambda::Argument &arguments) { if (llvm::Error err = arguments.getResult(0, res)) return std::move(err); - return std::move(std::make_unique>(res)); + return std::make_unique>(res); } case JITLambda::Argument::ResultType::TENSOR: { llvm::Expected width = arguments.getResultWidth(0); if (!width) - return std::move(width.takeError()); + return width.takeError(); if (*width > 64) return StreamStringError("Cannot handle scalars with more than 64 bits"); @@ -187,7 +187,7 @@ public: llvm::Expected successOrError = tryAddArg(jla, pos, arg); if (!successOrError) - return std::move(successOrError.takeError()); + return successOrError.takeError(); if (successOrError.get() == false) return tryAddArg(jla, pos, arg); @@ -209,7 +209,7 @@ public: uint8_t, size_t>(jla, pos, arg); if (!successOrError) - return std::move(successOrError.takeError()); + return successOrError.takeError(); if (successOrError.get() == false) return StreamStringError("Unknown argument type"); diff --git a/compiler/lib/Conversion/BConcreteToBConcreteCAPI/BConcreteToBConcreteCAPI.cpp b/compiler/lib/Conversion/BConcreteToBConcreteCAPI/BConcreteToBConcreteCAPI.cpp index 34852f948..1e98fda62 100644 --- a/compiler/lib/Conversion/BConcreteToBConcreteCAPI/BConcreteToBConcreteCAPI.cpp +++ b/compiler/lib/Conversion/BConcreteToBConcreteCAPI/BConcreteToBConcreteCAPI.cpp @@ -85,16 +85,6 @@ inline mlir::Type getGenericCleartextType(mlir::MLIRContext *context) { return mlir::IntegerType::get(context, 64); } -inline mlir::concretelang::Concrete::PlaintextListType -getGenericPlaintextListType(mlir::MLIRContext *context) { - return mlir::concretelang::Concrete::PlaintextListType::get(context); -} - -inline mlir::concretelang::Concrete::ForeignPlaintextListType -getGenericForeignPlaintextListType(mlir::MLIRContext *context) { - return mlir::concretelang::Concrete::ForeignPlaintextListType::get(context); -} - inline mlir::concretelang::Concrete::LweKeySwitchKeyType getGenericLweKeySwitchKeyType(mlir::MLIRContext *context) { return mlir::concretelang::Concrete::LweKeySwitchKeyType::get(context); diff --git a/compiler/lib/Conversion/TFHEGlobalParametrization/TFHEGlobalParametrization.cpp b/compiler/lib/Conversion/TFHEGlobalParametrization/TFHEGlobalParametrization.cpp index e2a1a5a97..7f9d1af32 100644 --- a/compiler/lib/Conversion/TFHEGlobalParametrization/TFHEGlobalParametrization.cpp +++ b/compiler/lib/Conversion/TFHEGlobalParametrization/TFHEGlobalParametrization.cpp @@ -149,8 +149,7 @@ struct TFHEApplyLookupTablePaddingPattern mlir::PatternBenefit benefit = mlir::concretelang::DEFAULT_PATTERN_BENEFIT) : mlir::OpRewritePattern( - context, benefit), - typeConverter(typeConverter), v0Parameter(v0Parameter) {} + context, benefit) {} mlir::LogicalResult matchAndRewrite(mlir::concretelang::TFHE::ApplyLookupTable op, @@ -201,10 +200,6 @@ struct TFHEApplyLookupTablePaddingPattern return mlir::success(); }; - -private: - mlir::TypeConverter &typeConverter; - mlir::concretelang::V0Parameter &v0Parameter; }; template @@ -227,7 +222,8 @@ void populateWithTFHEApplyLookupTableParametrizationPattern( [&](mlir::concretelang::TFHE::ApplyLookupTable op) { if (op.glweDimension() != v0Parameter.glweDimension || // TODO remove the shift when we have true polynomial size - op.polynomialSize() != (1 << v0Parameter.logPolynomialSize) || + op.polynomialSize() != + ((uint32_t)1 << v0Parameter.logPolynomialSize) || op.levelKS() != v0Parameter.ksLevel || op.baseLogKS() != v0Parameter.ksLogBase || op.levelBS() != v0Parameter.brLevel || diff --git a/compiler/lib/Support/CompilerEngine.cpp b/compiler/lib/Support/CompilerEngine.cpp index c3ff2b323..d1eefcd08 100644 --- a/compiler/lib/Support/CompilerEngine.cpp +++ b/compiler/lib/Support/CompilerEngine.cpp @@ -136,7 +136,6 @@ llvm::Expected> CompilerEngine::getV0FHEConstraint(CompilationResult &res) { mlir::MLIRContext &mlirContext = *this->compilationContext->getMLIRContext(); mlir::ModuleOp module = res.mlirModuleRef->get(); - llvm::Optional fheConstraints; // If the values has been overwritten returns if (this->overrideMaxEintPrecision.hasValue() && this->overrideMaxMANP.hasValue()) { @@ -160,7 +159,7 @@ CompilerEngine::getV0FHEConstraint(CompilationResult &res) { llvm::Error CompilerEngine::determineFHEParameters(CompilationResult &res) { auto fheConstraintOrErr = getV0FHEConstraint(res); if (auto err = fheConstraintOrErr.takeError()) - return std::move(err); + return err; if (!fheConstraintOrErr.get().hasValue()) { return llvm::Error::success(); } diff --git a/compiler/lib/Support/JitCompilerEngine.cpp b/compiler/lib/Support/JitCompilerEngine.cpp index 276155da4..a0e717a1d 100644 --- a/compiler/lib/Support/JitCompilerEngine.cpp +++ b/compiler/lib/Support/JitCompilerEngine.cpp @@ -58,7 +58,7 @@ JitCompilerEngine::buildLambda(llvm::StringRef s, llvm::StringRef funcName, std::unique_ptr mb = llvm::MemoryBuffer::getMemBuffer(s); llvm::Expected res = this->buildLambda(std::move(mb), funcName, cache, runtimeLibPath); - return std::move(res); + return res; } // Build a lambda from the function with the name given in @@ -77,7 +77,7 @@ JitCompilerEngine::buildLambda(llvm::SourceMgr &sm, llvm::StringRef funcName, this->compile(sm, Target::LLVM_IR); if (!compResOrErr) - return std::move(compResOrErr.takeError()); + return compResOrErr.takeError(); auto compRes = std::move(compResOrErr.get()); diff --git a/compiler/src/main.cpp b/compiler/src/main.cpp index 7d835f118..160898258 100644 --- a/compiler/src/main.cpp +++ b/compiler/src/main.cpp @@ -307,7 +307,7 @@ mlir::LogicalResult processInputBuffer( if (!resOrErr) { mlir::concretelang::log_error() << "Failed to JIT-invoke " << funcName << " with arguments " - << jitArgs << ": " << llvm::toString(std::move(resOrErr.takeError())); + << jitArgs << ": " << llvm::toString(resOrErr.takeError()); return mlir::failure(); } @@ -348,13 +348,14 @@ mlir::LogicalResult processInputBuffer( break; case JIT_INVOKE: // Case just here to satisfy the compiler; already handled above + abort(); break; } auto retOrErr = ce.compile(std::move(buffer), target, outputLib); if (!retOrErr) { mlir::concretelang::log_error() - << llvm::toString(std::move(retOrErr.takeError())) << "\n"; + << llvm::toString(retOrErr.takeError()) << "\n"; return mlir::failure(); }