diff --git a/compiler/include/concretelang/Conversion/Passes.h b/compiler/include/concretelang/Conversion/Passes.h index 767b51e14..0ab381ae3 100644 --- a/compiler/include/concretelang/Conversion/Passes.h +++ b/compiler/include/concretelang/Conversion/Passes.h @@ -6,10 +6,12 @@ #ifndef CONCRETELANG_TRANSFORMS_PASSES_H #define CONCRETELANG_TRANSFORMS_PASSES_H +#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/MemRef/IR/MemRef.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "concretelang/Conversion/ConcreteToBConcrete/Pass.h" #include "concretelang/Conversion/FHETensorOpsToLinalg/Pass.h" diff --git a/compiler/include/concretelang/Dialect/Concrete/IR/CMakeLists.txt b/compiler/include/concretelang/Dialect/Concrete/IR/CMakeLists.txt index 9f6e7c3fe..b741381a2 100644 --- a/compiler/include/concretelang/Dialect/Concrete/IR/CMakeLists.txt +++ b/compiler/include/concretelang/Dialect/Concrete/IR/CMakeLists.txt @@ -8,6 +8,6 @@ mlir_tablegen(ConcreteOpsDialect.cpp.inc -gen-dialect-defs -dialect=Concrete) add_public_tablegen_target(MLIRConcreteOpsIncGen) add_dependencies(mlir-headers MLIRConcreteOpsIncGen) -add_concretelang_doc(ConcreteDialect ConcreteDialect concretelang/ -gen-dialect-doc) +add_concretelang_doc(ConcreteOps ConcreteDialect concretelang/ -gen-dialect-doc -dialect=Concrete) add_concretelang_doc(ConcreteOps ConcreteOps concretelang/ -gen-op-doc) add_concretelang_doc(ConcreteTypes ConcreteTypes concretelang/ -gen-typedef-doc) diff --git a/compiler/include/concretelang/Dialect/Concrete/IR/ConcreteDialect.td b/compiler/include/concretelang/Dialect/Concrete/IR/ConcreteDialect.td index 1da3649d6..9ef702628 100644 --- a/compiler/include/concretelang/Dialect/Concrete/IR/ConcreteDialect.td +++ b/compiler/include/concretelang/Dialect/Concrete/IR/ConcreteDialect.td @@ -10,6 +10,7 @@ def Concrete_Dialect : Dialect { A dialect for representation of low level operation on fully homomorphic ciphertext. }]; let cppNamespace = "::mlir::concretelang::Concrete"; + let useDefaultTypePrinterParser = 1; } #endif diff --git a/compiler/include/concretelang/Dialect/FHE/IR/CMakeLists.txt b/compiler/include/concretelang/Dialect/FHE/IR/CMakeLists.txt index a6b8e9a4f..9760b5f5d 100644 --- a/compiler/include/concretelang/Dialect/FHE/IR/CMakeLists.txt +++ b/compiler/include/concretelang/Dialect/FHE/IR/CMakeLists.txt @@ -8,6 +8,6 @@ mlir_tablegen(FHEOpsDialect.cpp.inc -gen-dialect-defs -dialect=FHE) add_public_tablegen_target(MLIRFHEOpsIncGen) add_dependencies(mlir-headers MLIRFHEOpsIncGen) -add_concretelang_doc(FHEDialect FHEDialect concretelang/ -gen-dialect-doc) +add_concretelang_doc(FHEOps FHEDialect concretelang/ -gen-dialect-doc -dialect=FHE) add_concretelang_doc(FHEOps FHEOps concretelang/ -gen-op-doc) add_concretelang_doc(FHETypes FHETypes concretelang/ -gen-typedef-doc) diff --git a/compiler/include/concretelang/Dialect/FHE/IR/FHEDialect.td b/compiler/include/concretelang/Dialect/FHE/IR/FHEDialect.td index 934e06a74..eabcdd301 100644 --- a/compiler/include/concretelang/Dialect/FHE/IR/FHEDialect.td +++ b/compiler/include/concretelang/Dialect/FHE/IR/FHEDialect.td @@ -18,6 +18,7 @@ def FHE_Dialect : Dialect { A dialect for representation of high level operation on fully homomorphic ciphertext. }]; let cppNamespace = "::mlir::concretelang::FHE"; + let useDefaultTypePrinterParser = 1; } #endif diff --git a/compiler/include/concretelang/Dialect/FHELinalg/IR/CMakeLists.txt b/compiler/include/concretelang/Dialect/FHELinalg/IR/CMakeLists.txt index 57f8cb5b4..4a65cc39b 100644 --- a/compiler/include/concretelang/Dialect/FHELinalg/IR/CMakeLists.txt +++ b/compiler/include/concretelang/Dialect/FHELinalg/IR/CMakeLists.txt @@ -8,6 +8,6 @@ mlir_tablegen(FHELinalgOpsDialect.cpp.inc -gen-dialect-defs -dialect=FHELinalg) add_public_tablegen_target(MLIRFHELinalgOpsIncGen) add_dependencies(mlir-headers MLIRFHELinalgOpsIncGen) -add_concretelang_doc(FHELinalgDialect FHELinalgDialect concretelang/ -gen-dialect-doc) +add_concretelang_doc(FHELinalgOps FHELinalgDialect concretelang/ -gen-dialect-doc -dialect=FHELinalg) add_concretelang_doc(FHELinalgOps FHELinalgOps concretelang/ -gen-op-doc) add_concretelang_doc(FHELinalgTypes FHELinalgTypes concretelang/ -gen-typedef-doc) diff --git a/compiler/include/concretelang/Dialect/TFHE/IR/CMakeLists.txt b/compiler/include/concretelang/Dialect/TFHE/IR/CMakeLists.txt index 62bc71207..e9749592e 100644 --- a/compiler/include/concretelang/Dialect/TFHE/IR/CMakeLists.txt +++ b/compiler/include/concretelang/Dialect/TFHE/IR/CMakeLists.txt @@ -8,6 +8,6 @@ mlir_tablegen(TFHEOpsDialect.cpp.inc -gen-dialect-defs -dialect=TFHE) add_public_tablegen_target(MLIRTFHEOpsIncGen) add_dependencies(mlir-headers MLIRTFHEOpsIncGen) -add_concretelang_doc(TFHEDialect TFHEDialect concretelang/ -gen-dialect-doc) +add_concretelang_doc(TFHEOps TFHEDialect concretelang/ -gen-dialect-doc -dialect=TFHE) add_concretelang_doc(TFHEOps TFHEOps concretelang/ -gen-op-doc) add_concretelang_doc(TFHETypes TFHETypes concretelang/ -gen-typedef-doc) diff --git a/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td b/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td index 83e92c4f1..be80aadce 100644 --- a/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td +++ b/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td @@ -17,6 +17,7 @@ def TFHE_Dialect : Dialect { let description = [{ A dialect for representation of high level operation on fully homomorphic ciphertext. }]; + let useDefaultTypePrinterParser = 1; let cppNamespace = "::mlir::concretelang::TFHE"; } diff --git a/compiler/include/concretelang/Support/LinalgExtras.h b/compiler/include/concretelang/Support/LinalgExtras.h index ca843f6b5..cfdc7ec84 100644 --- a/compiler/include/concretelang/Support/LinalgExtras.h +++ b/compiler/include/concretelang/Support/LinalgExtras.h @@ -7,6 +7,7 @@ #define CONCRETELANG_SUPPORT_LINALG_EXTRAS_H_ #include +#include #include #include #include diff --git a/compiler/include/concretelang/Transforms/CMakeLists.txt b/compiler/include/concretelang/Transforms/CMakeLists.txt index 2f12abca6..5845af11a 100644 --- a/compiler/include/concretelang/Transforms/CMakeLists.txt +++ b/compiler/include/concretelang/Transforms/CMakeLists.txt @@ -1,9 +1,3 @@ set(LLVM_TARGET_DEFINITIONS Passes.td) mlir_tablegen(Passes.h.inc -gen-pass-decls -name Transforms) add_public_tablegen_target(ConcretelangTransformsBufferizePassIncGen) - -set(LLVM_TARGET_DEFINITIONS OneShotBufferizeDPSWrapper.td) -mlir_tablegen(OneShotBufferizeDPSWrapper.h.inc -gen-pass-decls -name Transforms) -add_public_tablegen_target(ConcretelangTransformsOneShotBufferizeDPSWrapperPassIncGen) -add_public_tablegen_target(ConcretelangTransformsPassIncGen) -add_dependencies(mlir-headers ConcretelangTransformsPassIncGen) diff --git a/compiler/include/concretelang/Transforms/OneShotBufferizeDPSWrapper.h b/compiler/include/concretelang/Transforms/OneShotBufferizeDPSWrapper.h deleted file mode 100644 index 58019f41c..000000000 --- a/compiler/include/concretelang/Transforms/OneShotBufferizeDPSWrapper.h +++ /dev/null @@ -1,23 +0,0 @@ -// Part of the Concrete Compiler Project, under the BSD3 License with Zama -// Exceptions. See -// https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt -// for license information. - -#ifndef CONCRETELANG_ONE_SHOT_BUFFERIZE_DPS_WRAPPER_PASS_H -#define CONCRETELANG_ONE_SHOT_BUFFERIZE_DPS_WRAPPER_PASS_H - -#include -#include -#include - -#define GEN_PASS_CLASSES -#include - -namespace mlir { -namespace concretelang { -std::unique_ptr> -createOneShotBufferizeDPSWrapperPass(); -} // namespace concretelang -} // namespace mlir - -#endif diff --git a/compiler/include/concretelang/Transforms/OneShotBufferizeDPSWrapper.td b/compiler/include/concretelang/Transforms/OneShotBufferizeDPSWrapper.td deleted file mode 100644 index 8b22d0308..000000000 --- a/compiler/include/concretelang/Transforms/OneShotBufferizeDPSWrapper.td +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef CONCRETELANG_ONE_SHOT_BUFFERIZE_DPS_WRAPPER_PASS -#define CONCRETELANG_ONE_SHOT_BUFFERIZE_DPS_WRAPPER_PASS - -include "mlir/Pass/PassBase.td" - -def OneShotBufferizeDPSWrapper - : Pass<"one-shot-bufferize-dps-wrapper", "::mlir::ModuleOp"> { - let summary = - "Converts functions to destination-passing and generates a wrapper " - "function allocating and returning memrefs for return values"; - - let description = [{ - The one-shot bufferizer converts all functions returning tensor values - to functions using destination-passing style with one output memref for - each output value. In order to support external callers not using - destination-passing style and expecting memrefs to be returned, this - pass generates a wrapper function that allocates the corresponding - memref for each output tensor of the original function, invokes the - function using destination-passing style and returns the allocated - memrefs to the caller. - - Example: - - ``` - func @main(...) -> tensor<3x2049xi64> { - ... - } - ``` - - becomes: - - ``` - func private @main(...) -> memref<3x2049xi64> { - %0 = memref.alloc() : memref<3x2049xi64> - call @__dps_main(..., %0) : (..., memref<3x2049xi64>) -> () - return %0 : memref<3x2049xi64> - } - - func @__dps_main(..., tensor<3x2049xi64>) { - ... - } - ``` - }]; - - let constructor = - "mlir::concretelang::createOneShotBufferizeDPSWrapperPass()"; - - let options = []; - - let dependentDialects = [ - "mlir::bufferization::BufferizationDialect", "mlir::memref::MemRefDialect" - ]; -} - -#endif diff --git a/compiler/include/concretelang/Transforms/Passes.h b/compiler/include/concretelang/Transforms/Passes.h index a7b5ae403..987f16380 100644 --- a/compiler/include/concretelang/Transforms/Passes.h +++ b/compiler/include/concretelang/Transforms/Passes.h @@ -7,8 +7,8 @@ #define CONCRETELANG_TRANSFORMS_PASS_H #include -#include -#include +#include +#include #include #define GEN_PASS_CLASSES diff --git a/compiler/lib/Conversion/ConcreteToBConcrete/CMakeLists.txt b/compiler/lib/Conversion/ConcreteToBConcrete/CMakeLists.txt index c0e7c4329..bc3424eb1 100644 --- a/compiler/lib/Conversion/ConcreteToBConcrete/CMakeLists.txt +++ b/compiler/lib/Conversion/ConcreteToBConcrete/CMakeLists.txt @@ -13,6 +13,6 @@ add_mlir_dialect_library(ConcreteToBConcrete MLIRIR MLIRTransforms MLIRLinalgTransforms - MLIRMath) + MLIRMathDialect) target_link_libraries(ConcreteToBConcrete PUBLIC BConcreteDialect MLIRIR) diff --git a/compiler/lib/Conversion/ConcreteToBConcrete/ConcreteToBConcrete.cpp b/compiler/lib/Conversion/ConcreteToBConcrete/ConcreteToBConcrete.cpp index abe7ddf3c..f6b8cdd94 100644 --- a/compiler/lib/Conversion/ConcreteToBConcrete/ConcreteToBConcrete.cpp +++ b/compiler/lib/Conversion/ConcreteToBConcrete/ConcreteToBConcrete.cpp @@ -6,10 +6,11 @@ #include #include #include +#include #include #include #include -#include +#include #include #include #include @@ -289,8 +290,9 @@ struct GlweFromTablePattern : public mlir::OpRewritePattern< converter.convertType(resultTy).cast(); // %0 = linalg.init_tensor [polynomialSize*(glweDimension+1)] // : tensor - mlir::Value init = rewriter.replaceOpWithNewOp( - op, newResultTy.getShape(), newResultTy.getElementType()); + mlir::Value init = + rewriter.replaceOpWithNewOp( + op, newResultTy, mlir::ValueRange{}); // "BConcrete.fill_glwe_from_table" : (%0, polynomialSize, glweDimension, // %tlu) @@ -672,9 +674,8 @@ struct FromElementsOpPattern auto newTensorResultTy = converter.convertType(resultTy).cast(); - mlir::Value tensor = rewriter.create( - fromElementsOp.getLoc(), newTensorResultTy.getShape(), - newTensorResultTy.getElementType()); + mlir::Value tensor = rewriter.create( + fromElementsOp.getLoc(), newTensorResultTy, mlir::ValueRange{}); llvm::SmallVector sizes(1, rewriter.getI64IntegerAttr(1)); @@ -788,39 +789,33 @@ void insertTensorShapeOpPattern(mlir::MLIRContext &context, }); } -/// Rewrites `linalg.init_tensor` ops for which the converted type in +/// Rewrites `bufferization.alloc_tensor` ops for which the converted type in /// BConcrete is different from the original type. /// /// Example: /// /// ``` -/// linalg.init_tensor [4] : tensor<4x!Concrete.lwe_ciphertext<4096,6>> +/// bufferization.alloc_tensor() : tensor<4x!Concrete.lwe_ciphertext<4096,6>> /// ``` /// -/// which has become after type conversion: +/// becomes: /// /// ``` -/// linalg.init_tensor [4] : tensor<4x4097xi64> +/// bufferization.alloc_tensor() : tensor<4x4097xi64> /// ``` -/// -/// is finally fixed: -/// -/// ``` -/// linalg.init_tensor [4, 4097] : tensor<4x4097xi64> -/// ``` -struct InitTensorOpPattern - : public mlir::OpRewritePattern { - InitTensorOpPattern(::mlir::MLIRContext *context, - mlir::PatternBenefit benefit = 1) - : ::mlir::OpRewritePattern(context, benefit) { - } +struct AllocTensorOpPattern + : public mlir::OpRewritePattern { + AllocTensorOpPattern(::mlir::MLIRContext *context, + mlir::PatternBenefit benefit = 1) + : ::mlir::OpRewritePattern(context, + benefit) {} ::mlir::LogicalResult - matchAndRewrite(mlir::linalg::InitTensorOp initTensorOp, + matchAndRewrite(mlir::bufferization::AllocTensorOp allocTensorOp, ::mlir::PatternRewriter &rewriter) const override { ConcreteToBConcreteTypeConverter converter; mlir::RankedTensorType resultTy = - initTensorOp.getType().dyn_cast(); + allocTensorOp.getType().dyn_cast(); if (!resultTy || !resultTy.hasStaticShape()) return mlir::failure(); @@ -829,8 +824,8 @@ struct InitTensorOpPattern converter.convertType(resultTy).dyn_cast(); if (resultTy.getShape().size() != newResultTy.getShape().size()) { - rewriter.replaceOpWithNewOp( - initTensorOp, newResultTy.getShape(), newResultTy.getElementType()); + rewriter.replaceOpWithNewOp( + allocTensorOp, newResultTy, mlir::ValueRange{}); } return ::mlir::success(); @@ -935,11 +930,11 @@ void ConcreteToBConcretePass::runOnOperation() { converter.isLegal(op->getOperandTypes()); }); - patterns.insert(&getContext()); + patterns.insert(&getContext()); target.addDynamicallyLegalOp( + mlir::bufferization::AllocTensorOp>( [&](mlir::Operation *op) { return converter.isLegal(op->getResult(0).getType()); }); diff --git a/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp b/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp index 1e4126fec..ff5303730 100644 --- a/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp +++ b/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp @@ -3,6 +3,7 @@ // https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt // for license information. +#include #include #include "mlir/Dialect/Func/IR/FuncOps.h" @@ -30,6 +31,7 @@ namespace arith = mlir::arith; namespace linalg = mlir::linalg; namespace tensor = mlir::tensor; +namespace bufferization = mlir::bufferization; namespace FHE = mlir::concretelang::FHE; namespace FHELinalg = mlir::concretelang::FHELinalg; @@ -239,8 +241,8 @@ struct FHELinalgOpToLinalgGeneric : public mlir::OpRewritePattern { mlir::RankedTensorType rhsTy = ((mlir::Type)linalgOp.rhs().getType()).cast(); // linalg.init_tensor for initial value - mlir::Value init = rewriter.create( - linalgOp.getLoc(), resultTy.getShape(), resultTy.getElementType()); + mlir::Value init = rewriter.create( + linalgOp.getLoc(), resultTy, mlir::ValueRange{}); // Create the affine #maps_0 llvm::SmallVector maps{ @@ -431,8 +433,8 @@ struct FHELinalgApplyMappedLookupTableToLinalgGeneric nestedBuilder.create(loc, lookup.getResult()); }; - auto output = - rewriter.create(loc, resultShape, elementTy); + auto output = rewriter.create( + loc, resultTy, mlir::ValueRange{}); // Create the `linalg.g eneric` op Types resTys{resultTy}; @@ -517,9 +519,8 @@ struct FHELinalgApplyMultiLookupTableToLinalgGeneric ((mlir::Type)fheLinalgLutOp.luts().getType()) .cast(); // linalg.init_tensor for initial value - mlir::Value init = rewriter.create( - fheLinalgLutOp.getLoc(), resultTy.getShape(), - resultTy.getElementType()); + mlir::Value init = rewriter.create( + fheLinalgLutOp.getLoc(), resultTy, mlir::ValueRange{}); auto lutsShape = lutsTy.getShape(); auto lut_size = lutsShape[lutsShape.size() - 1]; @@ -635,8 +636,8 @@ struct FHELinalgApplyLookupTableToLinalgGeneric ((mlir::Type)lutOp.t().getType()).cast(); // linalg.init_tensor for initial value - mlir::Value init = rewriter.create( - lutOp.getLoc(), resultTy.getShape(), resultTy.getElementType()); + mlir::Value init = rewriter.create( + lutOp.getLoc(), resultTy, mlir::ValueRange{}); // Create the affine #maps_0 llvm::SmallVector maps{ @@ -733,8 +734,8 @@ struct FHELinalgNegEintToLinalgGeneric .cast(); // linalg.init_tensor for initial value - mlir::Value init = rewriter.create( - negEintOp.getLoc(), resultTy.getShape(), resultTy.getElementType()); + mlir::Value init = rewriter.create( + negEintOp.getLoc(), resultTy, mlir::ValueRange{}); // Create the affine #maps_0 llvm::SmallVector maps{ @@ -1633,6 +1634,8 @@ void FHETensorOpsToLinalg::runOnOperation() { // for conv that works on tensors of custom types target.addLegalOp(); + target.addLegalOp(); + mlir::RewritePatternSet patterns(&getContext()); patterns.insert(&getContext()); patterns.insert< diff --git a/compiler/lib/Conversion/FHEToTFHE/CMakeLists.txt b/compiler/lib/Conversion/FHEToTFHE/CMakeLists.txt index bf690ba11..2da8770bf 100644 --- a/compiler/lib/Conversion/FHEToTFHE/CMakeLists.txt +++ b/compiler/lib/Conversion/FHEToTFHE/CMakeLists.txt @@ -11,6 +11,6 @@ add_mlir_dialect_library(FHEToTFHE LINK_LIBS PUBLIC MLIRIR MLIRTransforms - MLIRMath) + MLIRMathDialect) target_link_libraries(FHEToTFHE PUBLIC MLIRIR) diff --git a/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/CMakeLists.txt b/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/CMakeLists.txt index b0d26b4e7..1d0ba3821 100644 --- a/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/CMakeLists.txt +++ b/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/CMakeLists.txt @@ -15,9 +15,9 @@ add_mlir_dialect_library(MLIRLowerableDialectsToLLVM ConcretelangConversion MLIRIR MLIRTransforms - MLIRLLVMIR + MLIRLLVMIRTransforms MLIRLLVMToLLVMIRTranslation MLIROpenMPToLLVMIRTranslation - MLIRMath) + MLIRMathDialect) target_link_libraries(MLIRLowerableDialectsToLLVM PUBLIC MLIRIR) diff --git a/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp b/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp index dba2019ce..fa5d491d6 100644 --- a/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp +++ b/compiler/lib/Conversion/MLIRLowerableDialectsToLLVM/MLIRLowerableDialectsToLLVM.cpp @@ -22,7 +22,7 @@ #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/OpenMP/OpenMPDialect.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/ADT/Sequence.h" diff --git a/compiler/lib/Conversion/TFHEToConcrete/CMakeLists.txt b/compiler/lib/Conversion/TFHEToConcrete/CMakeLists.txt index ce8f4440a..d98ff5207 100644 --- a/compiler/lib/Conversion/TFHEToConcrete/CMakeLists.txt +++ b/compiler/lib/Conversion/TFHEToConcrete/CMakeLists.txt @@ -12,6 +12,6 @@ add_mlir_dialect_library(TFHEToConcrete LINK_LIBS PUBLIC MLIRIR MLIRTransforms - MLIRMath) + MLIRMathDialect) target_link_libraries(TFHEToConcrete PUBLIC MLIRIR) diff --git a/compiler/lib/Dialect/BConcrete/Transforms/BufferizableOpInterfaceImpl.cpp b/compiler/lib/Dialect/BConcrete/Transforms/BufferizableOpInterfaceImpl.cpp index b5f4dc2d8..48492d422 100644 --- a/compiler/lib/Dialect/BConcrete/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/compiler/lib/Dialect/BConcrete/Transforms/BufferizableOpInterfaceImpl.cpp @@ -3,10 +3,11 @@ // https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt // for license information. +#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/Operation.h" @@ -17,6 +18,7 @@ #include "concretelang/Dialect/BConcrete/Transforms/BufferizableOpInterfaceImpl.h" #include #include +#include using namespace mlir; using namespace mlir::bufferization; @@ -164,14 +166,19 @@ struct BufferizableWithCallOpInterface } LogicalResult bufferize(Operation *op, RewriterBase &rewriter, - BufferizationState &state) const { + const BufferizationOptions &options) const { auto loc = op->getLoc(); auto castOp = cast(op); // For now we always alloc for the result, we didn't have the in place // operators yet. - auto outMemref = state.createAlloc(rewriter, loc, castOp.result()); + auto resTensorType = + castOp.result().getType().template cast(); + + auto outMemrefType = MemRefType::get(resTensorType.getShape(), + resTensorType.getElementType()); + auto outMemref = options.createAlloc(rewriter, loc, outMemrefType, {}); if (mlir::failed(outMemref)) { return mlir::failure(); } @@ -185,9 +192,8 @@ struct BufferizableWithCallOpInterface if (!operand.get().getType().isa()) { operands.push_back(operand.get()); } else { - auto memrefOperand = *state.getBuffer( - rewriter, operand, - BufferizationState::ForceInPlacability::FORCE_INPLACE); + auto memrefOperand = + bufferization::getBuffer(rewriter, operand.get(), options); operands.push_back(getCasted1DMemRef(rewriter, loc, memrefOperand)); } } @@ -253,21 +259,19 @@ struct BufferizableGlweFromTableOpInterface /// (tensor, i32, i32, tensor) -> () /// ``` LogicalResult bufferize(Operation *op, RewriterBase &rewriter, - BufferizationState &state) const { + const BufferizationOptions &options) const { auto loc = op->getLoc(); auto castOp = cast(op); auto glweOp = getCasted1DMemRef( rewriter, loc, - *state.getBuffer( - rewriter, castOp->getOpOperand(0), - BufferizationState::ForceInPlacability::FORCE_INPLACE)); + bufferization::getBuffer(rewriter, castOp->getOpOperand(0).get(), + options)); auto lutOp = getCasted1DMemRef( rewriter, loc, - *state.getBuffer( - rewriter, castOp->getOpOperand(1), - BufferizationState::ForceInPlacability::FORCE_INPLACE)); + bufferization::getBuffer(rewriter, castOp->getOpOperand(1).get(), + options)); auto polySizeOp = rewriter.create( op->getLoc(), rewriter.getI32IntegerAttr(castOp.polynomialSize())); diff --git a/compiler/lib/Dialect/BConcrete/Transforms/CMakeLists.txt b/compiler/lib/Dialect/BConcrete/Transforms/CMakeLists.txt index e93dc9c93..7b49ffef7 100644 --- a/compiler/lib/Dialect/BConcrete/Transforms/CMakeLists.txt +++ b/compiler/lib/Dialect/BConcrete/Transforms/CMakeLists.txt @@ -10,11 +10,12 @@ add_mlir_dialect_library(ConcretelangBConcreteTransforms mlir-headers LINK_LIBS PUBLIC - MLIRArithmetic - MLIRBufferization + ConcretelangConversion + MLIRArithmeticDialect + MLIRBufferizationDialect MLIRBufferizationTransforms MLIRIR - MLIRMemRef + MLIRMemRefDialect MLIRPass MLIRTransforms ) diff --git a/compiler/lib/Dialect/FHELinalg/IR/FHELinalgOps.cpp b/compiler/lib/Dialect/FHELinalg/IR/FHELinalgOps.cpp index e60cffb41..39b9f72b0 100644 --- a/compiler/lib/Dialect/FHELinalg/IR/FHELinalgOps.cpp +++ b/compiler/lib/Dialect/FHELinalg/IR/FHELinalgOps.cpp @@ -5,7 +5,10 @@ #include +#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" +#include "mlir/Dialect/Math/IR/Math.h" +#include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/IR/OpImplementation.h" #include "mlir/IR/TypeUtilities.h" #include "mlir/Parser/Parser.h" diff --git a/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp b/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp index 7041bbaf6..8ae46de5a 100644 --- a/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp +++ b/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/compiler/lib/Dialect/RT/Analysis/BuildDataflowTaskGraph.cpp b/compiler/lib/Dialect/RT/Analysis/BuildDataflowTaskGraph.cpp index edd371b10..713ee68d4 100644 --- a/compiler/lib/Dialect/RT/Analysis/BuildDataflowTaskGraph.cpp +++ b/compiler/lib/Dialect/RT/Analysis/BuildDataflowTaskGraph.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/compiler/lib/Dialect/RT/Analysis/LowerDataflowTasksToRT.cpp b/compiler/lib/Dialect/RT/Analysis/LowerDataflowTasksToRT.cpp index 8f2d17b7e..0ab7e1c8d 100644 --- a/compiler/lib/Dialect/RT/Analysis/LowerDataflowTasksToRT.cpp +++ b/compiler/lib/Dialect/RT/Analysis/LowerDataflowTasksToRT.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/compiler/lib/Dialect/RT/Analysis/LowerRTToLLVMDFRCallsConversionPatterns.cpp b/compiler/lib/Dialect/RT/Analysis/LowerRTToLLVMDFRCallsConversionPatterns.cpp index 7fcb8962b..15344771d 100644 --- a/compiler/lib/Dialect/RT/Analysis/LowerRTToLLVMDFRCallsConversionPatterns.cpp +++ b/compiler/lib/Dialect/RT/Analysis/LowerRTToLLVMDFRCallsConversionPatterns.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/compiler/lib/Dialect/RT/Transforms/BufferizableOpInterfaceImpl.cpp b/compiler/lib/Dialect/RT/Transforms/BufferizableOpInterfaceImpl.cpp index e422e2303..737f2b797 100644 --- a/compiler/lib/Dialect/RT/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/compiler/lib/Dialect/RT/Transforms/BufferizableOpInterfaceImpl.cpp @@ -45,7 +45,7 @@ struct DataflowTaskOpBufferizationInterface } LogicalResult bufferize(Operation *op, RewriterBase &rewriter, - BufferizationState &state) const { + const BufferizationOptions &options) const { DataflowTaskOp taskOp = cast(op); auto isTensorType = [](Type t) { return t.isa(); }; @@ -64,7 +64,8 @@ struct DataflowTaskOpBufferizationInterface Value oldOperandValue = opOperand.get(); if (oldOperandValue.getType().isa()) { - FailureOr bufferOrErr = state.getBuffer(rewriter, opOperand); + FailureOr bufferOrErr = + bufferization::getBuffer(rewriter, opOperand.get(), options); if (failed(bufferOrErr)) return failure(); @@ -87,7 +88,7 @@ struct DataflowTaskOpBufferizationInterface for (OpOperand &yieldOperand : yield.getOperation()->getOpOperands()) if (yieldOperand.get().getType().isa()) { FailureOr bufferOrErr = - state.getBuffer(rewriter, yieldOperand); + bufferization::getBuffer(rewriter, yieldOperand.get(), options); if (failed(bufferOrErr)) return WalkResult::interrupt(); @@ -112,7 +113,7 @@ struct DataflowTaskOpBufferizationInterface for (OpResult res : op->getResults()) { if (TensorType t = res.getType().dyn_cast()) { - BaseMemRefType memrefType = getMemRefType(t, state.getOptions()); + BaseMemRefType memrefType = getMemRefType(t, options); newResultTypes.push_back(memrefType); } else { newResultTypes.push_back(res.getType()); diff --git a/compiler/lib/Dialect/RT/Transforms/CMakeLists.txt b/compiler/lib/Dialect/RT/Transforms/CMakeLists.txt index d5f5c9254..83a1587ae 100644 --- a/compiler/lib/Dialect/RT/Transforms/CMakeLists.txt +++ b/compiler/lib/Dialect/RT/Transforms/CMakeLists.txt @@ -8,11 +8,11 @@ add_mlir_dialect_library(RTDialectTransforms mlir-headers LINK_LIBS PUBLIC - MLIRArithmetic - MLIRBufferization + MLIRArithmeticDialect + MLIRBufferizationDialect MLIRBufferizationTransforms MLIRIR - MLIRMemRef + MLIRMemRefDialect MLIRPass MLIRTransforms ) diff --git a/compiler/lib/Support/CompilerEngine.cpp b/compiler/lib/Support/CompilerEngine.cpp index 489ac3223..27e6071cb 100644 --- a/compiler/lib/Support/CompilerEngine.cpp +++ b/compiler/lib/Support/CompilerEngine.cpp @@ -5,19 +5,23 @@ #include #include +#include #include +#include +#include #include #include #include #include #include +#include #include #include #include #include #include -#include +#include #include #include @@ -69,6 +73,11 @@ mlir::MLIRContext *CompilationContext::getMLIRContext() { mlir::scf::SCFDialect, mlir::omp::OpenMPDialect, mlir::bufferization::BufferizationDialect>(); BConcrete::registerBufferizableOpInterfaceExternalModels(registry); + arith::registerBufferizableOpInterfaceExternalModels(registry); + bufferization::func_ext::registerBufferizableOpInterfaceExternalModels( + registry); + scf::registerBufferizableOpInterfaceExternalModels(registry); + tensor::registerBufferizableOpInterfaceExternalModels(registry); RT::registerBufferizableOpInterfaceExternalModels(registry); this->mlirContext = new mlir::MLIRContext(); this->mlirContext->appendDialectRegistry(registry); diff --git a/compiler/lib/Support/Pipeline.cpp b/compiler/lib/Support/Pipeline.cpp index 3e86dd55f..0797991f2 100644 --- a/compiler/lib/Support/Pipeline.cpp +++ b/compiler/lib/Support/Pipeline.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -15,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include #include -#include #include namespace mlir { @@ -250,18 +250,16 @@ lowerStdToLLVMDialect(mlir::MLIRContext &context, mlir::ModuleOp &module, pipelinePrinting("StdToLLVM", pm, context); // Bufferize - addPotentiallyNestedPass( - pm, mlir::concretelang::createOneShotBufferizeDPSWrapperPass(), - enablePass); - mlir::bufferization::OneShotBufferizationOptions bufferizationOptions; bufferizationOptions.allowReturnAllocs = true; bufferizationOptions.printConflicts = true; - bufferizationOptions.fullyDynamicLayoutMaps = false; + bufferizationOptions.unknownTypeConversion = mlir::bufferization:: + OneShotBufferizationOptions::LayoutMapOption::IdentityLayoutMap; + bufferizationOptions.bufferizeFunctionBoundaries = true; bufferizationOptions.createDeallocs = true; std::unique_ptr comprBuffPass = - mlir::createLinalgComprehensiveModuleBufferizePass(bufferizationOptions); + mlir::bufferization::createOneShotBufferizePass(bufferizationOptions); addPotentiallyNestedPass(pm, std::move(comprBuffPass), enablePass); if (parallelizeLoops) { diff --git a/compiler/lib/Transforms/CMakeLists.txt b/compiler/lib/Transforms/CMakeLists.txt index b3eae8328..ac35ca335 100644 --- a/compiler/lib/Transforms/CMakeLists.txt +++ b/compiler/lib/Transforms/CMakeLists.txt @@ -1,5 +1,4 @@ add_mlir_library(ConcretelangTransforms - OneShotBufferizeDPSWrapper.cpp ForLoopToParallel.cpp ADDITIONAL_HEADER_DIRS @@ -8,11 +7,10 @@ add_mlir_library(ConcretelangTransforms DEPENDS MLIRTransforms ConcretelangTransformsBufferizePassIncGen - ConcretelangTransformsOneShotBufferizeDPSWrapperPassIncGen mlir-headers LINK_LIBS PUBLIC MLIRIR - MLIRMemRef + MLIRMemRefDialect MLIRTransforms ) diff --git a/compiler/lib/Transforms/ForLoopToParallel.cpp b/compiler/lib/Transforms/ForLoopToParallel.cpp index c2adffae9..d223dd7f1 100644 --- a/compiler/lib/Transforms/ForLoopToParallel.cpp +++ b/compiler/lib/Transforms/ForLoopToParallel.cpp @@ -6,7 +6,7 @@ #include "concretelang/Transforms/Passes.h" #include "mlir/Dialect/Bufferization/Transforms/Bufferize.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/Operation.h" #include "mlir/Transforms/DialectConversion.h" diff --git a/compiler/lib/Transforms/OneShotBufferizeDPSWrapper.cpp b/compiler/lib/Transforms/OneShotBufferizeDPSWrapper.cpp deleted file mode 100644 index 1537e1764..000000000 --- a/compiler/lib/Transforms/OneShotBufferizeDPSWrapper.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// Part of the Concrete Compiler Project, under the BSD3 License with Zama -// Exceptions. See -// https://github.com/zama-ai/concrete-compiler-internal/blob/main/LICENSE.txt -// for license information. - -#include "llvm/ADT/SmallVector.h" -#include -#include -#include -#include -#include - -namespace { -class OneShotBufferizeDPSWrapperPass - : public OneShotBufferizeDPSWrapperBase { -public: - using OneShotBufferizeDPSWrapperBase< - OneShotBufferizeDPSWrapperPass>::OneShotBufferizeDPSWrapperBase; - - void runOnOperation() override { - mlir::MLIRContext *context = &this->getContext(); - mlir::ModuleOp module = this->getOperation(); - mlir::OpBuilder builder(context); - - module.walk([&](mlir::func::FuncOp funcOp) { - // Skip forward-declarations - if (funcOp.empty()) - return; - - // Skip functions that do not return vectors - if (llvm::all_of(funcOp.getFunctionType().getResults(), - [](mlir::Type resultTy) { - return !resultTy.isa(); - })) - return; - - // Preserve name and type of the original function - std::string origFuncName = funcOp.getName().str(); - mlir::FunctionType origFuncTy = funcOp.getFunctionType(); - - // New input types of the original function: all original inputs - // plus result memrefs for destination-passing style - std::vector newInputTypes = - funcOp.getFunctionType().getInputs().vec(); - - // New result types of the original function: all original - // results, except tensor results - std::vector newResultTypes; - - // New function arguments for result memrefs - std::vector newDPSArgs; - - // The result types of the wrapper function: all original - // results, but tensor results become memrefs - std::vector wrapperResultTypes; - - for (mlir::Type resultTy : funcOp.getFunctionType().getResults()) { - if (mlir::TensorType tensorResultTy = - resultTy.dyn_cast()) { - mlir::Type memrefResultTy = mlir::MemRefType::get( - tensorResultTy.getShape(), tensorResultTy.getElementType()); - newInputTypes.push_back(memrefResultTy); - wrapperResultTypes.push_back(memrefResultTy); - - mlir::Value newDPSArg = - funcOp.getBody().addArgument(memrefResultTy, funcOp.getLoc()); - - newDPSArgs.push_back(newDPSArg); - } else { - newResultTypes.push_back(resultTy); - wrapperResultTypes.push_back(resultTy); - } - } - - // Update name and type of the original function - std::string newFuncName = "__dps_" + origFuncName; - funcOp.setName(newFuncName); - - mlir::FunctionType newFuncTy = - mlir::FunctionType::get(context, newInputTypes, newResultTypes); - - funcOp.setType(newFuncTy); - - // Update the terminators of all blocks by extracting all tensor - // operands, converting them to memrefs, copying their contents - // to the output memrefs and removing them from the terminator. - // - // All non-tensor return values are preserved and returned in - // the same order. - for (mlir::Block &block : funcOp.getBlocks()) { - mlir::Operation *terminator = block.getTerminator(); - builder.setInsertionPoint(terminator); - - size_t newDPSArgIdx = 0; - size_t operandIdx = 0; - - for (mlir::OpOperand &resOperand : terminator->getOpOperands()) { - mlir::Value resVal = resOperand.get(); - - if (mlir::TensorType resTensorTy = - resVal.getType().dyn_cast()) { - - mlir::Value castedTensor = - builder.create( - funcOp.getLoc(), newDPSArgs[newDPSArgIdx].getType(), - resVal); - builder.create(funcOp.getLoc(), castedTensor, - newDPSArgs[newDPSArgIdx]); - - newDPSArgIdx++; - - terminator->eraseOperand(operandIdx); - } else { - operandIdx++; - } - } - } - - funcOp.setName(newFuncName); - - // Generate wrapper function. The wrapper function allocates - // memory for each result tensor of the original function and - // invokes the modified function in destination-passing style - // with the original arguments plus the output memrefs. - // - // The wrapper function returns the results of the original - // function in the same order, but tensor values are replaced by - // the output memrefs. - mlir::FunctionType wrapperFuncTy = mlir::FunctionType::get( - context, origFuncTy.getInputs(), wrapperResultTypes); - - builder.setInsertionPoint(funcOp); - - mlir::func::FuncOp wrapperFuncOp = builder.create( - funcOp.getLoc(), origFuncName, wrapperFuncTy, - builder.getStringAttr("private")); - - mlir::Block *wrapperEntryBlock = wrapperFuncOp.addEntryBlock(); - - // Generate call of the original function in destination-passing - // style - builder.setInsertionPointToStart(wrapperEntryBlock); - mlir::func::CallOp callOp = - builder.create(funcOp.getLoc(), funcOp); - builder.create(funcOp.getLoc()); - - mlir::Operation *wrapperTerminator = - wrapperFuncOp.getBody().getBlocks().front().getTerminator(); - - // Create allocations of the result memrefs in the wrapper - // function and create arguments for the call operation invoking - // the original function in destination-passing style - callOp.getOperation()->setOperands(wrapperFuncOp.getArguments()); - builder.setInsertionPoint(callOp); - - size_t callArgIndex = callOp.getOperation()->getNumOperands(); - llvm::SmallVector dpsResultValues; - - // Allocate the output memrefs and add to the end of operands to - // the call po inviking the modified function in - // destination-passing style - for (mlir::Value newDPSArg : newDPSArgs) { - mlir::MemRefType memrefTy = - newDPSArg.getType().dyn_cast(); - - mlir::memref::AllocOp allocOp = - builder.create(funcOp.getLoc(), memrefTy); - dpsResultValues.push_back(allocOp.getResult()); - callOp.getOperation()->insertOperands(callArgIndex, - allocOp.getResult()); - callArgIndex++; - } - - // Build up the list of operands of the wrapper function, - // composed of the return values of the modified function and - // the memrefs containing the poutput values after invocation of - // the modified function in destination-passing style - size_t dpsResultIndex = 0; - size_t resultIndex = 0; - size_t origResultIndex = 0; - for (mlir::Type origResultTy : origFuncTy.getResults()) { - if (origResultTy.isa()) { - wrapperTerminator->insertOperands(resultIndex, - dpsResultValues[dpsResultIndex]); - dpsResultIndex++; - } else { - wrapperTerminator->insertOperands(resultIndex, - callOp.getResult(origResultIndex)); - origResultIndex++; - } - - resultIndex++; - } - }); - } -}; -} // namespace - -std::unique_ptr> -mlir::concretelang::createOneShotBufferizeDPSWrapperPass() { - return std::make_unique(); -} diff --git a/compiler/src/CMakeLists.txt b/compiler/src/CMakeLists.txt index b1da21178..2eb39769f 100644 --- a/compiler/src/CMakeLists.txt +++ b/compiler/src/CMakeLists.txt @@ -20,7 +20,7 @@ target_link_libraries(concretecompiler ConcretelangSupport MLIRIR - MLIRLLVMIR + MLIRLLVMIRTransforms MLIRLLVMToLLVMIRTranslation RTDialect diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe.mlir index 3cedb111e..dbca786ba 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe.mlir @@ -1,10 +1,10 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -//CHECK: func @add_glwe(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { +//CHECK: func.func @add_glwe(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.add_lwe_buffer"(%[[A0]], %[[A1]]) : (tensor<2049xi64>, tensor<2049xi64>) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @add_glwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +func.func @add_glwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { %0 = "Concrete.add_lwe_ciphertexts"(%arg0, %arg1) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> return %0 : !Concrete.lwe_ciphertext<2048,7> } diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe_int.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe_int.mlir index a10902891..a736b823f 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe_int.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/add_lwe_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -//CHECK: func @add_glwe_const_int(%arg0: tensor<1025xi64>) -> tensor<1025xi64> { +//CHECK: func.func @add_glwe_const_int(%arg0: tensor<1025xi64>) -> tensor<1025xi64> { //CHECK: %c1_i8 = arith.constant 1 : i8 //CHECK: %0 = arith.extui %c1_i8 : i8 to i64 //CHECK: %c56_i64 = arith.constant 56 : i64 @@ -9,21 +9,21 @@ //CHECK: %2 = "BConcrete.add_plaintext_lwe_buffer"(%arg0, %1) : (tensor<1025xi64>, i64) -> tensor<1025xi64> //CHECK: return %2 : tensor<1025xi64> //CHECK: } -func @add_glwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> { +func.func @add_glwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> { %0 = arith.constant 1 : i8 %1 = "Concrete.encode_int"(%0) : (i8) -> !Concrete.plaintext<8> %2 = "Concrete.add_plaintext_lwe_ciphertext"(%arg0, %1) : (!Concrete.lwe_ciphertext<1024,7>, !Concrete.plaintext<8>) -> !Concrete.lwe_ciphertext<1024,7> return %2 : !Concrete.lwe_ciphertext<1024,7> } -//CHECK: func @add_glwe_int(%arg0: tensor<1025xi64>, %arg1: i5) -> tensor<1025xi64> { +//CHECK: func.func @add_glwe_int(%arg0: tensor<1025xi64>, %arg1: i5) -> tensor<1025xi64> { //CHECK: %0 = arith.extui %arg1 : i5 to i64 //CHECK: %c59_i64 = arith.constant 59 : i64 //CHECK: %1 = arith.shli %0, %c59_i64 : i64 //CHECK: %2 = "BConcrete.add_plaintext_lwe_buffer"(%arg0, %1) : (tensor<1025xi64>, i64) -> tensor<1025xi64> //CHECK: return %2 : tensor<1025xi64> //CHECK: } -func @add_glwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> { +func.func @add_glwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> { %0 = "Concrete.encode_int"(%arg1) : (i5) -> !Concrete.plaintext<5> %1 = "Concrete.add_plaintext_lwe_ciphertext"(%arg0, %0) : (!Concrete.lwe_ciphertext<1024,4>, !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<1024,4> return %1 : !Concrete.lwe_ciphertext<1024,4> diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table.mlir index ad5aa407c..871a2b348 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table.mlir @@ -1,13 +1,13 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -//CHECK: func @apply_lookup_table(%[[A0:.*]]: tensor<1025xi64>, %[[A1:.*]]: tensor<16xi64>) -> tensor<1025xi64> { -//CHECK: %[[V0:.*]] = linalg.init_tensor [2048] : tensor<2048xi64> +//CHECK: func.func @apply_lookup_table(%[[A0:.*]]: tensor<1025xi64>, %[[A1:.*]]: tensor<16xi64>) -> tensor<1025xi64> { +//CHECK: %[[V0:.*]] = bufferization.alloc_tensor() : tensor<2048xi64> //CHECK: "BConcrete.fill_glwe_from_table"(%[[V0]], %[[A1]]) {glweDimension = 1 : i32, outPrecision = 4 : i32, polynomialSize = 1024 : i32} : (tensor<2048xi64>, tensor<16xi64>) -> () //CHECK: %[[V1:.*]] = "BConcrete.keyswitch_lwe_buffer"(%[[A0]]) {baseLog = 2 : i32, inputLweDimension = 1 : i32, level = 3 : i32, outputLweDimension = 600 : i32} : (tensor<1025xi64>) -> tensor<601xi64> //CHECK: %[[V2:.*]] = "BConcrete.bootstrap_lwe_buffer"(%[[V1]], %[[V0]]) {baseLog = 4 : i32, glweDimension = 1 : i32, level = 5 : i32, polynomialSize = 1024 : i32} : (tensor<601xi64>, tensor<2048xi64>) -> tensor<1025xi64> //CHECK: return %[[V2]] : tensor<1025xi64> //CHECK: } -func @apply_lookup_table(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: tensor<16xi64>) -> !Concrete.lwe_ciphertext<1024,4> { +func.func @apply_lookup_table(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: tensor<16xi64>) -> !Concrete.lwe_ciphertext<1024,4> { %0 = "Concrete.glwe_from_table"(%arg1) {glweDimension = 1 : i32, p = 4 : i32, polynomialSize = 1024 : i32} : (tensor<16xi64>) -> !Concrete.glwe_ciphertext<1,1024,4> %1 = "Concrete.keyswitch_lwe"(%arg0) {baseLog = 2 : i32, inputLweDimension = 1 : i32, level = 3 : i32, outputLweDimension = 600 : i32} : (!Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<600,4> %2 = "Concrete.bootstrap_lwe"(%1, %0) {baseLog = 4 : i32, glweDimension = 1 : i32, level = 5 : i32, polynomialSize = 1024 : i32} : (!Concrete.lwe_ciphertext<600,4>, !Concrete.glwe_ciphertext<1,1024,4>) -> !Concrete.lwe_ciphertext<1024,4> diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table_cst.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table_cst.mlir index 03cf14798..d93df777b 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table_cst.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/apply_lookup_table_cst.mlir @@ -1,14 +1,14 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -//CHECK: func @apply_lookup_table_cst(%[[A0:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { +//CHECK: func.func @apply_lookup_table_cst(%[[A0:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { //CHECK: %cst = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : tensor<16xi64> -//CHECK: %[[V0:.*]] = linalg.init_tensor [4096] : tensor<4096xi64> +//CHECK: %[[V0:.*]] = bufferization.alloc_tensor() : tensor<4096xi64> //CHECK: "BConcrete.fill_glwe_from_table"(%[[V0]], %cst) {glweDimension = 1 : i32, outPrecision = 4 : i32, polynomialSize = 2048 : i32} : (tensor<4096xi64>, tensor<16xi64>) -> () //CHECK: %[[V1:.*]] = "BConcrete.keyswitch_lwe_buffer"(%[[A0]]) {baseLog = 2 : i32, inputLweDimension = 1 : i32, level = 3 : i32, outputLweDimension = 600 : i32} : (tensor<2049xi64>) -> tensor<601xi64> //CHECK: %[[V2:.*]] = "BConcrete.bootstrap_lwe_buffer"(%[[V1]], %[[V0]]) {baseLog = 4 : i32, glweDimension = 1 : i32, level = 5 : i32, polynomialSize = 2048 : i32} : (tensor<601xi64>, tensor<4096xi64>) -> tensor<2049xi64> //CHECK: return %[[V2]] : tensor<2049xi64> //CHECK: } -func @apply_lookup_table_cst(%arg0: !Concrete.lwe_ciphertext<2048,4>) -> !Concrete.lwe_ciphertext<2048,4> { +func.func @apply_lookup_table_cst(%arg0: !Concrete.lwe_ciphertext<2048,4>) -> !Concrete.lwe_ciphertext<2048,4> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : tensor<16xi64> %0 = "Concrete.glwe_from_table"(%tlu) {glweDimension = 1 : i32, p = 4 : i32, polynomialSize = 2048 : i32} : (tensor<16xi64>) -> !Concrete.glwe_ciphertext<1, 2048,4> %1 = "Concrete.keyswitch_lwe"(%arg0) {baseLog = 2 : i32, inputLweDimension = 1 : i32, level = 3 : i32, outputLweDimension = 600 : i32} : (!Concrete.lwe_ciphertext<2048,4>) -> !Concrete.lwe_ciphertext<600,4> diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/identity.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/identity.mlir index 806acc81d..3b0224725 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/identity.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/identity.mlir @@ -1,8 +1,8 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -// CHECK: func @identity(%arg0: tensor<1025xi64>) -> tensor<1025xi64> { +// CHECK: func.func @identity(%arg0: tensor<1025xi64>) -> tensor<1025xi64> { // CHECK-NEXT: return %arg0 : tensor<1025xi64> // CHECK-NEXT: } -func @identity(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> { +func.func @identity(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> { return %arg0 : !Concrete.lwe_ciphertext<1024,7> } diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/mul_lwe_int.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/mul_lwe_int.mlir index 1a440a915..48eeadc7a 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/mul_lwe_int.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/mul_lwe_int.mlir @@ -1,25 +1,25 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -//CHECK: func @mul_lwe_const_int(%arg0: tensor<1025xi64>) -> tensor<1025xi64> { +//CHECK: func.func @mul_lwe_const_int(%arg0: tensor<1025xi64>) -> tensor<1025xi64> { //CHECK: %c1_i8 = arith.constant 1 : i8 //CHECK: %0 = arith.extui %c1_i8 : i8 to i64 //CHECK: %1 = "BConcrete.mul_cleartext_lwe_buffer"(%arg0, %0) : (tensor<1025xi64>, i64) -> tensor<1025xi64> //CHECK: return %1 : tensor<1025xi64> //CHECK: } -func @mul_lwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> { +func.func @mul_lwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> { %0 = arith.constant 1 : i8 %1 = "Concrete.int_to_cleartext"(%0) : (i8) -> !Concrete.cleartext<8> %2 = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %1) : (!Concrete.lwe_ciphertext<1024,7>, !Concrete.cleartext<8>) -> !Concrete.lwe_ciphertext<1024,7> return %2 : !Concrete.lwe_ciphertext<1024,7> } -//CHECK: func @mul_lwe_int(%arg0: tensor<1025xi64>, %arg1: i5) -> tensor<1025xi64> { +//CHECK: func.func @mul_lwe_int(%arg0: tensor<1025xi64>, %arg1: i5) -> tensor<1025xi64> { //CHECK: %0 = arith.extui %arg1 : i5 to i64 //CHECK: %1 = "BConcrete.mul_cleartext_lwe_buffer"(%arg0, %0) : (tensor<1025xi64>, i64) -> tensor<1025xi64> //CHECK: return %1 : tensor<1025xi64> //CHECK: } -func @mul_lwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> { +func.func @mul_lwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> { %0 = "Concrete.int_to_cleartext"(%arg1) : (i5) -> !Concrete.cleartext<5> %1 = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %0) : (!Concrete.lwe_ciphertext<1024,4>, !Concrete.cleartext<5>) -> !Concrete.lwe_ciphertext<1024,4> return %1 : !Concrete.lwe_ciphertext<1024,4> diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/neg_lwe.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/neg_lwe.mlir index a5e9e8e50..0f6d9bdd3 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/neg_lwe.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/neg_lwe.mlir @@ -1,10 +1,10 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -//CHECK: func @neg_lwe(%[[A0:.*]]: tensor<1025xi64>) -> tensor<1025xi64> { +//CHECK: func.func @neg_lwe(%[[A0:.*]]: tensor<1025xi64>) -> tensor<1025xi64> { //CHECK: %[[V0:.*]] = "BConcrete.negate_lwe_buffer"(%[[A0]]) : (tensor<1025xi64>) -> tensor<1025xi64> //CHECK: return %[[V0]] : tensor<1025xi64> //CHECK: } -func @neg_lwe(%arg0: !Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> { +func.func @neg_lwe(%arg0: !Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> { %0 = "Concrete.negate_lwe_ciphertext"(%arg0) : (!Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> return %0 : !Concrete.lwe_ciphertext<1024,4> } diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_exapand_collapse_shape.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_exapand_collapse_shape.mlir index 546733f4f..6cf6c66dc 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_exapand_collapse_shape.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_exapand_collapse_shape.mlir @@ -1,25 +1,25 @@ // RUN: concretecompiler --split-input-file --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s // CHECK: func -// DISABLED-CHECK: func @tensor_collapse_shape(%arg0: tensor<2x3x4x5x6x1025xi64>) -> tensor<720x1025xi64> { +// DISABLED-CHECK: func.func @tensor_collapse_shape(%arg0: tensor<2x3x4x5x6x1025xi64>) -> tensor<720x1025xi64> { // DISABLED-CHECK-NEXT: %0 = bufferization.to_memref %arg0 : memref<2x3x4x5x6x1025xi64> // DISABLED-CHECK-NEXT: %1 = memref.collapse_shape %0 [[_:\[\[0, 1, 2, 3, 4\], \[5\]\]]] : memref<2x3x4x5x6x1025xi64> into memref<720x1025xi64> // DISABLED-CHECK-NEXT: %2 = bufferization.to_tensor %1 : memref<720x1025xi64> // DISABLED-CHECK-NEXT: return %2 : tensor<720x1025xi64> -func @tensor_collapse_shape(%arg0: tensor<2x3x4x5x6x!Concrete.lwe_ciphertext<1024,4>>) -> tensor<720x!Concrete.lwe_ciphertext<1024,4>> { +func.func @tensor_collapse_shape(%arg0: tensor<2x3x4x5x6x!Concrete.lwe_ciphertext<1024,4>>) -> tensor<720x!Concrete.lwe_ciphertext<1024,4>> { %0 = tensor.collapse_shape %arg0 [[0, 1, 2, 3, 4]] {MANP = 1 : ui1}: tensor<2x3x4x5x6x!Concrete.lwe_ciphertext<1024,4>> into tensor<720x!Concrete.lwe_ciphertext<1024,4>> return %0 : tensor<720x!Concrete.lwe_ciphertext<1024,4>> } // ----- -// DISABLED-CHECK: func @tensor_collatenspse_shape(%arg0: tensor<2x3x5x1025xi64>) -> tensor<5x6x1025xi64> { +// DISABLED-CHECK: func.func @tensor_collatenspse_shape(%arg0: tensor<2x3x5x1025xi64>) -> tensor<5x6x1025xi64> { // DISABLED-CHECK-NEXT: %0 = bufferization.to_memref %arg0 : memref<2x3x5x1025xi64> // DISABLED-CHECK-NEXT: %1 = memref.collapse_shape %0 [[_:\[\[0, 1, 2\], \[3\]\]]] : memref<2x3x5x1025xi64> into memref<30x1025xi64> // DISABLED-CHECK-NEXT: %2 = memref.expand_shape %1 [[_:\[\[0, 1\], \[2\]\]]] : memref<30x1025xi64> into memref<5x6x1025xi64> // DISABLED-CHECK-NEXT: %3 = bufferization.to_tensor %2 : memref<5x6x1025xi64> // DISABLED-CHECK-NEXT: return %3 : tensor<5x6x1025xi64> -func @tensor_collatenspse_shape(%arg0: tensor<2x3x5x!Concrete.lwe_ciphertext<1024,4>>) -> tensor<5x6x!Concrete.lwe_ciphertext<1024,4>> { +func.func @tensor_collatenspse_shape(%arg0: tensor<2x3x5x!Concrete.lwe_ciphertext<1024,4>>) -> tensor<5x6x!Concrete.lwe_ciphertext<1024,4>> { %0 = tensor.collapse_shape %arg0 [[0, 1, 2]] {MANP = 1 : ui1}: tensor<2x3x5x!Concrete.lwe_ciphertext<1024,4>> into tensor<30x!Concrete.lwe_ciphertext<1024,4>> %1 = tensor.expand_shape %0 [[0, 1]] {MANP = 1 : ui1}: tensor<30x!Concrete.lwe_ciphertext<1024,4>> into tensor<5x6x!Concrete.lwe_ciphertext<1024,4>> return %1 : tensor<5x6x!Concrete.lwe_ciphertext<1024,4>> @@ -27,12 +27,12 @@ func @tensor_collatenspse_shape(%arg0: tensor<2x3x5x!Concrete.lwe_ciphertext<102 // ----- -// DISABLED-CHECK: func @tensor_collatenspse_shape(%arg0: tensor<2x3x2x3x4x1025xi64>) -> tensor<6x2x12x1025xi64> { +// DISABLED-CHECK: func.func @tensor_collatenspse_shape(%arg0: tensor<2x3x2x3x4x1025xi64>) -> tensor<6x2x12x1025xi64> { // DISABLED-CHECK-NEXT: %0 = bufferization.to_memref %arg0 : memref<2x3x2x3x4x1025xi64> // DISABLED-CHECK-NEXT: %1 = memref.collapse_shape %0 [[_:\[\[0, 1\], \[2\], \[3, 4\], \[5\]\]]] : memref<2x3x2x3x4x1025xi64> into memref<6x2x12x1025xi64> // DISABLED-CHECK-NEXT: %2 = bufferization.to_tensor %1 : memref<6x2x12x1025xi64> // DISABLED-CHECK-NEXT: return %2 : tensor<6x2x12x1025xi64> -func @tensor_collatenspse_shape(%arg0: tensor<2x3x2x3x4x!Concrete.lwe_ciphertext<1024,4>>) -> tensor<6x2x12x!Concrete.lwe_ciphertext<1024,4>> { +func.func @tensor_collatenspse_shape(%arg0: tensor<2x3x2x3x4x!Concrete.lwe_ciphertext<1024,4>>) -> tensor<6x2x12x!Concrete.lwe_ciphertext<1024,4>> { %0 = tensor.collapse_shape %arg0 [[0, 1], [2], [3, 4]] {MANP = 1 : ui1}: tensor<2x3x2x3x4x!Concrete.lwe_ciphertext<1024,4>> into tensor<6x2x12x!Concrete.lwe_ciphertext<1024,4>> return %0 : tensor<6x2x12x!Concrete.lwe_ciphertext<1024,4>> } diff --git a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_identity.mlir b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_identity.mlir index 72575df39..ccb542826 100644 --- a/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_identity.mlir +++ b/compiler/tests/check_tests/Conversion/ConcreteToBConcrete/tensor_identity.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes concrete-to-bconcrete --action=dump-bconcrete %s 2>&1| FileCheck %s -// CHECK: func @tensor_identity(%arg0: tensor<2x3x4x1025xi64>) -> tensor<2x3x4x1025xi64> { +// CHECK: func.func @tensor_identity(%arg0: tensor<2x3x4x1025xi64>) -> tensor<2x3x4x1025xi64> { // CHECK-NEXT: return %arg0 : tensor<2x3x4x1025xi64> // CHECK-NEXT: } -func @tensor_identity(%arg0: tensor<2x3x4x!Concrete.lwe_ciphertext<1024,7>>) -> tensor<2x3x4x!Concrete.lwe_ciphertext<1024,7>> { +func.func @tensor_identity(%arg0: tensor<2x3x4x!Concrete.lwe_ciphertext<1024,7>>) -> tensor<2x3x4x!Concrete.lwe_ciphertext<1024,7>> { return %arg0 : tensor<2x3x4x!Concrete.lwe_ciphertext<1024,7>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_lookup_table.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_lookup_table.mlir index d5b27f607..94b9390c9 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_lookup_table.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_lookup_table.mlir @@ -2,8 +2,8 @@ // CHECK: #map = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK-NEXT: module { -// CHECK-NEXT: func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { -// CHECK-NEXT: %0 = linalg.init_tensor [2, 3, 4] : tensor<2x3x4x!FHE.eint<2>> +// CHECK-NEXT: func.func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +// CHECK-NEXT: %0 = bufferization.alloc_tensor() : tensor<2x3x4x!FHE.eint<2>> // CHECK-NEXT: %1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel", "parallel"]} ins(%arg0 : tensor<2x3x4x!FHE.eint<2>>) outs(%0 : tensor<2x3x4x!FHE.eint<2>>) { // CHECK-NEXT: ^bb0(%arg2: !FHE.eint<2>, %arg3: !FHE.eint<2>): // CHECK-NEXT: %2 = "FHE.apply_lookup_table"(%arg2, %arg1) : (!FHE.eint<2>, tensor<4xi64>) -> !FHE.eint<2> @@ -13,7 +13,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } -func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { %1 = "FHELinalg.apply_lookup_table"(%arg0, %arg1): (tensor<2x3x4x!FHE.eint<2>>, tensor<4xi64>) -> (tensor<2x3x4x!FHE.eint<2>>) return %1: tensor<2x3x4x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg.mlir index 3a21715a9..8f0f7a8fb 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg.mlir @@ -5,8 +5,8 @@ //CHECK: #map2 = affine_map<(d0, d1) -> (d0, d1, 1)> //CHECK: #map3 = affine_map<(d0, d1) -> (d0, d1, 2)> //CHECK: #map4 = affine_map<(d0, d1) -> (d0, d1, 3)> -//CHECK: func @multi_lut(%[[A0:.*]]: tensor<4x4x!FHE.eint<2>>, %[[A1:.*]]: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { -//CHECK: %[[V0:.*]] = linalg.init_tensor [4, 4] : tensor<4x4x!FHE.eint<2>> +//CHECK: func.func @multi_lut(%[[A0:.*]]: tensor<4x4x!FHE.eint<2>>, %[[A1:.*]]: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { +//CHECK: %[[V0:.*]] = bufferization.alloc_tensor() : tensor<4x4x!FHE.eint<2>> //CHECK: %[[V1:.*]] = linalg.generic {indexing_maps = [#map0, #map1, #map2, #map3, #map4, #map0], iterator_types = ["parallel", "parallel"]} ins(%[[A0]], %[[A1]], %arg1, %arg1, %arg1 : tensor<4x4x!FHE.eint<2>>, tensor<4x4x4xi64>, tensor<4x4x4xi64>, tensor<4x4x4xi64>, tensor<4x4x4xi64>) outs(%[[V0]] : tensor<4x4x!FHE.eint<2>>) { //CHECK: ^bb0(%[[A2:.*]]: !FHE.eint<2>, %[[A3:.*]]: i64, %[[A4:.*]]: i64, %[[A5:.*]]: i64, %[[A6:.*]]: i64, %[[A7:.*]]: !FHE.eint<2>): //CHECK: %[[V2:.*]] = tensor.from_elements %[[A3]], %[[A4]], %[[A5]], %[[A6]] : tensor<4xi64> @@ -15,7 +15,7 @@ //CHECK: } -> tensor<4x4x!FHE.eint<2>> //CHECK: return %[[V1]] : tensor<4x4x!FHE.eint<2>> //CHECK: } -func @multi_lut(%arg0: tensor<4x4x!FHE.eint<2>>, %arg1: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { +func.func @multi_lut(%arg0: tensor<4x4x!FHE.eint<2>>, %arg1: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { %0 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<4x4x!FHE.eint<2>>, tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> return %0: tensor<4x4x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg_broadcast.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg_broadcast.mlir index 61036fbfb..dffeb009f 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg_broadcast.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/apply_multi_lut_to_linalg_broadcast.mlir @@ -5,8 +5,8 @@ //CHECK: #map2 = affine_map<(d0, d1) -> (d1, 1)> //CHECK: #map3 = affine_map<(d0, d1) -> (d1, 2)> //CHECK: #map4 = affine_map<(d0, d1) -> (d1, 3)> -//CHECK: func @multi_lut(%[[A0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[A1:.*]]: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { -//CHECK: %[[V0:.*]] = linalg.init_tensor [4, 3] : tensor<4x3x!FHE.eint<2>> +//CHECK: func.func @multi_lut(%[[A0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[A1:.*]]: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { +//CHECK: %[[V0:.*]] = bufferization.alloc_tensor() : tensor<4x3x!FHE.eint<2>> //CHECK: %[[V1:.*]] = linalg.generic {indexing_maps = [#map0, #map1, #map2, #map3, #map4, #map0], iterator_types = ["parallel", "parallel"]} ins(%[[A0]], %[[A1]], %arg1, %arg1, %arg1 : tensor<4x3x!FHE.eint<2>>, tensor<3x4xi64>, tensor<3x4xi64>, tensor<3x4xi64>, tensor<3x4xi64>) outs(%[[V0]] : tensor<4x3x!FHE.eint<2>>) { //CHECK: ^bb0(%[[A2:.*]]: !FHE.eint<2>, %[[A3:.*]]: i64, %[[A4:.*]]: i64, %[[A5:.*]]: i64, %[[A6:.*]]: i64, %[[A7:.*]]: !FHE.eint<2>): //CHECK: %[[V2:.*]] = tensor.from_elements %[[A3]], %[[A4]], %[[A5]], %[[A6]] : tensor<4xi64> @@ -15,7 +15,7 @@ //CHECK: } -> tensor<4x3x!FHE.eint<2>> //CHECK: return %[[V1]] : tensor<4x3x!FHE.eint<2>> //CHECK: } -func @multi_lut(%arg0: tensor<4x3x!FHE.eint<2>>, %arg1: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { +func.func @multi_lut(%arg0: tensor<4x3x!FHE.eint<2>>, %arg1: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { %1 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<4x3x!FHE.eint<2>>, tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> return %1: tensor<4x3x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/concat.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/concat.mlir index a9349272d..86529c026 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/concat.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/concat.mlir @@ -2,52 +2,52 @@ // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<7x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0] [3] [1] : tensor<3x!FHE.eint<7>> into tensor<7x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][3] [4] [1] : tensor<4x!FHE.eint<7>> into tensor<7x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<7x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<7x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0] [3] [1] : tensor<3x!FHE.eint<7>> into tensor<7x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][3] [4] [1] : tensor<4x!FHE.eint<7>> into tensor<7x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<7x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0] [3, 4] [1, 1] : tensor<3x4x!FHE.eint<7>> into tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][3, 0] [4, 4] [1, 1] : tensor<4x4x!FHE.eint<7>> into tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) : (tensor<3x4x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> return %0 : tensor<7x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0] [3, 4] [1, 1] : tensor<3x4x!FHE.eint<7>> into tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][3, 0] [4, 4] [1, 1] : tensor<4x4x!FHE.eint<7>> into tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<3x4x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> return %0 : tensor<7x4x!FHE.eint<7>> } @@ -55,65 +55,65 @@ func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x7x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0] [4, 3] [1, 1] : tensor<4x3x!FHE.eint<7>> into tensor<4x7x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][0, 3] [4, 4] [1, 1] : tensor<4x4x!FHE.eint<7>> into tensor<4x7x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<4x7x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<4x3x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { +func.func @main(%x: tensor<4x3x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<4x3x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> return %0 : tensor<4x7x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][2, 0, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> return %0 : tensor<4x3x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][2, 0, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> return %0 : tensor<4x3x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<2x6x4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<2x6x4x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][0, 3, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<2x6x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<2x6x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> return %0 : tensor<2x6x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<2x3x8x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = tensor.insert_slice %[[a0]] into %[[v0]][0, 0, 0] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<2x3x8x!FHE.eint<7>> // CHECK-NEXT: %[[v2:.*]] = tensor.insert_slice %[[a1]] into %[[v1]][0, 0, 4] [2, 3, 4] [1, 1, 1] : tensor<2x3x4x!FHE.eint<7>> into tensor<2x3x8x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : tensor<2x3x8x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 2 } : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> return %0 : tensor<2x3x8x!FHE.eint<7>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/from_element.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/from_element.mlir index 78543be84..d8e4e6a21 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/from_element.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/from_element.mlir @@ -2,22 +2,22 @@ // ----- -// CHECK: func @main(%[[a0:.*]]: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = tensor.from_elements %[[a0]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%arg0: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { %1 = "FHELinalg.from_element"(%arg0) : (!FHE.eint<7>) -> tensor<1x!FHE.eint<7>> return %1 : tensor<1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: i8) -> tensor<1xi8> { +// CHECK: func.func @main(%[[a0:.*]]: i8) -> tensor<1xi8> { // CHECK-NEXT: %[[v0:.*]] = tensor.from_elements %[[a0]] : tensor<1xi8> // CHECK-NEXT: return %[[v0]] : tensor<1xi8> // CHECK-NEXT: } -func @main(%arg0: i8) -> tensor<1xi8> { +func.func @main(%arg0: i8) -> tensor<1xi8> { %1 = "FHELinalg.from_element"(%arg0) : (i8) -> tensor<1xi8> return %1 : tensor<1xi8> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/matmul.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/matmul.mlir index 0f72094ba..806e34466 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/matmul.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/matmul.mlir @@ -6,7 +6,7 @@ // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2) -> (d2, d1)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2) -> (d0, d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<4x2xi6>) -> tensor<3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<4x2xi6>) -> tensor<3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<3x4x!FHE.eint<5>>, tensor<4x2xi6>) outs(%[[v0]] : tensor<3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -16,7 +16,7 @@ // CHECK-NEXT: } -> tensor<3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x4x!FHE.eint<5>>, tensor<4x2xi6>) -> tensor<3x2x!FHE.eint<5>> return %0 : tensor<3x2x!FHE.eint<5>> } @@ -27,7 +27,7 @@ func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<3x2x!FHE. // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1) -> (d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<5>>, %[[a1:.*]]: tensor<3x2xi6>) -> tensor<2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<5>>, %[[a1:.*]]: tensor<3x2xi6>) -> tensor<2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["reduction", "parallel"]} ins(%[[a0]], %[[a1]] : tensor<3x!FHE.eint<5>>, tensor<3x2xi6>) outs(%[[v0]] : tensor<2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -37,7 +37,7 @@ func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<3x2x!FHE. // CHECK-NEXT: } -> tensor<2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<3x2xi6>) -> tensor<2x!FHE.eint<5>> { +func.func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<3x2xi6>) -> tensor<2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<5>>, tensor<3x2xi6>) -> tensor<2x!FHE.eint<5>> return %0 : tensor<2x!FHE.eint<5>> } @@ -48,7 +48,7 @@ func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<3x2xi6>) -> tensor<2x!FHE.eint // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2) -> (d0, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x3x2xi6>) -> tensor<5x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x3x2xi6>) -> tensor<5x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "reduction", "parallel"]} ins(%[[a0]], %[[a1]] : tensor<3x!FHE.eint<5>>, tensor<5x3x2xi6>) outs(%[[v0]] : tensor<5x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -58,7 +58,7 @@ func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<3x2xi6>) -> tensor<2x!FHE.eint // CHECK-NEXT: } -> tensor<5x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<5x3x2xi6>) -> tensor<5x2x!FHE.eint<5>> { +func.func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<5x3x2xi6>) -> tensor<5x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<5>>, tensor<5x3x2xi6>) -> tensor<5x2x!FHE.eint<5>> return %0 : tensor<5x2x!FHE.eint<5>> } @@ -69,7 +69,7 @@ func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<5x3x2xi6>) -> tensor<5x2x!FHE. // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d3)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<5>>, %[[a1:.*]]: tensor<4x5x3x2xi6>) -> tensor<4x5x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<5>>, %[[a1:.*]]: tensor<4x5x3x2xi6>) -> tensor<4x5x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x5x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "reduction", "parallel"]} ins(%[[a0]], %[[a1]] : tensor<3x!FHE.eint<5>>, tensor<4x5x3x2xi6>) outs(%[[v0]] : tensor<4x5x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -79,7 +79,7 @@ func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<5x3x2xi6>) -> tensor<5x2x!FHE. // CHECK-NEXT: } -> tensor<4x5x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<4x5x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<4x5x3x2xi6>) -> tensor<4x5x2x!FHE.eint<5>> { +func.func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<4x5x3x2xi6>) -> tensor<4x5x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<5>>, tensor<4x5x3x2xi6>) -> tensor<4x5x2x!FHE.eint<5>> return %0 : tensor<4x5x2x!FHE.eint<5>> } @@ -90,7 +90,7 @@ func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<4x5x3x2xi6>) -> tensor<4x5x2x! // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1) -> (d1)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1) -> (d0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x2x!FHE.eint<5>>, %[[a1:.*]]: tensor<2xi6>) -> tensor<3x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x2x!FHE.eint<5>>, %[[a1:.*]]: tensor<2xi6>) -> tensor<3x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<3x2x!FHE.eint<5>>, tensor<2xi6>) outs(%[[v0]] : tensor<3x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -100,7 +100,7 @@ func @main(%x: tensor<3x!FHE.eint<5>>, %y: tensor<4x5x3x2xi6>) -> tensor<4x5x2x! // CHECK-NEXT: } -> tensor<3x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<3x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<3x!FHE.eint<5>> { +func.func @main(%x: tensor<3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<3x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x2x!FHE.eint<5>>, tensor<2xi6>) -> tensor<3x!FHE.eint<5>> return %0 : tensor<3x!FHE.eint<5>> } @@ -111,7 +111,7 @@ func @main(%x: tensor<3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<3x!FHE.eint // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2) -> (d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2) -> (d0, d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<5x3x2x!FHE.eint<5>>, %[[a1:.*]]: tensor<2xi6>) -> tensor<5x3x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x3x2x!FHE.eint<5>>, %[[a1:.*]]: tensor<2xi6>) -> tensor<5x3x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x3x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<5x3x2x!FHE.eint<5>>, tensor<2xi6>) outs(%[[v0]] : tensor<5x3x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -121,7 +121,7 @@ func @main(%x: tensor<3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<3x!FHE.eint // CHECK-NEXT: } -> tensor<5x3x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x3x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<5x3x!FHE.eint<5>> { +func.func @main(%x: tensor<5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<5x3x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x3x2x!FHE.eint<5>>, tensor<2xi6>) -> tensor<5x3x!FHE.eint<5>> return %0 : tensor<5x3x!FHE.eint<5>> } @@ -132,7 +132,7 @@ func @main(%x: tensor<5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<5x3x!FHE. // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (d3)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<4x5x3x2x!FHE.eint<5>>, %[[a1:.*]]: tensor<2xi6>) -> tensor<4x5x3x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x5x3x2x!FHE.eint<5>>, %[[a1:.*]]: tensor<2xi6>) -> tensor<4x5x3x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x5x3x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<4x5x3x2x!FHE.eint<5>>, tensor<2xi6>) outs(%[[v0]] : tensor<4x5x3x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -142,7 +142,7 @@ func @main(%x: tensor<5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<5x3x!FHE. // CHECK-NEXT: } -> tensor<4x5x3x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<4x5x3x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<4x5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<4x5x3x!FHE.eint<5>> { +func.func @main(%x: tensor<4x5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<4x5x3x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x5x3x2x!FHE.eint<5>>, tensor<2xi6>) -> tensor<4x5x3x!FHE.eint<5>> return %0 : tensor<4x5x3x!FHE.eint<5>> } @@ -153,7 +153,7 @@ func @main(%x: tensor<4x5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<4x5x3x! // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<5x3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) outs(%[[v0]] : tensor<5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -163,7 +163,7 @@ func @main(%x: tensor<4x5x3x2x!FHE.eint<5>>, %y: tensor<2xi6>) -> tensor<4x5x3x! // CHECK-NEXT: } -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> return %0 : tensor<5x3x2x!FHE.eint<5>> } @@ -174,7 +174,7 @@ func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2 // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (0, d3, d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<1x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<1x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<5x3x4x!FHE.eint<5>>, tensor<1x4x2xi6>) outs(%[[v0]] : tensor<5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -184,7 +184,7 @@ func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2 // CHECK-NEXT: } -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<1x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<1x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x3x4x!FHE.eint<5>>, tensor<1x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> return %0 : tensor<5x3x2x!FHE.eint<5>> } @@ -195,7 +195,7 @@ func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<1x4x2xi6>) -> tensor<5x3x2 // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<1x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<1x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<1x3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) outs(%[[v0]] : tensor<5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -205,7 +205,7 @@ func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<1x4x2xi6>) -> tensor<5x3x2 // CHECK-NEXT: } -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<1x3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> return %0 : tensor<5x3x2x!FHE.eint<5>> } @@ -216,7 +216,7 @@ func @main(%x: tensor<1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2 // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (d3, d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<5x3x4x!FHE.eint<5>>, tensor<4x2xi6>) outs(%[[v0]] : tensor<5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -226,7 +226,7 @@ func @main(%x: tensor<1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2 // CHECK-NEXT: } -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x3x4x!FHE.eint<5>>, tensor<4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> return %0 : tensor<5x3x2x!FHE.eint<5>> } @@ -237,7 +237,7 @@ func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<5x3x2x! // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) outs(%[[v0]] : tensor<5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -247,7 +247,7 @@ func @main(%x: tensor<5x3x4x!FHE.eint<5>>, %y: tensor<4x2xi6>) -> tensor<5x3x2x! // CHECK-NEXT: } -> tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) -> tensor<5x3x2x!FHE.eint<5>> return %0 : tensor<5x3x2x!FHE.eint<5>> } @@ -258,7 +258,7 @@ func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x! // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d4, d3)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d2, d3)> -// CHECK: func @main(%[[a0:.*]]: tensor<2x5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<2x5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x5x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<2x5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<2x5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<2x5x3x4x!FHE.eint<5>>, tensor<2x5x4x2xi6>) outs(%[[v0]] : tensor<2x5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -268,7 +268,7 @@ func @main(%x: tensor<3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<5x3x2x! // CHECK-NEXT: } -> tensor<2x5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<2x5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<2x5x3x4x!FHE.eint<5>>, %y: tensor<2x5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<2x5x3x4x!FHE.eint<5>>, %y: tensor<2x5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x5x3x4x!FHE.eint<5>>, tensor<2x5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> return %0 : tensor<2x5x3x2x!FHE.eint<5>> } @@ -279,7 +279,7 @@ func @main(%x: tensor<2x5x3x4x!FHE.eint<5>>, %y: tensor<2x5x4x2xi6>) -> tensor<2 // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3, d4) -> (d1, d4, d3)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d2, d3)> -// CHECK: func @main(%[[a0:.*]]: tensor<2x1x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x1x3x4x!FHE.eint<5>>, %[[a1:.*]]: tensor<5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<2x5x3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<2x1x3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) outs(%[[v0]] : tensor<2x5x3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -289,7 +289,7 @@ func @main(%x: tensor<2x5x3x4x!FHE.eint<5>>, %y: tensor<2x5x4x2xi6>) -> tensor<2 // CHECK-NEXT: } -> tensor<2x5x3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<2x5x3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<2x1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<2x1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x1x3x4x!FHE.eint<5>>, tensor<5x4x2xi6>) -> tensor<2x5x3x2x!FHE.eint<5>> return %0 : tensor<2x5x3x2x!FHE.eint<5>> } @@ -300,7 +300,7 @@ func @main(%x: tensor<2x1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<2x5 // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2, d3, d4) -> (0, d4, d3)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d2, d3)> -// CHECK: func @main(%[[a0:.*]]: tensor<2x5x4x3x!FHE.eint<5>>, %[[a1:.*]]: tensor<1x3x2xi6>) -> tensor<2x5x4x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x5x4x3x!FHE.eint<5>>, %[[a1:.*]]: tensor<1x3x2xi6>) -> tensor<2x5x4x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<2x5x4x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<2x5x4x3x!FHE.eint<5>>, tensor<1x3x2xi6>) outs(%[[v0]] : tensor<2x5x4x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<5>, %[[aa1:.*]]: i6, %[[aa2:.*]]: !FHE.eint<5>): @@ -310,7 +310,7 @@ func @main(%x: tensor<2x1x3x4x!FHE.eint<5>>, %y: tensor<5x4x2xi6>) -> tensor<2x5 // CHECK-NEXT: } -> tensor<2x5x4x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<2x5x4x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<2x5x4x3x!FHE.eint<5>>, %y: tensor<1x3x2xi6>) -> tensor<2x5x4x2x!FHE.eint<5>> { +func.func @main(%x: tensor<2x5x4x3x!FHE.eint<5>>, %y: tensor<1x3x2xi6>) -> tensor<2x5x4x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x5x4x3x!FHE.eint<5>>, tensor<1x3x2xi6>) -> tensor<2x5x4x2x!FHE.eint<5>> return %0 : tensor<2x5x4x2x!FHE.eint<5>> } @@ -321,7 +321,7 @@ func @main(%x: tensor<2x5x4x3x!FHE.eint<5>>, %y: tensor<1x3x2xi6>) -> tensor<2x5 // CHECK-NEXT: #[[m1:.*]] = affine_map<(d0, d1, d2) -> (d2, d1)> // CHECK-NEXT: #[[m2:.*]] = affine_map<(d0, d1, d2) -> (d0, d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4xi6>, %[[a1:.*]]: tensor<4x2x!FHE.eint<5>>) -> tensor<3x2x!FHE.eint<5>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4xi6>, %[[a1:.*]]: tensor<4x2x!FHE.eint<5>>) -> tensor<3x2x!FHE.eint<5>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x2x!FHE.eint<5>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[m0]], #[[m1]], #[[m2]]], iterator_types = ["parallel", "parallel", "reduction"]} ins(%[[a0]], %[[a1]] : tensor<3x4xi6>, tensor<4x2x!FHE.eint<5>>) outs(%[[v0]] : tensor<3x2x!FHE.eint<5>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: i6, %[[aa1:.*]]: !FHE.eint<5>, %[[aa2:.*]]: !FHE.eint<5>): @@ -331,7 +331,7 @@ func @main(%x: tensor<2x5x4x3x!FHE.eint<5>>, %y: tensor<1x3x2xi6>) -> tensor<2x5 // CHECK-NEXT: } -> tensor<3x2x!FHE.eint<5>> // CHECK-NEXT: return %[[v1]] : tensor<3x2x!FHE.eint<5>> // CHECK-NEXT: } -func @main(%x: tensor<3x4xi6>, %y: tensor<4x2x!FHE.eint<5>>) -> tensor<3x2x!FHE.eint<5>> { +func.func @main(%x: tensor<3x4xi6>, %y: tensor<4x2x!FHE.eint<5>>) -> tensor<3x2x!FHE.eint<5>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3x4xi6>, tensor<4x2x!FHE.eint<5>>) -> tensor<3x2x!FHE.eint<5>> return %0 : tensor<3x2x!FHE.eint<5>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/neg_eint.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/neg_eint.mlir index d32029c30..71dafab87 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/neg_eint.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/neg_eint.mlir @@ -2,8 +2,8 @@ // CHECK: #map = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK-NEXT: module { -// CHECK-NEXT: func @neg_eint(%arg0: tensor<2x3x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> { -// CHECK-NEXT: %0 = linalg.init_tensor [2, 3, 4] : tensor<2x3x4x!FHE.eint<2>> +// CHECK-NEXT: func.func @neg_eint(%arg0: tensor<2x3x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> { +// CHECK-NEXT: %0 = bufferization.alloc_tensor() : tensor<2x3x4x!FHE.eint<2>> // CHECK-NEXT: %1 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel", "parallel"]} ins(%arg0 : tensor<2x3x4x!FHE.eint<2>>) outs(%0 : tensor<2x3x4x!FHE.eint<2>>) { // CHECK-NEXT: ^bb0(%arg1: !FHE.eint<2>, %arg2: !FHE.eint<2>): // CHECK-NEXT: %2 = "FHE.neg_eint"(%arg1) : (!FHE.eint<2>) -> !FHE.eint<2> @@ -13,7 +13,7 @@ // CHECK-NEXT: } // CHECK-NEXT: } -func @neg_eint(%arg0: tensor<2x3x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @neg_eint(%arg0: tensor<2x3x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> { %1 = "FHELinalg.neg_eint"(%arg0): (tensor<2x3x4x!FHE.eint<2>>) -> (tensor<2x3x4x!FHE.eint<2>>) return %1: tensor<2x3x4x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/sum.mlir b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/sum.mlir index b0e85f263..f348dc2cd 100644 --- a/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/sum.mlir +++ b/compiler/tests/check_tests/Conversion/FHELinalgToLinalg/sum.mlir @@ -2,66 +2,66 @@ // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero"() : () -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero"() : () -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> return %0 : tensor<3x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x1x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x1x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> return %0 : tensor<3x1x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x0x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x0x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [2] } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> return %0 : tensor<3x0x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x0x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x0x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [2], keep_dims = true } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> return %0 : tensor<3x0x1x!FHE.eint<7>> } @@ -71,7 +71,7 @@ func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0) -> (d0)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction"]} ins(%[[a0]] : tensor<4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -82,7 +82,7 @@ func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v2:.*]] = tensor.extract %[[v1]][%[[c0]]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -92,7 +92,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0) -> (d0)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction"]} ins(%[[a0]] : tensor<4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -103,7 +103,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v2:.*]] = tensor.extract %[[v1]][%[[c0]]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) { axes = [0] } : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -113,7 +113,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0) -> (d0)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction"]} ins(%[[a0]] : tensor<4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -122,7 +122,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: } -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } @@ -132,7 +132,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0) -> (d0)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction"]} ins(%[[a0]] : tensor<4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -141,7 +141,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0], keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } @@ -151,7 +151,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -162,7 +162,7 @@ func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: %[[v2:.*]] = tensor.extract %[[v1]][%[[c0]]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -172,7 +172,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (0, 0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -181,7 +181,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: } -> tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> return %0 : tensor<1x1x!FHE.eint<7>> } @@ -191,7 +191,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "parallel"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<4x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -200,7 +200,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<4x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0] } : (tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> } @@ -210,7 +210,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (0, d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "parallel"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x4x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -219,7 +219,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<1x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> return %0 : tensor<1x4x!FHE.eint<7>> } @@ -229,7 +229,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["parallel", "reduction"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<3x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -238,7 +238,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<3x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<3x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> return %0 : tensor<3x!FHE.eint<7>> } @@ -248,7 +248,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0, 0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["parallel", "reduction"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<3x1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -257,7 +257,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<3x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<3x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> return %0 : tensor<3x1x!FHE.eint<7>> } @@ -267,7 +267,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -278,7 +278,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v2:.*]] = tensor.extract %[[v1]][%[[c0]]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1] } : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -288,7 +288,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d0, d1)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (0, 0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -297,7 +297,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: } -> tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> return %0 : tensor<1x1x!FHE.eint<7>> } @@ -307,7 +307,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -318,7 +318,7 @@ func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v2:.*]] = tensor.extract %[[v1]][%[[c0]]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -328,7 +328,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (0, 0, 0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x1x1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -337,7 +337,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: } -> tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> return %0 : tensor<1x1x1x!FHE.eint<7>> } @@ -347,7 +347,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (d0, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x2x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["parallel", "reduction", "parallel"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<3x2x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -356,7 +356,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<3x2x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<3x2x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> return %0 : tensor<3x2x!FHE.eint<7>> } @@ -366,7 +366,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (d0, 0, d2)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<3x1x2x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["parallel", "reduction", "parallel"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<3x1x2x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -375,7 +375,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<3x1x2x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<3x1x2x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> return %0 : tensor<3x1x2x!FHE.eint<7>> } @@ -385,7 +385,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (d1)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "parallel", "reduction"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<4x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -394,7 +394,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<4x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> } @@ -404,7 +404,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (0, d1, 0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x4x1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "parallel", "reduction"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x4x1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -413,7 +413,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK-NEXT: } -> tensor<1x4x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x4x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> return %0 : tensor<1x4x1x!FHE.eint<7>> } @@ -423,7 +423,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -434,7 +434,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v2:.*]] = tensor.extract %[[v1]][%[[c0]]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v2]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -444,7 +444,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)> // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2) -> (0, 0, 0)> -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: %[[v1:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["reduction", "reduction", "reduction"]} ins(%[[a0]] : tensor<3x4x2x!FHE.eint<7>>) outs(%[[v0]] : tensor<1x1x1x!FHE.eint<7>>) { // CHECK-NEXT: ^bb0(%[[aa0:.*]]: !FHE.eint<7>, %[[aa1:.*]]: !FHE.eint<7>): @@ -453,7 +453,7 @@ func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: } -> tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v1]] : tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> return %0 : tensor<1x1x1x!FHE.eint<7>> } diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint.mlir index a0aa0bc7d..76491e977 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -// CHECK-LABEL: func @add_eint(%arg0: !TFHE.glwe<{_,_,_}{7}>, %arg1: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> -func @add_eint(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { +// CHECK-LABEL: func.func @add_eint(%arg0: !TFHE.glwe<{_,_,_}{7}>, %arg1: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> +func.func @add_eint(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { // CHECK-NEXT: %[[V1:.*]] = "TFHE.add_glwe"(%arg0, %arg1) : (!TFHE.glwe<{_,_,_}{7}>, !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> // CHECK-NEXT: return %[[V1]] : !TFHE.glwe<{_,_,_}{7}> diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint_int.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint_int.mlir index 781590c24..efa545222 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint_int.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/add_eint_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -// CHECK-LABEL: func @add_eint_int(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> -func @add_eint_int(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +// CHECK-LABEL: func.func @add_eint_int(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> +func.func @add_eint_int(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "TFHE.add_glwe_int"(%arg0, %[[V1]]) : (!TFHE.glwe<{_,_,_}{7}>, i8) -> !TFHE.glwe<{_,_,_}{7}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{_,_,_}{7}> diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate.mlir index bee234017..ec870bfb5 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate.mlir @@ -1,11 +1,11 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -// CHECK: func @apply_lookup_table(%[[A0:.*]]: !TFHE.glwe<{_,_,_}{2}>, %[[LUT:.*]]: tensor<4xi64>) -> !TFHE.glwe<{_,_,_}{3}> { +// CHECK: func.func @apply_lookup_table(%[[A0:.*]]: !TFHE.glwe<{_,_,_}{2}>, %[[LUT:.*]]: tensor<4xi64>) -> !TFHE.glwe<{_,_,_}{3}> { // CHECK-NEXT: %[[V0:.*]] = "TFHE.glwe_from_table"(%[[LUT]]) : (tensor<4xi64>) -> !TFHE.glwe<{_,_,_}{2}> // CHECK-NEXT: %[[V1:.*]] = "TFHE.keyswitch_glwe"(%[[A0]]) {baseLog = -1 : i32, level = -1 : i32} : (!TFHE.glwe<{_,_,_}{2}>) -> !TFHE.glwe<{_,_,_}{2}> // CHECK-NEXT: %[[V2:.*]] = "TFHE.bootstrap_glwe"(%[[V1]], %[[V0]]) {baseLog = -1 : i32, level = -1 : i32} : (!TFHE.glwe<{_,_,_}{2}>, !TFHE.glwe<{_,_,_}{2}>) -> !TFHE.glwe<{_,_,_}{3}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{_,_,_}{3}> -func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<3> { +func.func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<3> { %1 = "FHE.apply_lookup_table"(%arg0, %arg1): (!FHE.eint<2>, tensor<4xi64>) -> (!FHE.eint<3>) return %1: !FHE.eint<3> } diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate_cst.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate_cst.mlir index 543324929..65457547e 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate_cst.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/apply_univariate_cst.mlir @@ -1,13 +1,13 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -//CHECK: func @apply_lookup_table_cst(%[[A0:.*]]: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> { +//CHECK: func.func @apply_lookup_table_cst(%[[A0:.*]]: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> { //CHECK-NEXT: %cst = arith.constant dense<"0x00000000000000000100000000000000020000000000000003000000000000000400000000000000050000000000000006000000000000000700000000000000080000000000000009000000000000000A000000000000000B000000000000000C000000000000000D000000000000000E000000000000000F0000000000000010000000000000001100000000000000120000000000000013000000000000001400000000000000150000000000000016000000000000001700000000000000180000000000000019000000000000001A000000000000001B000000000000001C000000000000001D000000000000001E000000000000001F0000000000000020000000000000002100000000000000220000000000000023000000000000002400000000000000250000000000000026000000000000002700000000000000280000000000000029000000000000002A000000000000002B000000000000002C000000000000002D000000000000002E000000000000002F0000000000000030000000000000003100000000000000320000000000000033000000000000003400000000000000350000000000000036000000000000003700000000000000380000000000000039000000000000003A000000000000003B000000000000003C000000000000003D000000000000003E000000000000003F0000000000000040000000000000004100000000000000420000000000000043000000000000004400000000000000450000000000000046000000000000004700000000000000480000000000000049000000000000004A000000000000004B000000000000004C000000000000004D000000000000004E000000000000004F0000000000000050000000000000005100000000000000520000000000000053000000000000005400000000000000550000000000000056000000000000005700000000000000580000000000000059000000000000005A000000000000005B000000000000005C000000000000005D000000000000005E000000000000005F0000000000000060000000000000006100000000000000620000000000000063000000000000006400000000000000650000000000000066000000000000006700000000000000680000000000000069000000000000006A000000000000006B000000000000006C000000000000006D000000000000006E000000000000006F0000000000000070000000000000007100000000000000720000000000000073000000000000007400000000000000750000000000000076000000000000007700000000000000780000000000000079000000000000007A000000000000007B000000000000007C000000000000007D000000000000007E000000000000007F00000000000000"> : tensor<128xi64> //CHECK-NEXT: %[[V0:.*]] = "TFHE.glwe_from_table"(%cst) : (tensor<128xi64>) -> !TFHE.glwe<{_,_,_}{7}> //CHECK-NEXT: %[[V1:.*]] = "TFHE.keyswitch_glwe"(%[[A0]]) {baseLog = -1 : i32, level = -1 : i32} : (!TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> //CHECK-NEXT: %[[V2:.*]] = "TFHE.bootstrap_glwe"(%[[V1]], %[[V0]]) {baseLog = -1 : i32, level = -1 : i32} : (!TFHE.glwe<{_,_,_}{7}>, !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> //CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{_,_,_}{7}> //CHECK-NEXT: } -func @apply_lookup_table_cst(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @apply_lookup_table_cst(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]> : tensor<128xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<7>, tensor<128xi64>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/conv2d.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/conv2d.mlir index 7483123af..7724223c9 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/conv2d.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/conv2d.mlir @@ -6,7 +6,7 @@ //CHECK-NEXT: #map3 = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d1, d4, d5, d6)> //CHECK-NEXT: #map4 = affine_map<(d0, d1, d2, d3, d4, d5, d6) -> (d0, d1, d2, d3)> //CHECK-NEXT: module { -//CHECK-NEXT: func @conv2d(%arg0: tensor<100x3x28x28x!TFHE.glwe<{_,_,_}{2}>>, %arg1: tensor<4x3x14x14xi3>, %arg2: tensor<4xi3>) -> tensor<100x4x15x15x!TFHE.glwe<{_,_,_}{2}>> { +//CHECK-NEXT: func.func @conv2d(%arg0: tensor<100x3x28x28x!TFHE.glwe<{_,_,_}{2}>>, %arg1: tensor<4x3x14x14xi3>, %arg2: tensor<4xi3>) -> tensor<100x4x15x15x!TFHE.glwe<{_,_,_}{2}>> { //CHECK-NEXT: %0 = "TFHE.zero_tensor"() : () -> tensor<100x4x15x15x!TFHE.glwe<{_,_,_}{2}>> //CHECK-NEXT: %1 = linalg.generic {indexing_maps = [#map0, #map1], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2 : tensor<4xi3>) outs(%0 : tensor<100x4x15x15x!TFHE.glwe<{_,_,_}{2}>>) { //CHECK-NEXT: ^bb0(%arg3: i3, %arg4: !TFHE.glwe<{_,_,_}{2}>): @@ -23,7 +23,7 @@ //CHECK-NEXT: } //CHECK-NEXT: } -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0, 0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/linalg_generic.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/linalg_generic.mlir index d89d6dc24..bbd07171f 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/linalg_generic.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/linalg_generic.mlir @@ -3,7 +3,7 @@ // CHECK: #map0 = affine_map<(d0) -> (d0)> // CHECK-NEXT: #map1 = affine_map<(d0) -> (0)> // CHECK-NEXT: module { -// CHECK-NEXT: func @linalg_generic(%arg0: tensor<2x!TFHE.glwe<{_,_,_}{2}>>, %arg1: tensor<2xi3>, %arg2: tensor<1x!TFHE.glwe<{_,_,_}{2}>>) { +// CHECK-NEXT: func.func @linalg_generic(%arg0: tensor<2x!TFHE.glwe<{_,_,_}{2}>>, %arg1: tensor<2xi3>, %arg2: tensor<1x!TFHE.glwe<{_,_,_}{2}>>) { // CHECK-NEXT: %0 = linalg.generic {indexing_maps = [#map0, #map0, #map1], iterator_types = ["reduction"]} ins(%arg0, %arg1 : tensor<2x!TFHE.glwe<{_,_,_}{2}>>, tensor<2xi3>) outs(%arg2 : tensor<1x!TFHE.glwe<{_,_,_}{2}>>) { // CHECK-NEXT: ^bb0(%arg3: !TFHE.glwe<{_,_,_}{2}>, %arg4: i3, %arg5: !TFHE.glwe<{_,_,_}{2}>): // CHECK-NEXT: %1 = "TFHE.mul_glwe_int"(%arg3, %arg4) : (!TFHE.glwe<{_,_,_}{2}>, i3) -> !TFHE.glwe<{_,_,_}{2}> @@ -17,7 +17,7 @@ #map0 = affine_map<(d0) -> (d0)> #map1 = affine_map<(d0) -> (0)> module { - func @linalg_generic(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>, %acc: tensor<1x!FHE.eint<2>>) { + func.func @linalg_generic(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>, %acc: tensor<1x!FHE.eint<2>>) { %2 = linalg.generic {indexing_maps = [#map0, #map0, #map1], iterator_types = ["reduction"]} ins(%arg0, %arg1 : tensor<2x!FHE.eint<2>>, tensor<2xi3>) outs(%acc : tensor<1x!FHE.eint<2>>) { ^bb0(%arg2: !FHE.eint<2>, %arg3: i3, %arg4: !FHE.eint<2>): // no predecessors %4 = "FHE.mul_eint_int"(%arg2, %arg3) : (!FHE.eint<2>, i3) -> !FHE.eint<2> diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/mul_eint_int.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/mul_eint_int.mlir index dd45dee1f..e226bdd98 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/mul_eint_int.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/mul_eint_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -// CHECK-LABEL: func @mul_eint_int(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> -func @mul_eint_int(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +// CHECK-LABEL: func.func @mul_eint_int(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> +func.func @mul_eint_int(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 2 : i8 // CHECK-NEXT: %[[V2:.*]] = "TFHE.mul_glwe_int"(%arg0, %[[V1]]) : (!TFHE.glwe<{_,_,_}{7}>, i8) -> !TFHE.glwe<{_,_,_}{7}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{_,_,_}{7}> diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/neg_eint.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/neg_eint.mlir index f2fdbc6f6..f188e2115 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/neg_eint.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/neg_eint.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -// CHECK-LABEL: func @neg_eint(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> -func @neg_eint(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +// CHECK-LABEL: func.func @neg_eint(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> +func.func @neg_eint(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { // CHECK-NEXT: %[[V1:.*]] = "TFHE.neg_glwe"(%arg0) : (!TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> // CHECK-NEXT: return %[[V1]] : !TFHE.glwe<{_,_,_}{7}> diff --git a/compiler/tests/check_tests/Conversion/FHEToTFHE/sub_int_eint.mlir b/compiler/tests/check_tests/Conversion/FHEToTFHE/sub_int_eint.mlir index aaec42031..7b46cfc00 100644 --- a/compiler/tests/check_tests/Conversion/FHEToTFHE/sub_int_eint.mlir +++ b/compiler/tests/check_tests/Conversion/FHEToTFHE/sub_int_eint.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler %s --passes fhe-to-tfhe --action=dump-tfhe 2>&1| FileCheck %s -// CHECK-LABEL: func @sub_int_eint(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> -func @sub_int_eint(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +// CHECK-LABEL: func.func @sub_int_eint(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> +func.func @sub_int_eint(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "TFHE.sub_int_glwe"(%[[V1]], %arg0) : (i8, !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{_,_,_}{7}> diff --git a/compiler/tests/check_tests/Conversion/TFHEGlobalParametrization/pbs_ks_bs.mlir b/compiler/tests/check_tests/Conversion/TFHEGlobalParametrization/pbs_ks_bs.mlir index c1be85007..120140a95 100644 --- a/compiler/tests/check_tests/Conversion/TFHEGlobalParametrization/pbs_ks_bs.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEGlobalParametrization/pbs_ks_bs.mlir @@ -1,13 +1,13 @@ // RUN: concretecompiler --passes tfhe-global-parametrization --action=dump-std --v0-parameter=2,10,750,1,23,3,4 -v0-constraint=4,0 %s 2>&1| FileCheck %s -//CHECK: func @main(%[[A0:.*]]: !TFHE.glwe<{2048,1,64}{4}>) -> !TFHE.glwe<{2048,1,64}{4}> { +//CHECK: func.func @main(%[[A0:.*]]: !TFHE.glwe<{2048,1,64}{4}>) -> !TFHE.glwe<{2048,1,64}{4}> { //CHECK: %cst = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : tensor<16xi64> //CHECK: %[[V0:.*]] = "TFHE.glwe_from_table"(%cst) : (tensor<16xi64>) -> !TFHE.glwe<{2,1024,64}{4}> //CHECK: %[[V1:.*]] = "TFHE.keyswitch_glwe"(%[[A0]]) {baseLog = 4 : i32, level = 3 : i32} : (!TFHE.glwe<{2048,1,64}{4}>) -> !TFHE.glwe<{750,1,64}{4}> //CHECK: %[[V2:.*]] = "TFHE.bootstrap_glwe"(%[[V1]], %[[V0]]) {baseLog = 23 : i32, level = 1 : i32} : (!TFHE.glwe<{750,1,64}{4}>, !TFHE.glwe<{2,1024,64}{4}>) -> !TFHE.glwe<{2048,1,64}{4}> //CHECK: return %[[V2]] : !TFHE.glwe<{2048,1,64}{4}> //CHECK: } -func @main(%arg0: !TFHE.glwe<{_,_,_}{4}>) -> !TFHE.glwe<{_,_,_}{4}> { +func.func @main(%arg0: !TFHE.glwe<{_,_,_}{4}>) -> !TFHE.glwe<{_,_,_}{4}> { %cst = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : tensor<16xi64> %0 = "TFHE.glwe_from_table"(%cst) : (tensor<16xi64>) -> !TFHE.glwe<{_,_,_}{4}> %1 = "TFHE.keyswitch_glwe"(%arg0) {baseLog = -1 : i32, level = -1 : i32} : (!TFHE.glwe<{_,_,_}{4}>) -> !TFHE.glwe<{_,_,_}{4}> diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe.mlir index 4896fbd2f..2ecf8db9f 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @add_glwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @add_glwe(%arg0: !TFHE.glwe<{2048,1,64}{7}>, %arg1: !TFHE.glwe<{2048,1,64}{7}>) -> !TFHE.glwe<{2048,1,64}{7}> { +// CHECK-LABEL: func.func @add_glwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @add_glwe(%arg0: !TFHE.glwe<{2048,1,64}{7}>, %arg1: !TFHE.glwe<{2048,1,64}{7}>) -> !TFHE.glwe<{2048,1,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.add_lwe_ciphertexts"(%arg0, %arg1) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe_int.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe_int.mlir index 4a0f2f2d6..0878bb32c 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe_int.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/add_glwe_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @add_glwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> -func @add_glwe_const_int(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{7}> { +// CHECK-LABEL: func.func @add_glwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> +func.func @add_glwe_const_int(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "Concrete.encode_int"(%[[V1]]) : (i8) -> !Concrete.plaintext<8> // CHECK-NEXT: %[[V3:.*]] = "Concrete.add_plaintext_lwe_ciphertext"(%arg0, %[[V2]]) : (!Concrete.lwe_ciphertext<1024,7>, !Concrete.plaintext<8>) -> !Concrete.lwe_ciphertext<1024,7> @@ -12,8 +12,8 @@ func @add_glwe_const_int(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024, } -// CHECK-LABEL: func @add_glwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> -func @add_glwe_int(%arg0: !TFHE.glwe<{1024,1,64}{4}>, %arg1: i5) -> !TFHE.glwe<{1024,1,64}{4}> { +// CHECK-LABEL: func.func @add_glwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> +func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,1,64}{4}>, %arg1: i5) -> !TFHE.glwe<{1024,1,64}{4}> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.encode_int"(%arg1) : (i5) -> !Concrete.plaintext<5> // CHECK-NEXT: %[[V2:.*]] = "Concrete.add_plaintext_lwe_ciphertext"(%arg0, %[[V1]]) : (!Concrete.lwe_ciphertext<1024,4>, !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<1024,4> // CHECK-NEXT: return %[[V2]] : !Concrete.lwe_ciphertext<1024,4> diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/bootstrap.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/bootstrap.mlir index dd2736473..3b91accfc 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/bootstrap.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/bootstrap.mlir @@ -1,12 +1,12 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -//CHECK: func @bootstrap_lwe(%[[A0:.*]]: !Concrete.lwe_ciphertext<600,7>) -> !Concrete.lwe_ciphertext<1024,4> { +//CHECK: func.func @bootstrap_lwe(%[[A0:.*]]: !Concrete.lwe_ciphertext<600,7>) -> !Concrete.lwe_ciphertext<1024,4> { //CHECK: %cst = arith.constant dense<"0x00000000000000000100000000000000020000000000000003000000000000000400000000000000050000000000000006000000000000000700000000000000080000000000000009000000000000000A000000000000000B000000000000000C000000000000000D000000000000000E000000000000000F0000000000000010000000000000001100000000000000120000000000000013000000000000001400000000000000150000000000000016000000000000001700000000000000180000000000000019000000000000001A000000000000001B000000000000001C000000000000001D000000000000001E000000000000001F0000000000000020000000000000002100000000000000220000000000000023000000000000002400000000000000250000000000000026000000000000002700000000000000280000000000000029000000000000002A000000000000002B000000000000002C000000000000002D000000000000002E000000000000002F0000000000000030000000000000003100000000000000320000000000000033000000000000003400000000000000350000000000000036000000000000003700000000000000380000000000000039000000000000003A000000000000003B000000000000003C000000000000003D000000000000003E000000000000003F0000000000000040000000000000004100000000000000420000000000000043000000000000004400000000000000450000000000000046000000000000004700000000000000480000000000000049000000000000004A000000000000004B000000000000004C000000000000004D000000000000004E000000000000004F0000000000000050000000000000005100000000000000520000000000000053000000000000005400000000000000550000000000000056000000000000005700000000000000580000000000000059000000000000005A000000000000005B000000000000005C000000000000005D000000000000005E000000000000005F0000000000000060000000000000006100000000000000620000000000000063000000000000006400000000000000650000000000000066000000000000006700000000000000680000000000000069000000000000006A000000000000006B000000000000006C000000000000006D000000000000006E000000000000006F0000000000000070000000000000007100000000000000720000000000000073000000000000007400000000000000750000000000000076000000000000007700000000000000780000000000000079000000000000007A000000000000007B000000000000007C000000000000007D000000000000007E000000000000007F00000000000000"> : tensor<128xi64> //CHECK: %[[V0:.*]] = "Concrete.glwe_from_table"(%cst) : (tensor<128xi64>) -> !Concrete.glwe_ciphertext<1,1024,7> //CHECK: %[[V1:.*]] = "Concrete.bootstrap_lwe"(%[[A0]], %[[V0]]) {baseLog = 1 : i32, level = 3 : i32} : (!Concrete.lwe_ciphertext<600,7>, !Concrete.glwe_ciphertext<1,1024,7>) -> !Concrete.lwe_ciphertext<1024,4> //CHECK: return %[[V1]] : !Concrete.lwe_ciphertext<1024,4> //CHECK: } -func @bootstrap_lwe(%ciphertext: !TFHE.glwe<{600,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{4}> { +func.func @bootstrap_lwe(%ciphertext: !TFHE.glwe<{600,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{4}> { %cst = arith.constant dense<"0x00000000000000000100000000000000020000000000000003000000000000000400000000000000050000000000000006000000000000000700000000000000080000000000000009000000000000000A000000000000000B000000000000000C000000000000000D000000000000000E000000000000000F0000000000000010000000000000001100000000000000120000000000000013000000000000001400000000000000150000000000000016000000000000001700000000000000180000000000000019000000000000001A000000000000001B000000000000001C000000000000001D000000000000001E000000000000001F0000000000000020000000000000002100000000000000220000000000000023000000000000002400000000000000250000000000000026000000000000002700000000000000280000000000000029000000000000002A000000000000002B000000000000002C000000000000002D000000000000002E000000000000002F0000000000000030000000000000003100000000000000320000000000000033000000000000003400000000000000350000000000000036000000000000003700000000000000380000000000000039000000000000003A000000000000003B000000000000003C000000000000003D000000000000003E000000000000003F0000000000000040000000000000004100000000000000420000000000000043000000000000004400000000000000450000000000000046000000000000004700000000000000480000000000000049000000000000004A000000000000004B000000000000004C000000000000004D000000000000004E000000000000004F0000000000000050000000000000005100000000000000520000000000000053000000000000005400000000000000550000000000000056000000000000005700000000000000580000000000000059000000000000005A000000000000005B000000000000005C000000000000005D000000000000005E000000000000005F0000000000000060000000000000006100000000000000620000000000000063000000000000006400000000000000650000000000000066000000000000006700000000000000680000000000000069000000000000006A000000000000006B000000000000006C000000000000006D000000000000006E000000000000006F0000000000000070000000000000007100000000000000720000000000000073000000000000007400000000000000750000000000000076000000000000007700000000000000780000000000000079000000000000007A000000000000007B000000000000007C000000000000007D000000000000007E000000000000007F00000000000000"> : tensor<128xi64> %glwe_lut = "TFHE.glwe_from_table"(%cst) : (tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> %bootstraped = "TFHE.bootstrap_glwe"(%ciphertext, %glwe_lut) {baseLog = 1 : i32, glweDimension = 1 : i32, level = 3 : i32, polynomialSize = 1024 : i32} : (!TFHE.glwe<{600,1,64}{7}>, !TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1024,1,64}{4}> diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/glwe_from_table.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/glwe_from_table.mlir index d788d56d3..ada1db3ff 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/glwe_from_table.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/glwe_from_table.mlir @@ -1,11 +1,11 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -//CHECK: func @glwe_from_table() { +//CHECK: func.func @glwe_from_table() { //CHECK-NEXT: %[[V0:.*]] = arith.constant dense<"0x00000000000000000100000000000000020000000000000003000000000000000400000000000000050000000000000006000000000000000700000000000000080000000000000009000000000000000A000000000000000B000000000000000C000000000000000D000000000000000E000000000000000F0000000000000010000000000000001100000000000000120000000000000013000000000000001400000000000000150000000000000016000000000000001700000000000000180000000000000019000000000000001A000000000000001B000000000000001C000000000000001D000000000000001E000000000000001F0000000000000020000000000000002100000000000000220000000000000023000000000000002400000000000000250000000000000026000000000000002700000000000000280000000000000029000000000000002A000000000000002B000000000000002C000000000000002D000000000000002E000000000000002F0000000000000030000000000000003100000000000000320000000000000033000000000000003400000000000000350000000000000036000000000000003700000000000000380000000000000039000000000000003A000000000000003B000000000000003C000000000000003D000000000000003E000000000000003F0000000000000040000000000000004100000000000000420000000000000043000000000000004400000000000000450000000000000046000000000000004700000000000000480000000000000049000000000000004A000000000000004B000000000000004C000000000000004D000000000000004E000000000000004F0000000000000050000000000000005100000000000000520000000000000053000000000000005400000000000000550000000000000056000000000000005700000000000000580000000000000059000000000000005A000000000000005B000000000000005C000000000000005D000000000000005E000000000000005F0000000000000060000000000000006100000000000000620000000000000063000000000000006400000000000000650000000000000066000000000000006700000000000000680000000000000069000000000000006A000000000000006B000000000000006C000000000000006D000000000000006E000000000000006F0000000000000070000000000000007100000000000000720000000000000073000000000000007400000000000000750000000000000076000000000000007700000000000000780000000000000079000000000000007A000000000000007B000000000000007C000000000000007D000000000000007E000000000000007F00000000000000"> : tensor<128xi64> //CHECK-NEXT: %[[V1:.*]] = "Concrete.glwe_from_table"(%[[V0]]) : (tensor<128xi64>) -> !Concrete.glwe_ciphertext<1,1024,7> //CHECK-NEXT: return //CHECK-NEXT: } -func @glwe_from_table() { +func.func @glwe_from_table() { %cst = arith.constant dense<"0x00000000000000000100000000000000020000000000000003000000000000000400000000000000050000000000000006000000000000000700000000000000080000000000000009000000000000000A000000000000000B000000000000000C000000000000000D000000000000000E000000000000000F0000000000000010000000000000001100000000000000120000000000000013000000000000001400000000000000150000000000000016000000000000001700000000000000180000000000000019000000000000001A000000000000001B000000000000001C000000000000001D000000000000001E000000000000001F0000000000000020000000000000002100000000000000220000000000000023000000000000002400000000000000250000000000000026000000000000002700000000000000280000000000000029000000000000002A000000000000002B000000000000002C000000000000002D000000000000002E000000000000002F0000000000000030000000000000003100000000000000320000000000000033000000000000003400000000000000350000000000000036000000000000003700000000000000380000000000000039000000000000003A000000000000003B000000000000003C000000000000003D000000000000003E000000000000003F0000000000000040000000000000004100000000000000420000000000000043000000000000004400000000000000450000000000000046000000000000004700000000000000480000000000000049000000000000004A000000000000004B000000000000004C000000000000004D000000000000004E000000000000004F0000000000000050000000000000005100000000000000520000000000000053000000000000005400000000000000550000000000000056000000000000005700000000000000580000000000000059000000000000005A000000000000005B000000000000005C000000000000005D000000000000005E000000000000005F0000000000000060000000000000006100000000000000620000000000000063000000000000006400000000000000650000000000000066000000000000006700000000000000680000000000000069000000000000006A000000000000006B000000000000006C000000000000006D000000000000006E000000000000006F0000000000000070000000000000007100000000000000720000000000000073000000000000007400000000000000750000000000000076000000000000007700000000000000780000000000000079000000000000007A000000000000007B000000000000007C000000000000007D000000000000007E000000000000007F00000000000000"> : tensor<128xi64> %0 = "TFHE.glwe_from_table"(%cst) : (tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> return diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/keyswitch.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/keyswitch.mlir index 4642f1b86..4517f08c0 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/keyswitch.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/keyswitch.mlir @@ -1,10 +1,10 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK: func @keyswitch_glwe(%[[A0:.*]]: !Concrete.lwe_ciphertext<1024,2>) -> !Concrete.lwe_ciphertext<567,2> { +// CHECK: func.func @keyswitch_glwe(%[[A0:.*]]: !Concrete.lwe_ciphertext<1024,2>) -> !Concrete.lwe_ciphertext<567,2> { // CHECK-NEXT: %[[V0:.*]] = "Concrete.keyswitch_lwe"(%[[A0]]) {baseLog = 3 : i32, level = 2 : i32} : (!Concrete.lwe_ciphertext<1024,2>) -> !Concrete.lwe_ciphertext<567,2> // CHECK-NEXT: return %[[V0]] : !Concrete.lwe_ciphertext<567,2> // CHECK-NEXT: } -func @keyswitch_glwe(%arg0: !TFHE.glwe<{1024,1,64}{2}>) -> !TFHE.glwe<{567,1,64}{2}> { +func.func @keyswitch_glwe(%arg0: !TFHE.glwe<{1024,1,64}{2}>) -> !TFHE.glwe<{567,1,64}{2}> { %0 = "TFHE.keyswitch_glwe"(%arg0) {baseLog = 3 : i32, level = 2 : i32} : (!TFHE.glwe<{1024,1,64}{2}>) -> !TFHE.glwe<{567,1,64}{2}> return %0 : !TFHE.glwe<{567,1,64}{2}> } diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/mul_glwe_int.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/mul_glwe_int.mlir index 859285549..720212115 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/mul_glwe_int.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/mul_glwe_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @mul_glwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> -func @mul_glwe_const_int(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{7}> { +// CHECK-LABEL: func.func @mul_glwe_const_int(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> +func.func @mul_glwe_const_int(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "Concrete.int_to_cleartext"(%[[V1]]) : (i8) -> !Concrete.cleartext<8> // CHECK-NEXT: %[[V3:.*]] = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %[[V2]]) : (!Concrete.lwe_ciphertext<1024,7>, !Concrete.cleartext<8>) -> !Concrete.lwe_ciphertext<1024,7> @@ -12,8 +12,8 @@ func @mul_glwe_const_int(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024, } -// CHECK-LABEL: func @mul_glwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> -func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,1,64}{4}>, %arg1: i5) -> !TFHE.glwe<{1024,1,64}{4}> { +// CHECK-LABEL: func.func @mul_glwe_int(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> +func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,1,64}{4}>, %arg1: i5) -> !TFHE.glwe<{1024,1,64}{4}> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.int_to_cleartext"(%arg1) : (i5) -> !Concrete.cleartext<5> // CHECK-NEXT: %[[V2:.*]] = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %[[V1]]) : (!Concrete.lwe_ciphertext<1024,4>, !Concrete.cleartext<5>) -> !Concrete.lwe_ciphertext<1024,4> // CHECK-NEXT: return %[[V2]] : !Concrete.lwe_ciphertext<1024,4> diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/neg_glwe.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/neg_glwe.mlir index 843e68958..7ae9e711e 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/neg_glwe.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/neg_glwe.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @neg_glwe(%arg0: !Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> -func @neg_glwe(%arg0: !TFHE.glwe<{1024,1,64}{4}>) -> !TFHE.glwe<{1024,1,64}{4}> { +// CHECK-LABEL: func.func @neg_glwe(%arg0: !Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> +func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,1,64}{4}>) -> !TFHE.glwe<{1024,1,64}{4}> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.negate_lwe_ciphertext"(%arg0) : (!Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<1024,4> %1 = "TFHE.neg_glwe"(%arg0): (!TFHE.glwe<{1024,1,64}{4}>) -> (!TFHE.glwe<{1024,1,64}{4}>) diff --git a/compiler/tests/check_tests/Conversion/TFHEToConcrete/sub_int_glwe.mlir b/compiler/tests/check_tests/Conversion/TFHEToConcrete/sub_int_glwe.mlir index b1374fff3..593e889c3 100644 --- a/compiler/tests/check_tests/Conversion/TFHEToConcrete/sub_int_glwe.mlir +++ b/compiler/tests/check_tests/Conversion/TFHEToConcrete/sub_int_glwe.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --passes tfhe-to-concrete --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @sub_const_int_glwe(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> -func @sub_const_int_glwe(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{7}> { +// CHECK-LABEL: func.func @sub_const_int_glwe(%arg0: !Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> +func.func @sub_const_int_glwe(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024,1,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[NEG:.*]] = "Concrete.negate_lwe_ciphertext"(%arg0) : (!Concrete.lwe_ciphertext<1024,7>) -> !Concrete.lwe_ciphertext<1024,7> // CHECK-NEXT: %[[V2:.*]] = "Concrete.encode_int"(%[[V1]]) : (i8) -> !Concrete.plaintext<8> @@ -12,8 +12,8 @@ func @sub_const_int_glwe(%arg0: !TFHE.glwe<{1024,1,64}{7}>) -> !TFHE.glwe<{1024, return %1: !TFHE.glwe<{1024,1,64}{7}> } -// CHECK-LABEL: func @sub_int_glwe(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> -func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,1,64}{4}>, %arg1: i5) -> !TFHE.glwe<{1024,1,64}{4}> { +// CHECK-LABEL: func.func @sub_int_glwe(%arg0: !Concrete.lwe_ciphertext<1024,4>, %arg1: i5) -> !Concrete.lwe_ciphertext<1024,4> +func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,1,64}{4}>, %arg1: i5) -> !TFHE.glwe<{1024,1,64}{4}> { // CHECK-NEXT: %[[NEG:.*]] = "Concrete.negate_lwe_ciphertext"(%arg0) : (!Concrete.lwe_ciphertext<1024,4>) -> !Concrete.lwe_ciphertext<1024,4> // CHECK-NEXT: %[[V1:.*]] = "Concrete.encode_int"(%arg1) : (i5) -> !Concrete.plaintext<5> // CHECK-NEXT: %[[V2:.*]] = "Concrete.add_plaintext_lwe_ciphertext"(%[[NEG]], %[[V1]]) : (!Concrete.lwe_ciphertext<1024,4>, !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<1024,4> diff --git a/compiler/tests/check_tests/Dialect/BConcrete/ops.mlir b/compiler/tests/check_tests/Dialect/BConcrete/ops.mlir index c1ad4de70..7ce0e30b8 100644 --- a/compiler/tests/check_tests/Dialect/BConcrete/ops.mlir +++ b/compiler/tests/check_tests/Dialect/BConcrete/ops.mlir @@ -1,55 +1,55 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -//CHECK: func @add_lwe_ciphertexts(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { +//CHECK: func.func @add_lwe_ciphertexts(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.add_lwe_buffer"(%[[A0]], %[[A1]]) : (tensor<2049xi64>, tensor<2049xi64>) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @add_lwe_ciphertexts(%arg0: tensor<2049xi64>, %arg1: tensor<2049xi64>) -> tensor<2049xi64> { +func.func @add_lwe_ciphertexts(%arg0: tensor<2049xi64>, %arg1: tensor<2049xi64>) -> tensor<2049xi64> { %0 = "BConcrete.add_lwe_buffer"(%arg0, %arg1) : (tensor<2049xi64>, tensor<2049xi64>) -> ( tensor<2049xi64>) return %0 : tensor<2049xi64> } -//CHECK: func @add_plaintext_lwe_ciphertext(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: i64) -> tensor<2049xi64> { +//CHECK: func.func @add_plaintext_lwe_ciphertext(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: i64) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.add_plaintext_lwe_buffer"(%[[A0]], %[[A1]]) : (tensor<2049xi64>, i64) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @add_plaintext_lwe_ciphertext(%arg0: tensor<2049xi64>, %arg1: i64) -> tensor<2049xi64> { +func.func @add_plaintext_lwe_ciphertext(%arg0: tensor<2049xi64>, %arg1: i64) -> tensor<2049xi64> { %0 = "BConcrete.add_plaintext_lwe_buffer"(%arg0, %arg1) : (tensor<2049xi64>, i64) -> ( tensor<2049xi64>) return %0 : tensor<2049xi64> } -//CHECK: func @mul_cleartext_lwe_ciphertext(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: i64) -> tensor<2049xi64> { +//CHECK: func.func @mul_cleartext_lwe_ciphertext(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: i64) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.mul_cleartext_lwe_buffer"(%[[A0]], %[[A1]]) : (tensor<2049xi64>, i64) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @mul_cleartext_lwe_ciphertext(%arg0: tensor<2049xi64>, %arg1: i64) -> tensor<2049xi64> { +func.func @mul_cleartext_lwe_ciphertext(%arg0: tensor<2049xi64>, %arg1: i64) -> tensor<2049xi64> { %0 = "BConcrete.mul_cleartext_lwe_buffer"(%arg0, %arg1) : (tensor<2049xi64>, i64) -> (tensor<2049xi64>) return %0 : tensor<2049xi64> } -//CHECK: func @negate_lwe_ciphertext(%[[A0:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { +//CHECK: func.func @negate_lwe_ciphertext(%[[A0:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.negate_lwe_buffer"(%[[A0]]) : (tensor<2049xi64>) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @negate_lwe_ciphertext(%arg0: tensor<2049xi64>) -> tensor<2049xi64> { +func.func @negate_lwe_ciphertext(%arg0: tensor<2049xi64>) -> tensor<2049xi64> { %0 = "BConcrete.negate_lwe_buffer"(%arg0) : (tensor<2049xi64>) -> (tensor<2049xi64>) return %0 : tensor<2049xi64> } -//CHECK: func @bootstrap_lwe(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: tensor<4096xi64>) -> tensor<2049xi64> { +//CHECK: func.func @bootstrap_lwe(%[[A0:.*]]: tensor<2049xi64>, %[[A1:.*]]: tensor<4096xi64>) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.bootstrap_lwe_buffer"(%[[A0]], %[[A1]]) {baseLog = -1 : i32, glweDimension = 1 : i32, level = -1 : i32, polynomialSize = 1024 : i32} : (tensor<2049xi64>, tensor<4096xi64>) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @bootstrap_lwe(%arg0: tensor<2049xi64>, %arg1: tensor<4096xi64>) -> tensor<2049xi64> { +func.func @bootstrap_lwe(%arg0: tensor<2049xi64>, %arg1: tensor<4096xi64>) -> tensor<2049xi64> { %0 = "BConcrete.bootstrap_lwe_buffer"(%arg0, %arg1) {baseLog = -1 : i32, glweDimension = 1 : i32, level = -1 : i32, polynomialSize = 1024 : i32} : (tensor<2049xi64>, tensor<4096xi64>) -> (tensor<2049xi64>) return %0 : tensor<2049xi64> } -//CHECK: func @keyswitch_lwe(%[[A0:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { +//CHECK: func.func @keyswitch_lwe(%[[A0:.*]]: tensor<2049xi64>) -> tensor<2049xi64> { //CHECK: %[[V0:.*]] = "BConcrete.keyswitch_lwe_buffer"(%[[A0]]) {baseLog = 2 : i32, inputLweDimension = 1 : i32, level = 3 : i32, outputLweDimension = 1 : i32} : (tensor<2049xi64>) -> tensor<2049xi64> //CHECK: return %[[V0]] : tensor<2049xi64> //CHECK: } -func @keyswitch_lwe(%arg0: tensor<2049xi64>) -> tensor<2049xi64> { +func.func @keyswitch_lwe(%arg0: tensor<2049xi64>) -> tensor<2049xi64> { %0 = "BConcrete.keyswitch_lwe_buffer"(%arg0) {baseLog = 2 : i32, inputLweDimension = 1 : i32, level = 3 : i32, outputLweDimension = 1 : i32} : (tensor<2049xi64>) -> (tensor<2049xi64>) return %0 : tensor<2049xi64> } diff --git a/compiler/tests/check_tests/Dialect/Concrete/no_optimization.mlir b/compiler/tests/check_tests/Dialect/Concrete/no_optimization.mlir index 4b8a8ca2e..e90c87268 100644 --- a/compiler/tests/check_tests/Dialect/Concrete/no_optimization.mlir +++ b/compiler/tests/check_tests/Dialect/Concrete/no_optimization.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --optimize-concrete=false --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V0:.*]] = arith.constant 0 : i7 // CHECK-NEXT: %[[V1:.*]] = "Concrete.int_to_cleartext"(%[[V0]]) : (i7) -> !Concrete.cleartext<7> // CHECK-NEXT: %[[V2:.*]] = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %[[V1]]) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> diff --git a/compiler/tests/check_tests/Dialect/Concrete/ops.mlir b/compiler/tests/check_tests/Dialect/Concrete/ops.mlir index 2b3e1455e..5aff8aa08 100644 --- a/compiler/tests/check_tests/Dialect/Concrete/ops.mlir +++ b/compiler/tests/check_tests/Dialect/Concrete/ops.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @add_lwe_ciphertexts(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @add_lwe_ciphertexts(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @add_lwe_ciphertexts(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @add_lwe_ciphertexts(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.add_lwe_ciphertexts"(%arg0, %arg1) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> @@ -9,8 +9,8 @@ func @add_lwe_ciphertexts(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concr return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @add_plaintext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<2048,7> -func @add_plaintext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @add_plaintext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @add_plaintext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.add_plaintext_lwe_ciphertext"(%arg0, %arg1) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.plaintext<5>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> @@ -18,8 +18,8 @@ func @add_plaintext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> -func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %arg1) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> @@ -27,8 +27,8 @@ func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @negate_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @negate_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @negate_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @negate_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.negate_lwe_ciphertext"(%arg0) : (!Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> @@ -36,24 +36,24 @@ func @negate_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concret return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @bootstrap_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.glwe_ciphertext<2048,1,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @bootstrap_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.glwe_ciphertext<2048,1,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @bootstrap_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.glwe_ciphertext<2048,1,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @bootstrap_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.glwe_ciphertext<2048,1,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.bootstrap_lwe"(%arg0, %arg1) {baseLog = -1 : i32, glweDimension = 1 : i32, level = -1 : i32, polynomialSize = 2048 : i32} : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.glwe_ciphertext<2048,1,7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> %1 = "Concrete.bootstrap_lwe"(%arg0, %arg1) {baseLog = -1 : i32, glweDimension = 1 : i32, level = -1 : i32, polynomialSize = 2048 : i32} : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.glwe_ciphertext<2048,1,7>) -> !Concrete.lwe_ciphertext<2048,7> return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @keyswitch_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @keyswitch_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @keyswitch_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @keyswitch_lwe(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.keyswitch_lwe"(%arg0) {baseLog = 2 : i32, level = 3 : i32} : (!Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> %1 = "Concrete.keyswitch_lwe"(%arg0){baseLog = 2 : i32, level = 3 : i32}: (!Concrete.lwe_ciphertext<2048,7>) -> (!Concrete.lwe_ciphertext<2048,7>) return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @encode_int(%arg0: i6) -> !Concrete.plaintext<6> -func @encode_int(%arg0: i6) -> (!Concrete.plaintext<6>) { +// CHECK-LABEL: func.func @encode_int(%arg0: i6) -> !Concrete.plaintext<6> +func.func @encode_int(%arg0: i6) -> (!Concrete.plaintext<6>) { // CHECK-NEXT: %[[V1:.*]] = "Concrete.encode_int"(%arg0) : (i6) -> !Concrete.plaintext<6> // CHECK-NEXT: return %[[V1]] : !Concrete.plaintext<6> @@ -61,8 +61,8 @@ func @encode_int(%arg0: i6) -> (!Concrete.plaintext<6>) { return %0: !Concrete.plaintext<6> } -// CHECK-LABEL: func @int_to_cleartext() -> !Concrete.cleartext<6> -func @int_to_cleartext() -> !Concrete.cleartext<6> { +// CHECK-LABEL: func.func @int_to_cleartext() -> !Concrete.cleartext<6> +func.func @int_to_cleartext() -> !Concrete.cleartext<6> { // CHECK-NEXT: %[[V0:.*]] = arith.constant 5 : i6 // CHECK-NEXT: %[[V1:.*]] = "Concrete.int_to_cleartext"(%[[V0]]) : (i6) -> !Concrete.cleartext<6> // CHECK-NEXT: return %[[V1]] : !Concrete.cleartext<6> diff --git a/compiler/tests/check_tests/Dialect/Concrete/optimization.mlir b/compiler/tests/check_tests/Dialect/Concrete/optimization.mlir index 14523d1d3..5aba799b8 100644 --- a/compiler/tests/check_tests/Dialect/Concrete/optimization.mlir +++ b/compiler/tests/check_tests/Dialect/Concrete/optimization.mlir @@ -1,8 +1,8 @@ // RUN: concretecompiler --action=dump-concrete %s 2>&1| FileCheck %s -// CHECK-LABEL: func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> - func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> + func.func @mul_cleartext_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>, %arg1: !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.mul_cleartext_lwe_ciphertext"(%arg0, %arg1) : (!Concrete.lwe_ciphertext<2048,7>, !Concrete.cleartext<7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> @@ -10,8 +10,8 @@ return %1: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.zero"() : () -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> @@ -21,8 +21,8 @@ func @mul_cleartext_lwe_ciphertext_0(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> return %2: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @mul_cleartext_lwe_ciphertext_minus_1(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @mul_cleartext_lwe_ciphertext_minus_1(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @mul_cleartext_lwe_ciphertext_minus_1(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @mul_cleartext_lwe_ciphertext_minus_1(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: %[[V1:.*]] = "Concrete.negate_lwe_ciphertext"(%arg0) : (!Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> // CHECK-NEXT: return %[[V1]] : !Concrete.lwe_ciphertext<2048,7> diff --git a/compiler/tests/check_tests/Dialect/Concrete/types.mlir b/compiler/tests/check_tests/Dialect/Concrete/types.mlir index f1f217f38..0ec07ef2e 100644 --- a/compiler/tests/check_tests/Dialect/Concrete/types.mlir +++ b/compiler/tests/check_tests/Dialect/Concrete/types.mlir @@ -1,20 +1,20 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @type_plaintext(%arg0: !Concrete.plaintext<7>) -> !Concrete.plaintext<7> -func @type_plaintext(%arg0: !Concrete.plaintext<7>) -> !Concrete.plaintext<7> { +// CHECK-LABEL: func.func @type_plaintext(%arg0: !Concrete.plaintext<7>) -> !Concrete.plaintext<7> +func.func @type_plaintext(%arg0: !Concrete.plaintext<7>) -> !Concrete.plaintext<7> { // CHECK-NEXT: return %arg0 : !Concrete.plaintext<7> return %arg0: !Concrete.plaintext<7> } -// CHECK-LABEL: func @type_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> -func @type_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { +// CHECK-LABEL: func.func @type_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> +func.func @type_lwe_ciphertext(%arg0: !Concrete.lwe_ciphertext<2048,7>) -> !Concrete.lwe_ciphertext<2048,7> { // CHECK-NEXT: return %arg0 : !Concrete.lwe_ciphertext<2048,7> return %arg0: !Concrete.lwe_ciphertext<2048,7> } -// CHECK-LABEL: func @type_cleartext(%arg0: !Concrete.cleartext<5>) -> !Concrete.cleartext<5> -func @type_cleartext(%arg0: !Concrete.cleartext<5>) -> !Concrete.cleartext<5> { +// CHECK-LABEL: func.func @type_cleartext(%arg0: !Concrete.cleartext<5>) -> !Concrete.cleartext<5> +func.func @type_cleartext(%arg0: !Concrete.cleartext<5>) -> !Concrete.cleartext<5> { // CHECK-NEXT: return %arg0 : !Concrete.cleartext<5> return %arg0: !Concrete.cleartext<5> } diff --git a/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP.mlir b/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP.mlir index 00c8653f3..0d1664270 100644 --- a/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP.mlir @@ -1,6 +1,6 @@ // RUN: concretecompiler --passes MANP --action=dump-fhe --split-input-file %s 2>&1 | FileCheck %s -func @single_zero() -> !FHE.eint<2> +func.func @single_zero() -> !FHE.eint<2> { // CHECK: %[[ret:.*]] = "FHE.zero"() {MANP = 1 : ui{{[[0-9]+}}} : () -> !FHE.eint<2> %0 = "FHE.zero"() : () -> !FHE.eint<2> @@ -10,7 +10,7 @@ func @single_zero() -> !FHE.eint<2> // ----- -func @zero() -> tensor<8x!FHE.eint<2>> +func.func @zero() -> tensor<8x!FHE.eint<2>> { // CHECK: %[[ret:.*]] = "FHE.zero_tensor"() {MANP = 1 : ui{{[0-9]+}}} : () -> tensor<8x!FHE.eint<2>> %0 = "FHE.zero_tensor"() : () -> tensor<8x!FHE.eint<2>> @@ -20,7 +20,7 @@ func @zero() -> tensor<8x!FHE.eint<2>> // ----- -func @single_cst_add_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_add_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant 3 : i3 @@ -32,7 +32,7 @@ func @single_cst_add_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_cst_add_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_add_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant -3 : i3 @@ -44,7 +44,7 @@ func @single_cst_add_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_dyn_add_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> +func.func @single_dyn_add_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> { // sqrt(1 + (2^2-1)^2) = 3.16 // CHECK: %[[ret:.*]] = "FHE.add_eint_int"(%[[op0:.*]], %[[op1:.*]]) {MANP = 4 : ui{{[0-9]+}}} : (!FHE.eint<2>, i3) -> !FHE.eint<2> @@ -55,7 +55,7 @@ func @single_dyn_add_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> // ----- -func @single_add_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_add_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK: %[[ret:.*]] = "FHE.add_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 2 : ui{{[0-9]+}}} : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> %0 = "FHE.add_eint"(%e0, %e1) : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> @@ -65,7 +65,7 @@ func @single_add_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_cst_sub_int_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_sub_int_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant 3 : i3 @@ -77,7 +77,7 @@ func @single_cst_sub_int_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_cst_sub_int_eint_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_sub_int_eint_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant -3 : i3 @@ -89,7 +89,7 @@ func @single_cst_sub_int_eint_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_dyn_sub_int_eint(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> +func.func @single_dyn_sub_int_eint(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> { // sqrt(1 + (2^2-1)^2) = 3.16 // CHECK: %[[ret:.*]] = "FHE.sub_int_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 4 : ui{{[0-9]+}}} : (i3, !FHE.eint<2>) -> !FHE.eint<2> @@ -100,7 +100,7 @@ func @single_dyn_sub_int_eint(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> // ----- -func @single_cst_sub_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_sub_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant 3 : i3 @@ -112,7 +112,7 @@ func @single_cst_sub_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_cst_sub_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_sub_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant -3 : i3 @@ -124,7 +124,7 @@ func @single_cst_sub_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_dyn_sub_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> +func.func @single_dyn_sub_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> { // sqrt(1 + (2^2-1)^2) = 3.16 // CHECK: %[[ret:.*]] = "FHE.sub_eint_int"(%[[op0:.*]], %[[op1:.*]]) {MANP = 4 : ui{{[0-9]+}}} : (!FHE.eint<2>, i3) -> !FHE.eint<2> @@ -135,7 +135,7 @@ func @single_dyn_sub_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> // ----- -func @chain_sub_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>, %e2: !FHE.eint<2>, %e3: !FHE.eint<2>, %e4: !FHE.eint<2>) -> !FHE.eint<2> +func.func @chain_sub_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>, %e2: !FHE.eint<2>, %e3: !FHE.eint<2>, %e4: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK: %[[V0:.*]] = "FHE.sub_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 2 : ui{{[0-9]+}}} : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> %0 = "FHE.sub_eint"(%e0, %e1) : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> @@ -154,7 +154,7 @@ func @chain_sub_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>, %e2: !FHE.eint<2>, %e // ----- -func @single_neg_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_neg_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK: %[[ret:.*]] = "FHE.neg_eint"(%[[op0:.*]]) {MANP = 1 : ui{{[0-9]+}}} : (!FHE.eint<2>) -> !FHE.eint<2> %0 = "FHE.neg_eint"(%e) : (!FHE.eint<2>) -> !FHE.eint<2> @@ -164,7 +164,7 @@ func @single_neg_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_cst_mul_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_mul_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant 3 : i3 @@ -176,7 +176,7 @@ func @single_cst_mul_eint_int(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_cst_mul_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @single_cst_mul_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst = arith.constant -3 : i3 @@ -189,7 +189,7 @@ func @single_cst_mul_eint_int_neg(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- -func @single_dyn_mul_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> +func.func @single_dyn_mul_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> { // sqrt(1 + (2^2-1)^2) = 3 // CHECK: %[[ret:.*]] = "FHE.mul_eint_int"([[op0:.*]], %[[op1:.*]]) {MANP = 3 : ui{{[0-9]+}}} : (!FHE.eint<2>, i3) -> !FHE.eint<2> @@ -200,7 +200,7 @@ func @single_dyn_mul_eint_int(%e: !FHE.eint<2>, %i: i3) -> !FHE.eint<2> // ----- -func @single_apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> { +func.func @single_apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> { // CHECK: %[[ret:.*]] = "FHE.apply_lookup_table"(%[[op0:.*]], %[[op1:.*]]) {MANP = 1 : ui{{[0-9]+}}} : (!FHE.eint<2>, tensor<4xi64>) -> !FHE.eint<2> %1 = "FHE.apply_lookup_table"(%arg0, %arg1): (!FHE.eint<2>, tensor<4xi64>) -> !FHE.eint<2> return %1: !FHE.eint<2> @@ -208,7 +208,7 @@ func @single_apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !F // ----- -func @chain_add_eint_int(%e: !FHE.eint<3>) -> !FHE.eint<3> +func.func @chain_add_eint_int(%e: !FHE.eint<3>) -> !FHE.eint<3> { %cst0 = arith.constant 3 : i4 %cst1 = arith.constant 7 : i4 @@ -229,7 +229,7 @@ func @chain_add_eint_int(%e: !FHE.eint<3>) -> !FHE.eint<3> // ----- -func @dag_add_eint_int(%e: !FHE.eint<3>) -> !FHE.eint<3> +func.func @dag_add_eint_int(%e: !FHE.eint<3>) -> !FHE.eint<3> { %Acst0 = arith.constant 3 : i4 %Acst1 = arith.constant 7 : i4 @@ -273,7 +273,7 @@ func @dag_add_eint_int(%e: !FHE.eint<3>) -> !FHE.eint<3> // ----- -func @chain_add_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>, %e2: !FHE.eint<2>, %e3: !FHE.eint<2>, %e4: !FHE.eint<2>) -> !FHE.eint<2> +func.func @chain_add_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>, %e2: !FHE.eint<2>, %e3: !FHE.eint<2>, %e4: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK: %[[V0:.*]] = "FHE.add_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 2 : ui{{[0-9]+}}} : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> %0 = "FHE.add_eint"(%e0, %e1) : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> @@ -293,7 +293,7 @@ func @chain_add_eint(%e0: !FHE.eint<2>, %e1: !FHE.eint<2>, %e2: !FHE.eint<2>, %e // ----- -func @chain_add_eint_neg_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> +func.func @chain_add_eint_neg_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> { %cst0 = arith.constant 3 : i3 @@ -308,7 +308,7 @@ func @chain_add_eint_neg_eint(%e: !FHE.eint<2>) -> !FHE.eint<2> // ----- // CHECK-LABEL: @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> -func @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { +func.func @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.transpose"(%arg0) {MANP = 1 : ui1} : (tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> // CHECK-NEXT: return %[[v0]] : tensor<5x4x3x!FHE.eint<6>> // CHECK-NEXT: } @@ -319,7 +319,7 @@ func @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE. // ----- // CHECK-LABEL: @transpose_eint_3D_after_op(%arg0: tensor<3x4x5x!FHE.eint<6>>, %arg1: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> -func @transpose_eint_3D_after_op(%arg0: tensor<3x4x5x!FHE.eint<6>>, %arg1: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { +func.func @transpose_eint_3D_after_op(%arg0: tensor<3x4x5x!FHE.eint<6>>, %arg1: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.add_eint"(%arg0, %arg1) {MANP = 2 : ui{{[0-9]+}}} : (tensor<3x4x5x!FHE.eint<6>>, tensor<3x4x5x!FHE.eint<6>>) -> tensor<3x4x5x!FHE.eint<6>> // CHECK-NEXT: %[[v1:.*]] = "FHELinalg.transpose"(%[[v0]]) {MANP = 2 : ui{{[0-9]+}}} : (tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> // CHECK-NEXT: return %[[v1]] : tensor<5x4x3x!FHE.eint<6>> diff --git a/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_linalg.mlir b/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_linalg.mlir index 614a6f064..b755583e7 100644 --- a/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_linalg.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_linalg.mlir @@ -1,6 +1,6 @@ // RUN: concretecompiler --passes canonicalize --passes MANP --action=dump-fhe --split-input-file %s 2>&1 | FileCheck %s -func @single_cst_add_eint_int(%t: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_add_eint_int(%t: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst = arith.constant dense<[0, 1, 2, 3, 3, 2, 1, 0]> : tensor<8xi3> @@ -12,7 +12,7 @@ func @single_cst_add_eint_int(%t: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint< // ----- -func @single_cst_add_eint_int_from_cst_elements(%t: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_add_eint_int_from_cst_elements(%t: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst1 = arith.constant 1 : i3 %cst = tensor.from_elements %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1: tensor<8xi3> @@ -24,7 +24,7 @@ func @single_cst_add_eint_int_from_cst_elements(%t: tensor<8x!FHE.eint<2>>) -> t } // ----- -func @single_dyn_add_eint_int(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<2>> +func.func @single_dyn_add_eint_int(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<2>> { // sqrt(1 + (2^2-1)^2) = 3..16 // CHECK: %[[ret:.*]] = "FHELinalg.add_eint_int"(%[[op0:.*]], %[[op1:.*]]) {MANP = 4 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> @@ -35,7 +35,7 @@ func @single_dyn_add_eint_int(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> t // ----- -func @single_add_eint(%e0: tensor<8x!FHE.eint<2>>, %e1: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_add_eint(%e0: tensor<8x!FHE.eint<2>>, %e1: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { // CHECK: %[[ret:.*]] = "FHELinalg.add_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 2 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> %0 = "FHELinalg.add_eint"(%e0, %e1) : (tensor<8x!FHE.eint<2>>, tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> @@ -45,7 +45,7 @@ func @single_add_eint(%e0: tensor<8x!FHE.eint<2>>, %e1: tensor<8x!FHE.eint<2>>) // ----- -func @single_cst_sub_int_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_sub_int_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst = arith.constant dense<[0, 1, 2, 3, 3, 2, 1, 0]> : tensor<8xi3> @@ -57,7 +57,7 @@ func @single_cst_sub_int_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint< // ----- -func @single_cst_sub_int_eint_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_sub_int_eint_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst1 = arith.constant 1 : i3 %cst = tensor.from_elements %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1: tensor<8xi3> @@ -70,7 +70,7 @@ func @single_cst_sub_int_eint_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> t // ----- -func @single_cst_sub_eint_int(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_sub_eint_int(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst = arith.constant dense<[0, 1, 2, 3, 3, 2, 1, 0]> : tensor<8xi3> @@ -82,7 +82,7 @@ func @single_cst_sub_eint_int(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint< // ----- -func @single_cst_sub_eint_int_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_sub_eint_int_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst1 = arith.constant 1 : i3 %cst = tensor.from_elements %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1: tensor<8xi3> @@ -95,7 +95,7 @@ func @single_cst_sub_eint_int_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> t // ----- -func @single_sub_eint(%e0: tensor<8x!FHE.eint<2>>, %e1: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_sub_eint(%e0: tensor<8x!FHE.eint<2>>, %e1: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { // CHECK: %[[ret:.*]] = "FHELinalg.sub_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 2 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> %0 = "FHELinalg.sub_eint"(%e0, %e1) : (tensor<8x!FHE.eint<2>>, tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> @@ -105,7 +105,7 @@ func @single_sub_eint(%e0: tensor<8x!FHE.eint<2>>, %e1: tensor<8x!FHE.eint<2>>) // ----- -func @single_neg_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_neg_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { // CHECK: %[[ret:.*]] = "FHELinalg.neg_eint"(%[[op0:.*]]) {MANP = 1 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> %0 = "FHELinalg.neg_eint"(%e) : (tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> @@ -115,7 +115,7 @@ func @single_neg_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> // ----- -func @single_dyn_sub_int_eint(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<2>> +func.func @single_dyn_sub_int_eint(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<2>> { // sqrt(1 + (2^2-1)^2) = 3.16 // CHECK: %[[ret:.*]] = "FHELinalg.sub_int_eint"(%[[op0:.*]], %[[op1:.*]]) {MANP = 4 : ui{{[0-9]+}}} : (tensor<8xi3>, tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> @@ -126,7 +126,7 @@ func @single_dyn_sub_int_eint(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> t // ----- -func @single_cst_mul_eint_int(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_mul_eint_int(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst = arith.constant dense<[0, 1, 2, 3, 3, 2, 1, 0]> : tensor<8xi3> @@ -138,7 +138,7 @@ func @single_cst_mul_eint_int(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint< // ----- -func @single_cst_mul_eint_int_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @single_cst_mul_eint_int_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst1 = arith.constant 1 : i3 %cst = tensor.from_elements %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1, %cst1: tensor<8xi3> @@ -151,7 +151,7 @@ func @single_cst_mul_eint_int_from_cst_elements(%e: tensor<8x!FHE.eint<2>>) -> t // ----- -func @single_dyn_mul_eint_int(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<2>> +func.func @single_dyn_mul_eint_int(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<2>> { // sqrt(1 * (2^2-1)^2) = 3.16 // CHECK: %[[ret:.*]] = "FHELinalg.mul_eint_int"([[op0:.*]], %[[op1:.*]]) {MANP = 3 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> @@ -162,7 +162,7 @@ func @single_dyn_mul_eint_int(%e: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> t // ----- -func @chain_add_eint_int(%e: tensor<8x!FHE.eint<3>>) -> tensor<8x!FHE.eint<3>> +func.func @chain_add_eint_int(%e: tensor<8x!FHE.eint<3>>) -> tensor<8x!FHE.eint<3>> { %cst0 = arith.constant dense<[0, 1, 2, 3, 3, 2, 1, 0]> : tensor<8xi4> %cst1 = arith.constant dense<[0, 7, 2, 5, 6, 2, 1, 7]> : tensor<8xi4> @@ -181,7 +181,7 @@ func @chain_add_eint_int(%e: tensor<8x!FHE.eint<3>>) -> tensor<8x!FHE.eint<3>> // ----- -func @chain_add_eint_int_neg_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> +func.func @chain_add_eint_int_neg_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.eint<2>> { %cst0 = arith.constant dense<[0, 1, 2, 3, 3, 2, 1, 0]> : tensor<8xi3> // CHECK: %[[ret:.*]] = "FHELinalg.add_eint_int"(%[[op0:.*]], %[[op1:.*]]) {MANP = 4 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> @@ -197,7 +197,7 @@ func @chain_add_eint_int_neg_eint(%e: tensor<8x!FHE.eint<2>>) -> tensor<8x!FHE.e // FHELinalg.apply_multi_lookup_table ///////////////////////////////////////////////// -func @apply_lookup_table(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<3>> { +func.func @apply_lookup_table(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<3>> { %lut = arith.constant dense<[1,3,5,7]> : tensor<4xi64> // CHECK: %[[RES:.*]] = "FHELinalg.apply_lookup_table"(%[[T:.*]], %[[LUT:.*]]) {MANP = 1 : ui1} : (tensor<3x3x!FHE.eint<2>>, tensor<4xi64>) -> tensor<3x3x!FHE.eint<3>> %res = "FHELinalg.apply_lookup_table"(%t, %lut) : (tensor<3x3x!FHE.eint<2>>, tensor<4xi64>) -> tensor<3x3x!FHE.eint<3>> @@ -206,7 +206,7 @@ func @apply_lookup_table(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<3 // ----- -func @apply_lookup_table_after_op(%t: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<3>> { +func.func @apply_lookup_table_after_op(%t: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) -> tensor<8x!FHE.eint<3>> { %lut = arith.constant dense<[1,3,5,7]> : tensor<4xi64> // CHECK: %[[V0:.*]] = "FHELinalg.mul_eint_int"([[T:.*]], %[[I:.*]]) {MANP = 3 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> %0 = "FHELinalg.mul_eint_int"(%t, %i) : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> @@ -218,7 +218,7 @@ func @apply_lookup_table_after_op(%t: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>) // ----- -func @apply_multi_lookup_table(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<3>> { +func.func @apply_multi_lookup_table(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<3>> { // CHECK: %[[RES:.*]] = "FHELinalg.apply_multi_lookup_table"(%[[T:.*]], %[[LUT:.*]]) {MANP = 1 : ui1} : (tensor<3x3x!FHE.eint<2>>, tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<3>> %res = "FHELinalg.apply_multi_lookup_table"(%t, %luts) : (tensor<3x3x!FHE.eint<2>>, tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<3>> return %res : tensor<3x3x!FHE.eint<3>> @@ -226,7 +226,7 @@ func @apply_multi_lookup_table(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<3x3x4 // ----- -func @apply_multi_lookup_table_after_op(%t: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>, %luts: tensor<8x4xi64>) -> tensor<8x!FHE.eint<3>> { +func.func @apply_multi_lookup_table_after_op(%t: tensor<8x!FHE.eint<2>>, %i: tensor<8xi3>, %luts: tensor<8x4xi64>) -> tensor<8x!FHE.eint<3>> { // CHECK: %[[V0:.*]] = "FHELinalg.mul_eint_int"([[T:.*]], %[[I:.*]]) {MANP = 3 : ui{{[0-9]+}}} : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> %0 = "FHELinalg.mul_eint_int"(%t, %i) : (tensor<8x!FHE.eint<2>>, tensor<8xi3>) -> tensor<8x!FHE.eint<2>> // CHECK-NEXT: %[[RES:.*]] = "FHELinalg.apply_multi_lookup_table"(%[[V0]], %[[LUT:.*]]) {MANP = 1 : ui1} : (tensor<8x!FHE.eint<2>>, tensor<8x4xi64>) -> tensor<8x!FHE.eint<3>> @@ -240,7 +240,7 @@ func @apply_multi_lookup_table_after_op(%t: tensor<8x!FHE.eint<2>>, %i: tensor<8 // FHELinalg.dot_eint_int ///////////////////////////////////////////////// -func @single_cst_dot(%t: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> +func.func @single_cst_dot(%t: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> { %cst = arith.constant dense<[1, 2, 3, 4]> : tensor<4xi3> // sqrt(1^2*1 + 2^2*1 + 3^2*1 + 4^2*1) = 5.477225575 @@ -252,7 +252,7 @@ func @single_cst_dot(%t: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> // ----- -func @single_dyn_dot(%t: tensor<4x!FHE.eint<2>>, %dyn: tensor<4xi3>) -> !FHE.eint<2> +func.func @single_dyn_dot(%t: tensor<4x!FHE.eint<2>>, %dyn: tensor<4xi3>) -> !FHE.eint<2> { // sqrt(1*(2^2-1)^2*4) = 16 // CHECK: %[[V0:.*]] = "FHELinalg.dot_eint_int"([[T:.*]], %[[DYN:.*]]) {MANP = 6 : ui{{[[0-9]+}}} : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> !FHE.eint<2> @@ -263,7 +263,7 @@ func @single_dyn_dot(%t: tensor<4x!FHE.eint<2>>, %dyn: tensor<4xi3>) -> !FHE.ein // ----- -func @single_cst_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>) -> !FHE.eint<2> +func.func @single_cst_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>) -> !FHE.eint<2> { // sqrt((2^2-1)^2*1) = sqrt(9) = 3 // CHECK: %[[V0:.*]] = "FHELinalg.mul_eint_int"([[T:.*]], %[[I:.*]]) {MANP = 3 : ui{{[0-9]+}}} @@ -279,7 +279,7 @@ func @single_cst_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>) -> ! // ----- -func @single_dyn_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>) -> !FHE.eint<2> +func.func @single_dyn_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>) -> !FHE.eint<2> { // sqrt((2^2-1)^2*1) = sqrt(9) = 3 // CHECK: %[[V0:.*]] = "FHELinalg.mul_eint_int"([[T:.*]], %[[I:.*]]) {MANP = 3 : ui{{[0-9]+}}} @@ -298,7 +298,7 @@ func @single_dyn_dot_after_op(%t: tensor<4x!FHE.eint<2>>, %i: tensor<4xi3>) -> ! // FHELinalg.matmul_ent_int ///////////////////////////////////////////////// -func @matmul_eint_int_dyn_p_1(%arg0: tensor<3x1x!FHE.eint<2>>, %arg1: tensor<1x2xi3>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_eint_int_dyn_p_1(%arg0: tensor<3x1x!FHE.eint<2>>, %arg1: tensor<1x2xi3>) -> tensor<3x2x!FHE.eint<2>> { // p = 0 // acc = manp(0) = 1 // mul = manp(mul_eint_int(eint<2>, i3) = 1 * (2^2-1)^2 = 9 @@ -311,7 +311,7 @@ func @matmul_eint_int_dyn_p_1(%arg0: tensor<3x1x!FHE.eint<2>>, %arg1: tensor<1x2 // ----- -func @matmul_eint_int_dyn_p_2(%arg0: tensor<3x2x!FHE.eint<2>>, %arg1: tensor<2x2xi3>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_eint_int_dyn_p_2(%arg0: tensor<3x2x!FHE.eint<2>>, %arg1: tensor<2x2xi3>) -> tensor<3x2x!FHE.eint<2>> { // p = 0 // acc = manp(0) = 1 // mul = manp(mul_eint_int(eint<2>, i3) = 1 * (2^2-1)^2 = 9 @@ -327,7 +327,7 @@ func @matmul_eint_int_dyn_p_2(%arg0: tensor<3x2x!FHE.eint<2>>, %arg1: tensor<2x2 // ----- -func @matmul_eint_int_cst_p_1(%arg0: tensor<3x1x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_eint_int_cst_p_1(%arg0: tensor<3x1x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { %0 = arith.constant dense<[[3, 1]]> : tensor<1x2xi3> // c(m,n) = a(m,p) * b(p,n) the max cst is used for n = 0 // acc = manp(0) = 1 @@ -341,7 +341,7 @@ func @matmul_eint_int_cst_p_1(%arg0: tensor<3x1x!FHE.eint<2>>) -> tensor<3x2x!FH // ----- -func @matmul_eint_int_cst_p_2_n_0(%arg0: tensor<3x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_eint_int_cst_p_2_n_0(%arg0: tensor<3x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { %0 = arith.constant dense<[[4, 1],[3, 1]]> : tensor<2x2xi3> // c(m,n) = a(m,p) * b(p,n) the max csts [4,3] are used for n = 0 // p = 0 @@ -359,7 +359,7 @@ func @matmul_eint_int_cst_p_2_n_0(%arg0: tensor<3x2x!FHE.eint<2>>) -> tensor<3x2 // ----- -func @matmul_eint_int_cst_p_2_n_1(%arg0: tensor<3x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_eint_int_cst_p_2_n_1(%arg0: tensor<3x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { %0 = arith.constant dense<[[1, 4],[3, 1]]> : tensor<2x2xi3> // c(m,n) = a(m,p) * b(p,n) the max csts [4,1] are used for n = 1 // p = 0 @@ -377,7 +377,7 @@ func @matmul_eint_int_cst_p_2_n_1(%arg0: tensor<3x2x!FHE.eint<2>>) -> tensor<3x2 // ----- -func @matmul_eint_int_cst() -> tensor<4x3x!FHE.eint<7>> { +func.func @matmul_eint_int_cst() -> tensor<4x3x!FHE.eint<7>> { %0 = "FHE.zero_tensor"() : () -> tensor<4x3x!FHE.eint<7>> // =============================== @@ -553,7 +553,7 @@ func @matmul_eint_int_cst() -> tensor<4x3x!FHE.eint<7>> { // ----- -func @matmul_eint_int_cst_different_operand_manp() -> tensor<4x3x!FHE.eint<7>> { +func.func @matmul_eint_int_cst_different_operand_manp() -> tensor<4x3x!FHE.eint<7>> { %z = "FHE.zero_tensor"() : () -> tensor<4x3x!FHE.eint<7>> %a = arith.constant dense<[[4, 6, 5], [2, 6, 3], [5, 6, 1], [5, 5, 3]]> : tensor<4x3xi8> @@ -581,7 +581,7 @@ func @matmul_eint_int_cst_different_operand_manp() -> tensor<4x3x!FHE.eint<7>> { // ----- -func @matmul_int_eint_dyn_p_1(%arg0: tensor<3x1xi3>, %arg1: tensor<1x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_int_eint_dyn_p_1(%arg0: tensor<3x1xi3>, %arg1: tensor<1x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { // p = 0 // acc = manp(0) = 1 // mul = manp(mul_eint_int(eint<2>, i3) = 1 * (2^2-1)^2 = 9 @@ -594,7 +594,7 @@ func @matmul_int_eint_dyn_p_1(%arg0: tensor<3x1xi3>, %arg1: tensor<1x2x!FHE.eint // ----- -func @matmul_int_eint_dyn_p_2(%arg0: tensor<3x2xi3>, %arg1: tensor<2x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { +func.func @matmul_int_eint_dyn_p_2(%arg0: tensor<3x2xi3>, %arg1: tensor<2x2x!FHE.eint<2>>) -> tensor<3x2x!FHE.eint<2>> { // p = 0 // acc = manp(0) = 1 // mul = manp(mul_eint_int(eint<2>, i3) = 1 * (2^2-1)^2 = 9 @@ -610,7 +610,7 @@ func @matmul_int_eint_dyn_p_2(%arg0: tensor<3x2xi3>, %arg1: tensor<2x2x!FHE.eint // ----- -func @matmul_int_eint_cst_p_1(%arg0: tensor<1x3x!FHE.eint<2>>) -> tensor<2x3x!FHE.eint<2>> { +func.func @matmul_int_eint_cst_p_1(%arg0: tensor<1x3x!FHE.eint<2>>) -> tensor<2x3x!FHE.eint<2>> { %0 = arith.constant dense<[[3], [1]]> : tensor<2x1xi3> // c(m,n) = a(m,p) * b(p,n) the max cst is used for m = 0 // acc = manp(0) = 1 @@ -624,7 +624,7 @@ func @matmul_int_eint_cst_p_1(%arg0: tensor<1x3x!FHE.eint<2>>) -> tensor<2x3x!FH // ----- -func @matmul_int_eint_cst_p_2_n_0(%arg0: tensor<2x3x!FHE.eint<2>>) -> tensor<2x3x!FHE.eint<2>> { +func.func @matmul_int_eint_cst_p_2_n_0(%arg0: tensor<2x3x!FHE.eint<2>>) -> tensor<2x3x!FHE.eint<2>> { %0 = arith.constant dense<[[3, 4],[1, 1]]> : tensor<2x2xi3> // c(m,n) = a(m,p) * b(p,n) the max csts [4,3] are used for m = 0 // p = 0 @@ -642,7 +642,7 @@ func @matmul_int_eint_cst_p_2_n_0(%arg0: tensor<2x3x!FHE.eint<2>>) -> tensor<2x3 // ----- -func @matmul_int_eint_cst_p_2_n_1(%arg0: tensor<2x3x!FHE.eint<2>>) -> tensor<2x3x!FHE.eint<2>> { +func.func @matmul_int_eint_cst_p_2_n_1(%arg0: tensor<2x3x!FHE.eint<2>>) -> tensor<2x3x!FHE.eint<2>> { %0 = arith.constant dense<[[4, 1],[3, 1]]> : tensor<2x2xi3> // c(m,n) = a(m,p) * b(p,n) the max csts [4,1] are used for m = 1 // p = 0 @@ -660,7 +660,7 @@ func @matmul_int_eint_cst_p_2_n_1(%arg0: tensor<2x3x!FHE.eint<2>>) -> tensor<2x3 // ----- -func @matmul_int_eint_cst() -> tensor<3x2x!FHE.eint<7>> { +func.func @matmul_int_eint_cst() -> tensor<3x2x!FHE.eint<7>> { %0 = "FHE.zero_tensor"() : () -> tensor<3x2x!FHE.eint<7>> // =============================== @@ -820,7 +820,7 @@ func @matmul_int_eint_cst() -> tensor<3x2x!FHE.eint<7>> { // ----- -func @matmul_int_eint_cst_different_operand_manp() -> tensor<3x2x!FHE.eint<7>> { +func.func @matmul_int_eint_cst_different_operand_manp() -> tensor<3x2x!FHE.eint<7>> { %z = "FHE.zero_tensor"() : () -> tensor<3x2x!FHE.eint<7>> %a = arith.constant dense<[[4, 6], [2, 6], [5, 6]]> : tensor<3x2xi8> @@ -844,7 +844,7 @@ func @matmul_int_eint_cst_different_operand_manp() -> tensor<3x2x!FHE.eint<7>> { // ----- -func @sum() -> !FHE.eint<7> { +func.func @sum() -> !FHE.eint<7> { %0 = "FHE.zero_tensor"() : () -> tensor<5x3x4x2x!FHE.eint<7>> // CHECK: MANP = 11 : ui{{[0-9]+}} @@ -1000,7 +1000,7 @@ func @sum() -> !FHE.eint<7> { // ----- -func @concat() -> tensor<3x!FHE.eint<7>> { +func.func @concat() -> tensor<3x!FHE.eint<7>> { %0 = "FHE.zero_tensor"() : () -> tensor<4x!FHE.eint<7>> // CHECK: MANP = 2 : ui{{[0-9]+}} %1 = "FHELinalg.sum"(%0) { keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> @@ -1032,7 +1032,7 @@ func @concat() -> tensor<3x!FHE.eint<7>> { // ----- -func @conv2d_const_weight_const_bias(%input: tensor<1x1x4x4x!FHE.eint<6>>) -> tensor<1x1x2x2x!FHE.eint<6>> { +func.func @conv2d_const_weight_const_bias(%input: tensor<1x1x4x4x!FHE.eint<6>>) -> tensor<1x1x2x2x!FHE.eint<6>> { %weight = arith.constant dense<[[[[1, 2], [2, 1]]]]> : tensor<1x1x2x2xi7> %bias = arith.constant dense<[5]> : tensor<1xi7> // CHECK: %[[V1:.*]] = "FHELinalg.conv2d"(%[[A0:.*]], %[[A1:.*]], %[[A2:.*]]) {MANP = 6 : ui{{[0-9]+}} @@ -1044,7 +1044,7 @@ func @conv2d_const_weight_const_bias(%input: tensor<1x1x4x4x!FHE.eint<6>>) -> te // ----- -func @conv2d_const_weight(%input: tensor<1x1x4x4x!FHE.eint<6>>, %bias : tensor<1xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { +func.func @conv2d_const_weight(%input: tensor<1x1x4x4x!FHE.eint<6>>, %bias : tensor<1xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { %weight = arith.constant dense<[[[[1, 2], [2, 1]]]]> : tensor<1x1x2x2xi7> // CHECK: %[[V1:.*]] = "FHELinalg.conv2d"(%[[A0:.*]], %[[A1:.*]], %[[A2:.*]]) {MANP = 64 : ui{{[0-9]+}} %0 = "FHELinalg.conv2d"(%input, %weight, %bias){ @@ -1055,7 +1055,7 @@ func @conv2d_const_weight(%input: tensor<1x1x4x4x!FHE.eint<6>>, %bias : tensor<1 // ----- -func @conv2d_const_bias(%input: tensor<1x1x4x4x!FHE.eint<2>>, %weight: tensor<1x1x2x2xi3>) -> tensor<1x1x2x2x!FHE.eint<2>> { +func.func @conv2d_const_bias(%input: tensor<1x1x4x4x!FHE.eint<2>>, %weight: tensor<1x1x2x2xi3>) -> tensor<1x1x2x2x!FHE.eint<2>> { %bias = arith.constant dense<[5]> : tensor<1xi3> // CHECK: %[[V1:.*]] = "FHELinalg.conv2d"(%[[A0:.*]], %[[A1:.*]], %[[A2:.*]]) {MANP = 7 : ui{{[0-9]+}} %0 = "FHELinalg.conv2d"(%input, %weight, %bias){ @@ -1066,7 +1066,7 @@ func @conv2d_const_bias(%input: tensor<1x1x4x4x!FHE.eint<2>>, %weight: tensor<1x // ----- -func @conv2d_weight_const_bias(%input: tensor<1x1x4x4x!FHE.eint<2>>, %weight: tensor<1x1x2x2xi3>, %bias : tensor<1xi3>) -> tensor<1x1x2x2x!FHE.eint<2>> { +func.func @conv2d_weight_const_bias(%input: tensor<1x1x4x4x!FHE.eint<2>>, %weight: tensor<1x1x2x2xi3>, %bias : tensor<1xi3>) -> tensor<1x1x2x2x!FHE.eint<2>> { // CHECK: %[[V1:.*]] = "FHELinalg.conv2d"(%[[A0:.*]], %[[A1:.*]], %[[A2:.*]]) {MANP = 7 : ui{{[0-9]+}} %0 = "FHELinalg.conv2d"(%input, %weight, %bias){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> @@ -1076,7 +1076,7 @@ func @conv2d_weight_const_bias(%input: tensor<1x1x4x4x!FHE.eint<2>>, %weight: te // ----- -func @conv2d_batched_multiple_channels(%input: tensor<100x3x4x4x!FHE.eint<2>>, %weight: tensor<5x3x2x2xi3>, %bias : tensor<5xi3>) -> tensor<100x5x2x2x!FHE.eint<2>> { +func.func @conv2d_batched_multiple_channels(%input: tensor<100x3x4x4x!FHE.eint<2>>, %weight: tensor<5x3x2x2xi3>, %bias : tensor<5xi3>) -> tensor<100x5x2x2x!FHE.eint<2>> { // CHECK: %[[V1:.*]] = "FHELinalg.conv2d"(%[[A0:.*]], %[[A1:.*]], %[[A2:.*]]) {MANP = 11 : ui{{[0-9]+}} %0 = "FHELinalg.conv2d"(%input, %weight, %bias){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> diff --git a/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_tensor.mlir b/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_tensor.mlir index 45abdb9fc..ec5c4b6da 100644 --- a/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_tensor.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/Analysis/MANP_tensor.mlir @@ -1,6 +1,6 @@ // RUN: concretecompiler --passes MANP --action=dump-fhe --split-input-file %s 2>&1 | FileCheck %s -func @tensor_from_elements_1(%a: !FHE.eint<2>, %b: !FHE.eint<2>, %c: !FHE.eint<2>, %d: !FHE.eint<2>) -> tensor<4x!FHE.eint<2>> +func.func @tensor_from_elements_1(%a: !FHE.eint<2>, %b: !FHE.eint<2>, %c: !FHE.eint<2>, %d: !FHE.eint<2>) -> tensor<4x!FHE.eint<2>> { // The MANP value is 1 as all operands are function arguments // CHECK: %[[ret:.*]] = tensor.from_elements %[[a:.*]], %[[b:.*]], %[[c:.*]], %[[d:.*]] {MANP = 1 : ui{{[[0-9]+}}} : tensor<4x!FHE.eint<2>> @@ -11,7 +11,7 @@ func @tensor_from_elements_1(%a: !FHE.eint<2>, %b: !FHE.eint<2>, %c: !FHE.eint<2 // ----- -func @tensor_from_elements_2(%a: !FHE.eint<2>, %b: !FHE.eint<2>, %c: !FHE.eint<2>, %d: !FHE.eint<2>) -> tensor<4x!FHE.eint<2>> +func.func @tensor_from_elements_2(%a: !FHE.eint<2>, %b: !FHE.eint<2>, %c: !FHE.eint<2>, %d: !FHE.eint<2>) -> tensor<4x!FHE.eint<2>> { %cst = arith.constant 3 : i3 @@ -27,7 +27,7 @@ func @tensor_from_elements_2(%a: !FHE.eint<2>, %b: !FHE.eint<2>, %c: !FHE.eint<2 // ----- -func @tensor_extract_1(%t: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> +func.func @tensor_extract_1(%t: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> { %cst = arith.constant 1 : index @@ -40,7 +40,7 @@ func @tensor_extract_1(%t: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> // ----- -func @tensor_extract_2(%a: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> +func.func @tensor_extract_2(%a: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> { %c1 = arith.constant 1 : index %c3 = arith.constant dense<3> : tensor<4xi3> @@ -54,7 +54,7 @@ func @tensor_extract_2(%a: tensor<4x!FHE.eint<2>>) -> !FHE.eint<2> // ----- -func @tensor_extract_slice_1(%t: tensor<2x10x!FHE.eint<2>>) -> tensor<1x5x!FHE.eint<2>> +func.func @tensor_extract_slice_1(%t: tensor<2x10x!FHE.eint<2>>) -> tensor<1x5x!FHE.eint<2>> { // CHECK: %[[V0:.*]] = tensor.extract_slice %[[t:.*]][1, 5] [1, 5] [1, 1] {MANP = 1 : ui{{[[0-9]+}}} : tensor<2x10x!FHE.eint<2>> to tensor<1x5x!FHE.eint<2>> %0 = tensor.extract_slice %t[1, 5] [1, 5] [1, 1] : tensor<2x10x!FHE.eint<2>> to tensor<1x5x!FHE.eint<2>> @@ -64,7 +64,7 @@ func @tensor_extract_slice_1(%t: tensor<2x10x!FHE.eint<2>>) -> tensor<1x5x!FHE.e // ----- -func @tensor_extract_slice_2(%a: tensor<4x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> +func.func @tensor_extract_slice_2(%a: tensor<4x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> { %c3 = arith.constant dense <3> : tensor<4xi3> @@ -79,7 +79,7 @@ func @tensor_extract_slice_2(%a: tensor<4x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2 // ----- -func @tensor_insert_slice_1(%t0: tensor<2x10x!FHE.eint<2>>, %t1: tensor<2x2x!FHE.eint<2>>) -> tensor<2x10x!FHE.eint<2>> +func.func @tensor_insert_slice_1(%t0: tensor<2x10x!FHE.eint<2>>, %t1: tensor<2x2x!FHE.eint<2>>) -> tensor<2x10x!FHE.eint<2>> { // %[[V0:.*]] = tensor.insert_slice %[[t1:.*]] into %[[t0:.*]][0, 5] [2, 2] [1, 1] {MANP = 1 : ui{{[[0-9]+}}} : tensor<2x2x!FHE.eint<2>> into tensor<2x10x!FHE.eint<2>> %0 = tensor.insert_slice %t1 into %t0[0, 5] [2, 2] [1, 1] : tensor<2x2x!FHE.eint<2>> into tensor<2x10x!FHE.eint<2>> @@ -89,7 +89,7 @@ func @tensor_insert_slice_1(%t0: tensor<2x10x!FHE.eint<2>>, %t1: tensor<2x2x!FHE // ----- -func @tensor_collapse_shape_1(%a: tensor<2x2x4x!FHE.eint<6>>) -> tensor<2x8x!FHE.eint<6>> { +func.func @tensor_collapse_shape_1(%a: tensor<2x2x4x!FHE.eint<6>>) -> tensor<2x8x!FHE.eint<6>> { // CHECK: tensor.collapse_shape %[[A:.*]] [[X:.*]] {MANP = 1 : ui{{[0-9]+}}} %0 = tensor.collapse_shape %a [[0],[1,2]] : tensor<2x2x4x!FHE.eint<6>> into tensor<2x8x!FHE.eint<6>> return %0 : tensor<2x8x!FHE.eint<6>> @@ -97,7 +97,7 @@ func @tensor_collapse_shape_1(%a: tensor<2x2x4x!FHE.eint<6>>) -> tensor<2x8x!FHE // ----- -func @tensor_collapse_shape_2(%a: tensor<2x2x4x!FHE.eint<2>>, %b: tensor<2x2x4xi3>) -> tensor<2x8x!FHE.eint<2>> +func.func @tensor_collapse_shape_2(%a: tensor<2x2x4x!FHE.eint<2>>, %b: tensor<2x2x4xi3>) -> tensor<2x8x!FHE.eint<2>> { // CHECK: "FHELinalg.add_eint_int"(%[[A:.*]], %[[B:.*]]) {MANP = 4 : ui{{[0-9]+}}} %0 = "FHELinalg.add_eint_int"(%a, %b) : (tensor<2x2x4x!FHE.eint<2>>, tensor<2x2x4xi3>) -> tensor<2x2x4x!FHE.eint<2>> @@ -108,7 +108,7 @@ func @tensor_collapse_shape_2(%a: tensor<2x2x4x!FHE.eint<2>>, %b: tensor<2x2x4xi // ----- -func @tensor_expand_shape_1(%a: tensor<2x8x!FHE.eint<6>>) -> tensor<2x2x4x!FHE.eint<6>> { +func.func @tensor_expand_shape_1(%a: tensor<2x8x!FHE.eint<6>>) -> tensor<2x2x4x!FHE.eint<6>> { // CHECK: tensor.expand_shape %[[A:.*]] [[X:.*]] {MANP = 1 : ui{{[0-9]+}}} %0 = tensor.expand_shape %a [[0],[1,2]] : tensor<2x8x!FHE.eint<6>> into tensor<2x2x4x!FHE.eint<6>> return %0 : tensor<2x2x4x!FHE.eint<6>> @@ -116,7 +116,7 @@ func @tensor_expand_shape_1(%a: tensor<2x8x!FHE.eint<6>>) -> tensor<2x2x4x!FHE.e // ----- -func @tensor_expand_shape_2(%a: tensor<2x8x!FHE.eint<2>>, %b: tensor<2x8xi3>) -> tensor<2x2x4x!FHE.eint<2>> +func.func @tensor_expand_shape_2(%a: tensor<2x8x!FHE.eint<2>>, %b: tensor<2x8xi3>) -> tensor<2x2x4x!FHE.eint<2>> { // CHECK: "FHELinalg.add_eint_int"(%[[A:.*]], %[[B:.*]]) {MANP = 4 : ui{{[0-9]+}}} %0 = "FHELinalg.add_eint_int"(%a, %b) : (tensor<2x8x!FHE.eint<2>>, tensor<2x8xi3>) -> tensor<2x8x!FHE.eint<2>> diff --git a/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_big.mlir b/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_big.mlir index 4470c33c4..d567d08ef 100644 --- a/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_big.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_big.mlir @@ -1,6 +1,6 @@ // RUN: not concretecompiler --action=dump-llvm-ir %s 2>&1| FileCheck %s // CHECK-LABEL: Could not determine V0 parameters -func @test(%arg0: !FHE.eint<9>) { +func.func @test(%arg0: !FHE.eint<9>) { return } diff --git a/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_small.mlir b/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_small.mlir index 1089ac274..963daa63c 100644 --- a/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_small.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/eint_error_p_too_small.mlir @@ -1,6 +1,6 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: FHE.eint didn't support precision equals to 0 -func @test(%arg0: !FHE.eint<0>) { +func.func @test(%arg0: !FHE.eint<0>) { return } diff --git a/compiler/tests/check_tests/Dialect/FHE/folding.mlir b/compiler/tests/check_tests/Dialect/FHE/folding.mlir index b8914541d..adaa3ac8a 100644 --- a/compiler/tests/check_tests/Dialect/FHE/folding.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/folding.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=dump-fhe %s 2>&1| FileCheck %s -// CHECK-LABEL: func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: return %arg0 : !FHE.eint<2> %0 = arith.constant 0 : i3 @@ -9,8 +9,8 @@ func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: return %arg0 : !FHE.eint<2> %0 = arith.constant 0 : i3 @@ -18,8 +18,8 @@ func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: return %arg0 : !FHE.eint<2> %0 = arith.constant 1 : i3 diff --git a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_inputs.mlir b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_inputs.mlir index a716023de..49f4b54b6 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_inputs.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_inputs.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.add_eint' op should have the width of encrypted inputs equals -func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<3>) -> !FHE.eint<2> { +func.func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<3>) -> !FHE.eint<2> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<2>, !FHE.eint<3>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> } diff --git a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_result.mlir b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_result.mlir index 8d3b1da82..9644f51ce 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_result.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_err_result.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.add_eint' op should have the width of encrypted inputs and result equals -func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<3> { +func.func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<3> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<2>, !FHE.eint<2>) -> (!FHE.eint<3>) return %1: !FHE.eint<3> } diff --git a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_inputs.mlir b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_inputs.mlir index 3d9343e74..884994a5d 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_inputs.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_inputs.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.add_eint_int' op should have the width of plain input equals to width of encrypted input + 1 -func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 1 : i4 %1 = "FHE.add_eint_int"(%arg0, %0): (!FHE.eint<2>, i4) -> (!FHE.eint<2>) return %1: !FHE.eint<2> diff --git a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_result.mlir b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_result.mlir index cdb16b952..7ee740557 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_result.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_add_eint_int_err_result.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.add_eint_int' op should have the width of encrypted inputs and result equals -func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { +func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { %0 = arith.constant 1 : i2 %1 = "FHE.add_eint_int"(%arg0, %0): (!FHE.eint<2>, i2) -> (!FHE.eint<3>) return %1: !FHE.eint<3> diff --git a/compiler/tests/check_tests/Dialect/FHE/op_apply_lookup_table_bad_dimension.mlir b/compiler/tests/check_tests/Dialect/FHE/op_apply_lookup_table_bad_dimension.mlir index f6e33ea8f..c6ac059a9 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_apply_lookup_table_bad_dimension.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_apply_lookup_table_bad_dimension.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.apply_lookup_table' op : `lut` (operand #2) inner dimension should have size 4(=2^2) to match `ct` (operand #1) elements bitwidth (2) -func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<8xi3>) -> !FHE.eint<2> { +func.func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<8xi3>) -> !FHE.eint<2> { %1 = "FHE.apply_lookup_table"(%arg0, %arg1): (!FHE.eint<2>, tensor<8xi3>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> } diff --git a/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_inputs.mlir b/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_inputs.mlir index 6a33f02d6..0229bfcea 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_inputs.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_inputs.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.mul_eint_int' op should have the width of plain input equals to width of encrypted input + 1 -func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +func.func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 1 : i4 %1 = "FHE.mul_eint_int"(%arg0, %0): (!FHE.eint<2>, i4) -> (!FHE.eint<2>) return %1: !FHE.eint<2> diff --git a/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_result.mlir b/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_result.mlir index 59d87070f..fc535a225 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_result.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_mul_eint_int_err_result.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.mul_eint_int' op should have the width of encrypted inputs and result equals -func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { +func.func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { %0 = arith.constant 1 : i2 %1 = "FHE.mul_eint_int"(%arg0, %0): (!FHE.eint<2>, i2) -> (!FHE.eint<3>) return %1: !FHE.eint<3> diff --git a/compiler/tests/check_tests/Dialect/FHE/op_neg_eint_err_result.mlir b/compiler/tests/check_tests/Dialect/FHE/op_neg_eint_err_result.mlir index 4adadca04..cf88222f9 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_neg_eint_err_result.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_neg_eint_err_result.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.neg_eint' op should have the width of encrypted inputs and result equals -func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { +func.func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { %1 = "FHE.neg_eint"(%arg0): (!FHE.eint<2>) -> (!FHE.eint<3>) return %1: !FHE.eint<3> } diff --git a/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_inputs.mlir b/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_inputs.mlir index 2051528de..f28c50d2e 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_inputs.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_inputs.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.sub_int_eint' op should have the width of plain input equals to width of encrypted input + 1 -func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +func.func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 1 : i4 %1 = "FHE.sub_int_eint"(%0, %arg0): (i4, !FHE.eint<2>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> diff --git a/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_result.mlir b/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_result.mlir index bd322690d..085a220d1 100644 --- a/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_result.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/op_sub_int_eint_err_result.mlir @@ -1,7 +1,7 @@ // RUN: not concretecompiler --action=roundtrip %s 2>&1| FileCheck %s // CHECK-LABEL: error: 'FHE.sub_int_eint' op should have the width of encrypted inputs and result equals -func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { +func.func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<3> { %0 = arith.constant 1 : i2 %1 = "FHE.sub_int_eint"(%0, %arg0): (i2, !FHE.eint<2>) -> (!FHE.eint<3>) return %1: !FHE.eint<3> diff --git a/compiler/tests/check_tests/Dialect/FHE/ops.invalid.mlir b/compiler/tests/check_tests/Dialect/FHE/ops.invalid.mlir index 29fd029ea..4ce6bd5cd 100644 --- a/compiler/tests/check_tests/Dialect/FHE/ops.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/ops.invalid.mlir @@ -1,6 +1,6 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s -func @zero_1D_scalar() -> tensor<4x!FHE.eint<2>> { +func.func @zero_1D_scalar() -> tensor<4x!FHE.eint<2>> { // expected-error @+1 {{'FHE.zero_tensor' op}} %0 = "FHE.zero_tensor"() : () -> !FHE.eint<2> return %0 : !FHE.eint<2> @@ -8,7 +8,7 @@ func @zero_1D_scalar() -> tensor<4x!FHE.eint<2>> { // ----- -func @zero_plaintext() -> tensor<4x9xi32> { +func.func @zero_plaintext() -> tensor<4x9xi32> { // expected-error @+1 {{'FHE.zero_tensor' op}} %0 = "FHE.zero_tensor"() : () -> tensor<4x9xi32> return %0 : tensor<4x9xi32> diff --git a/compiler/tests/check_tests/Dialect/FHE/ops.mlir b/compiler/tests/check_tests/Dialect/FHE/ops.mlir index 20878544c..0807883a5 100644 --- a/compiler/tests/check_tests/Dialect/FHE/ops.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/ops.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK: func @zero() -> !FHE.eint<2> -func @zero() -> !FHE.eint<2> { +// CHECK: func.func @zero() -> !FHE.eint<2> +func.func @zero() -> !FHE.eint<2> { // CHECK-NEXT: %[[RET:.*]] = "FHE.zero"() : () -> !FHE.eint<2> // CHECK-NEXT: return %[[RET]] : !FHE.eint<2> @@ -9,26 +9,26 @@ func @zero() -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK: func @zero_1D() -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @zero_1D() -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @zero_1D() -> tensor<4x!FHE.eint<2>> { +func.func @zero_1D() -> tensor<4x!FHE.eint<2>> { %0 = "FHE.zero_tensor"() : () -> tensor<4x!FHE.eint<2>> return %0 : tensor<4x!FHE.eint<2>> } -// CHECK: func @zero_2D() -> tensor<4x9x!FHE.eint<2>> { +// CHECK: func.func @zero_2D() -> tensor<4x9x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHE.zero_tensor"() : () -> tensor<4x9x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x9x!FHE.eint<2>> // CHECK-NEXT: } -func @zero_2D() -> tensor<4x9x!FHE.eint<2>> { +func.func @zero_2D() -> tensor<4x9x!FHE.eint<2>> { %0 = "FHE.zero_tensor"() : () -> tensor<4x9x!FHE.eint<2>> return %0 : tensor<4x9x!FHE.eint<2>> } -// CHECK-LABEL: func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i3 // CHECK-NEXT: %[[V2:.*]] = "FHE.add_eint_int"(%arg0, %[[V1]]) : (!FHE.eint<2>, i3) -> !FHE.eint<2> // CHECK-NEXT: return %[[V2]] : !FHE.eint<2> @@ -38,8 +38,8 @@ func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i3 // CHECK-NEXT: %[[V2:.*]] = "FHE.sub_int_eint"(%[[V1]], %arg0) : (i3, !FHE.eint<2>) -> !FHE.eint<2> // CHECK-NEXT: return %[[V2]] : !FHE.eint<2> @@ -49,8 +49,8 @@ func @sub_int_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i3 // CHECK-NEXT: %[[V2:.*]] = "FHE.sub_eint_int"(%arg0, %[[V1]]) : (!FHE.eint<2>, i3) -> !FHE.eint<2> // CHECK-NEXT: return %[[V2]] : !FHE.eint<2> @@ -60,8 +60,8 @@ func @sub_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @sub_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> -func @sub_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @sub_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> +func.func @sub_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = "FHE.sub_eint"(%arg0, %arg1) : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> // CHECK-NEXT: return %[[V1]] : !FHE.eint<2> @@ -69,8 +69,8 @@ func @sub_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @neg_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @neg_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @neg_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @neg_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = "FHE.neg_eint"(%arg0) : (!FHE.eint<2>) -> !FHE.eint<2> // CHECK-NEXT: return %[[V1]] : !FHE.eint<2> @@ -78,8 +78,8 @@ func @neg_eint(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> -func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> +func.func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i3 // CHECK-NEXT: %[[V2:.*]] = "FHE.mul_eint_int"(%arg0, %[[V1]]) : (!FHE.eint<2>, i3) -> !FHE.eint<2> // CHECK-NEXT: return %[[V2]] : !FHE.eint<2> @@ -89,8 +89,8 @@ func @mul_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> -func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> +func.func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = "FHE.add_eint"(%arg0, %arg1) : (!FHE.eint<2>, !FHE.eint<2>) -> !FHE.eint<2> // CHECK-NEXT: return %[[V1]] : !FHE.eint<2> @@ -98,8 +98,8 @@ func @add_eint(%arg0: !FHE.eint<2>, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { return %1: !FHE.eint<2> } -// CHECK-LABEL: func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> -func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> { +// CHECK-LABEL: func.func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> +func.func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> { // CHECK-NEXT: %[[V1:.*]] = "FHE.apply_lookup_table"(%arg0, %arg1) : (!FHE.eint<2>, tensor<4xi64>) -> !FHE.eint<2> // CHECK-NEXT: return %[[V1]] : !FHE.eint<2> diff --git a/compiler/tests/check_tests/Dialect/FHE/types.mlir b/compiler/tests/check_tests/Dialect/FHE/types.mlir index 84c508786..df0d24c5b 100644 --- a/compiler/tests/check_tests/Dialect/FHE/types.mlir +++ b/compiler/tests/check_tests/Dialect/FHE/types.mlir @@ -1,6 +1,6 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @memref_arg(%arg0: memref<2x!FHE.eint<7>> -func @memref_arg(%arg0: memref<2x!FHE.eint<7>>) { +// CHECK-LABEL: func.func @memref_arg(%arg0: memref<2x!FHE.eint<7>> +func.func @memref_arg(%arg0: memref<2x!FHE.eint<7>>) { return } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/apply_mapped_lookup_table.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/apply_mapped_lookup_table.mlir index 4822f68df..097821f94 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/apply_mapped_lookup_table.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/apply_mapped_lookup_table.mlir @@ -1,11 +1,11 @@ // RUN: concretecompiler %s --action=roundtrip 2>&1 | FileCheck %s -//CHECK: func @mapped_lut(%[[A0:.*]]: tensor<2x3x!FHE.eint<2>>, %[[A1:.*]]: tensor<5x4xi64>, %[[A2:.*]]: tensor<2x3xindex>) -> tensor<2x3x!FHE.eint<2>> { +//CHECK: func.func @mapped_lut(%[[A0:.*]]: tensor<2x3x!FHE.eint<2>>, %[[A1:.*]]: tensor<5x4xi64>, %[[A2:.*]]: tensor<2x3xindex>) -> tensor<2x3x!FHE.eint<2>> { //CHECK-NEXT: %[[V0:.*]] = "FHELinalg.apply_mapped_lookup_table"(%[[A0]], %[[A1]], %[[A2]]) : (tensor<2x3x!FHE.eint<2>>, tensor<5x4xi64>, tensor<2x3xindex>) -> tensor<2x3x!FHE.eint<2>> //CHECK-NEXT: return %[[V0]] : tensor<2x3x!FHE.eint<2>> //CHECK-NEXT: } -func @mapped_lut(%t: tensor<2x3x!FHE.eint<2>>, %luts: tensor<5x4xi64>, %map: tensor<2x3xindex>) -> tensor<2x3x!FHE.eint<2>> { +func.func @mapped_lut(%t: tensor<2x3x!FHE.eint<2>>, %luts: tensor<5x4xi64>, %map: tensor<2x3xindex>) -> tensor<2x3x!FHE.eint<2>> { %0 = "FHELinalg.apply_mapped_lookup_table"(%t, %luts, %map): (tensor<2x3x!FHE.eint<2>>, tensor<5x4xi64>, tensor<2x3xindex>) -> tensor<2x3x!FHE.eint<2>> return %0: tensor<2x3x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lookup_table.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lookup_table.mlir index f4114fbd9..1307ab3b3 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lookup_table.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lookup_table.mlir @@ -1,10 +1,10 @@ // RUN: concretecompiler %s --action=roundtrip 2>&1 | FileCheck %s -//CHECK: func @multi_lut(%[[A0:.*]]: tensor<4x4x!FHE.eint<2>>, %[[A1:.*]]: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { +//CHECK: func.func @multi_lut(%[[A0:.*]]: tensor<4x4x!FHE.eint<2>>, %[[A1:.*]]: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { //CHECK-NEXT: %[[V0:.*]] = "FHELinalg.apply_multi_lookup_table"(%[[A0]], %[[A1]]) : (tensor<4x4x!FHE.eint<2>>, tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> //CHECK-NEXT: return %[[V0]] : tensor<4x4x!FHE.eint<2>> //CHECK-NEXT: } -func @multi_lut(%arg0: tensor<4x4x!FHE.eint<2>>, %arg1: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { +func.func @multi_lut(%arg0: tensor<4x4x!FHE.eint<2>>, %arg1: tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> { %1 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<4x4x!FHE.eint<2>>, tensor<4x4x4xi64>) -> tensor<4x4x!FHE.eint<2>> return %1: tensor<4x4x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lut_broadcast.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lut_broadcast.mlir index 538b24952..0dd99df48 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lut_broadcast.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/apply_multi_lut_broadcast.mlir @@ -1,10 +1,10 @@ // RUN: concretecompiler %s --action=roundtrip 2>&1 | FileCheck %s -//CHECK: func @multi_lut(%[[A0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[A1:.*]]: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { +//CHECK: func.func @multi_lut(%[[A0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[A1:.*]]: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { //CHECK-NEXT: %[[V0:.*]] = "FHELinalg.apply_multi_lookup_table"(%[[A0]], %[[A1]]) : (tensor<4x3x!FHE.eint<2>>, tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> //CHECK-NEXT: return %[[V0]] : tensor<4x3x!FHE.eint<2>> //CHECK-NEXT: } -func @multi_lut(%arg0: tensor<4x3x!FHE.eint<2>>, %arg1: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { +func.func @multi_lut(%arg0: tensor<4x3x!FHE.eint<2>>, %arg1: tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> { %1 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<4x3x!FHE.eint<2>>, tensor<3x4xi64>) -> tensor<4x3x!FHE.eint<2>> return %1: tensor<4x3x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/concat.invalid.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/concat.invalid.mlir index 50b1fabde..cf71bc912 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/concat.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/concat.invalid.mlir @@ -2,7 +2,7 @@ // ----- -func @main() -> tensor<0x!FHE.eint<7>> { +func.func @main() -> tensor<0x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op should have at least 2 inputs}} %0 = "FHELinalg.concat"() : () -> tensor<0x!FHE.eint<7>> return %0 : tensor<0x!FHE.eint<7>> @@ -10,7 +10,7 @@ func @main() -> tensor<0x!FHE.eint<7>> { // ----- -func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op should have at least 2 inputs}} %0 = "FHELinalg.concat"(%x) : (tensor<4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> @@ -18,7 +18,7 @@ func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // ----- -func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<6>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<6>> { // expected-error @+1 {{'FHELinalg.concat' op should have the width of encrypted inputs and result equals}} %0 = "FHELinalg.concat"(%x, %y) : (tensor<4x!FHE.eint<7>>, tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<6>> return %0 : tensor<7x!FHE.eint<6>> @@ -26,7 +26,7 @@ func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x! // ----- -func @main(%x: tensor<4x!FHE.eint<6>>, %y: tensor<3x!FHE.eint<6>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<6>>, %y: tensor<3x!FHE.eint<6>>) -> tensor<7x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op should have the width of encrypted inputs and result equals}} %0 = "FHELinalg.concat"(%x, %y) : (tensor<4x!FHE.eint<6>>, tensor<3x!FHE.eint<6>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> @@ -34,7 +34,7 @@ func @main(%x: tensor<4x!FHE.eint<6>>, %y: tensor<3x!FHE.eint<6>>) -> tensor<7x! // ----- -func @main(%x: tensor<4x!FHE.eint<6>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<6>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op should have the width of encrypted inputs and result equals}} %0 = "FHELinalg.concat"(%x, %y) : (tensor<4x!FHE.eint<6>>, tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> @@ -42,7 +42,7 @@ func @main(%x: tensor<4x!FHE.eint<6>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x! // ----- -func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op has invalid axis attribute}} %0 = "FHELinalg.concat"(%x, %y) { axis = 3 } : (tensor<4x!FHE.eint<7>>, tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> @@ -50,7 +50,7 @@ func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x! // ----- -func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op has invalid axis attribute}} %0 = "FHELinalg.concat"(%x, %y) { axis = -3 } : (tensor<4x!FHE.eint<7>>, tensor<3x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> @@ -58,7 +58,7 @@ func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<7x! // ----- -func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<10x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<10x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper output shape of <7>}} %0 = "FHELinalg.concat"(%x, %y) : (tensor<4x!FHE.eint<7>>, tensor<3x!FHE.eint<7>>) -> tensor<10x!FHE.eint<7>> return %0 : tensor<10x!FHE.eint<7>> @@ -66,7 +66,7 @@ func @main(%x: tensor<4x!FHE.eint<7>>, %y: tensor<3x!FHE.eint<7>>) -> tensor<10x // ----- -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<5x4x!FHE.eint<7>>) -> tensor<10x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<5x4x!FHE.eint<7>>) -> tensor<10x4x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper output shape of <8x4>}} %0 = "FHELinalg.concat"(%x, %y) : (tensor<3x4x!FHE.eint<7>>, tensor<5x4x!FHE.eint<7>>) -> tensor<10x4x!FHE.eint<7>> return %0 : tensor<10x4x!FHE.eint<7>> @@ -74,7 +74,7 @@ func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<5x4x!FHE.eint<7>>) -> tensor // ----- -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x10x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x10x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper output shape of <3x9>}} %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<3x4x!FHE.eint<7>>, tensor<3x5x!FHE.eint<7>>) -> tensor<3x10x!FHE.eint<7>> return %0 : tensor<3x10x!FHE.eint<7>> @@ -82,7 +82,7 @@ func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor // ----- -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper shape of for input #0}} %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<3x4x!FHE.eint<7>>, tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> return %0 : tensor<3x4x10x!FHE.eint<7>> @@ -90,7 +90,7 @@ func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor // ----- -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper shape of <3x?x10> for input #0}} %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<3x4x!FHE.eint<7>>, tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> return %0 : tensor<3x4x10x!FHE.eint<7>> @@ -98,7 +98,7 @@ func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor // ----- -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper shape of <3x4x?> for input #0}} %0 = "FHELinalg.concat"(%x, %y) { axis = 2 } : (tensor<3x4x!FHE.eint<7>>, tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> return %0 : tensor<3x4x10x!FHE.eint<7>> @@ -106,7 +106,7 @@ func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor // ----- -func @main(%x: tensor<3x4x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper shape of <3x4x?> for input #1}} %0 = "FHELinalg.concat"(%x, %y) { axis = 2 } : (tensor<3x4x4x!FHE.eint<7>>, tensor<3x5x!FHE.eint<7>>) -> tensor<3x4x10x!FHE.eint<7>> return %0 : tensor<3x4x10x!FHE.eint<7>> @@ -114,7 +114,7 @@ func @main(%x: tensor<3x4x4x!FHE.eint<7>>, %y: tensor<3x5x!FHE.eint<7>>) -> tens // ----- -func @main(%x: tensor<3x4x4x!FHE.eint<7>>, %y: tensor<3x5x4x!FHE.eint<7>>) -> tensor<3x10x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x4x!FHE.eint<7>>, %y: tensor<3x5x4x!FHE.eint<7>>) -> tensor<3x10x4x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.concat' op does not have the proper output shape of <3x9x4>}} %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<3x4x4x!FHE.eint<7>>, tensor<3x5x4x!FHE.eint<7>>) -> tensor<3x10x4x!FHE.eint<7>> return %0 : tensor<3x10x4x!FHE.eint<7>> diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/concat.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/concat.mlir index 95b88e9d5..8096196e9 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/concat.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/concat.mlir @@ -2,99 +2,99 @@ // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<7x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<7x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<3x4x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) : (tensor<3x4x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> return %0 : tensor<7x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<3x4x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<7x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<3x4x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<7x4x!FHE.eint<7>> return %0 : tensor<7x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<7>>, %[[a1:.*]]: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<4x3x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<4x7x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<4x3x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { +func.func @main(%x: tensor<4x3x!FHE.eint<7>>, %y: tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<4x3x!FHE.eint<7>>, tensor<4x4x!FHE.eint<7>>) -> tensor<4x7x!FHE.eint<7>> return %0 : tensor<4x7x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> return %0 : tensor<4x3x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<4x3x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<4x3x4x!FHE.eint<7>> return %0 : tensor<4x3x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<2x6x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x6x4x!FHE.eint<7>> return %0 : tensor<2x6x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x3x4x!FHE.eint<7>>, %[[a1:.*]]: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.concat"(%[[a0]], %[[a1]]) : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<2x3x8x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>, %y: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 2 } : (tensor<2x3x4x!FHE.eint<7>>, tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x8x!FHE.eint<7>> return %0 : tensor<2x3x8x!FHE.eint<7>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/dot.invalid.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/dot.invalid.mlir index 066d84e6d..231db48ff 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/dot.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/dot.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // Incompatible shapes -func @dot_incompatible_shapes( +func.func @dot_incompatible_shapes( %arg0: tensor<5x!FHE.eint<5>>, %arg1: tensor<4xi32>) -> !FHE.eint<5> { @@ -15,7 +15,7 @@ func @dot_incompatible_shapes( // ----- // Incompatible input types -func @dot_incompatible_input_types( +func.func @dot_incompatible_input_types( %arg0: tensor<5x!FHE.eint<2>>, %arg1: tensor<4xf32>) -> !FHE.eint<2> { @@ -29,7 +29,7 @@ func @dot_incompatible_input_types( // ----- // Wrong number of dimensions -func @dot_num_dims( +func.func @dot_num_dims( %arg0: tensor<2x4x!FHE.eint<2>>, %arg1: tensor<2x4xi3>) -> !FHE.eint<2> { @@ -43,7 +43,7 @@ func @dot_num_dims( // ----- // Wrong returns type -func @dot_incompatible_return( +func.func @dot_incompatible_return( %arg0: tensor<4x!FHE.eint<2>>, %arg1: tensor<4xi3>) -> !FHE.eint<3> { @@ -57,7 +57,7 @@ func @dot_incompatible_return( // ----- // Wrong integer size -func @dot_incompatible_int( +func.func @dot_incompatible_int( %arg0: tensor<4x!FHE.eint<2>>, %arg1: tensor<4xi4>) -> !FHE.eint<2> { diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/folding.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/folding.mlir index e6dd5494f..0010fd10a 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/folding.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/folding.mlir @@ -1,81 +1,81 @@ // RUN: concretecompiler --action=dump-fhe %s 2>&1| FileCheck %s -// CHECK: func @add_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @add_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %a1 = arith.constant dense<[0, 0, 0, 0]> : tensor<4xi3> %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } -// CHECK: func @add_eint_int_1D_broadcast(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_1D_broadcast(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_1D_broadcast(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @add_eint_int_1D_broadcast(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %a1 = arith.constant dense<[0]> : tensor<1xi3> %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<1xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } -// CHECK: func @add_eint_int_2D_broadcast(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_2D_broadcast(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x3x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_2D_broadcast(%a0: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { +func.func @add_eint_int_2D_broadcast(%a0: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { %a1 = arith.constant dense<[[0]]> : tensor<1x1xi3> %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x3x!FHE.eint<2>>, tensor<1x1xi3>) -> tensor<4x3x!FHE.eint<2>> return %1: tensor<4x3x!FHE.eint<2>> } -// CHECK: func @sub_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @sub_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %a1 = arith.constant dense<[0, 0, 0, 0]> : tensor<4xi3> %1 = "FHELinalg.sub_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } -// CHECK: func @sub_eint_int_1D_broadcast(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_1D_broadcast(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_1D_broadcast(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @sub_eint_int_1D_broadcast(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %a1 = arith.constant dense<[0]> : tensor<1xi3> %1 = "FHELinalg.sub_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<1xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } -// CHECK: func @sub_eint_int_2D_broadcast(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_2D_broadcast(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x3x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_2D_broadcast(%a0: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { +func.func @sub_eint_int_2D_broadcast(%a0: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { %a1 = arith.constant dense<[[0]]> : tensor<1x1xi3> %1 = "FHELinalg.sub_eint_int"(%a0, %a1) : (tensor<4x3x!FHE.eint<2>>, tensor<1x1xi3>) -> tensor<4x3x!FHE.eint<2>> return %1: tensor<4x3x!FHE.eint<2>> } -// CHECK: func @mul_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @mul_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %a1 = arith.constant dense<[1, 1, 1, 1]> : tensor<4xi3> %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } -// CHECK: func @mul_eint_int_1D_broadcast(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_1D_broadcast(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_1D_broadcast(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @mul_eint_int_1D_broadcast(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %a1 = arith.constant dense<[1]> : tensor<1xi3> %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<1xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } -// CHECK: func @mul_eint_int_2D_broadcast(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_2D_broadcast(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { // CHECK-NEXT: return %[[a0]] : tensor<4x3x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_2D_broadcast(%a0: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { +func.func @mul_eint_int_2D_broadcast(%a0: tensor<4x3x!FHE.eint<2>>) -> tensor<4x3x!FHE.eint<2>> { %a1 = arith.constant dense<[[1]]> : tensor<1x1xi3> %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x3x!FHE.eint<2>>, tensor<1x1xi3>) -> tensor<4x3x!FHE.eint<2>> return %1: tensor<4x3x!FHE.eint<2>> diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/matmul.invalid.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/matmul.invalid.mlir index 76d5058cd..2163beb80 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/matmul.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/matmul.invalid.mlir @@ -2,7 +2,7 @@ // ----- -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<2x3xi3>) -> tensor<4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<2x3xi3>) -> tensor<4x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op should have the same size on dimension #1 of operand #0 and dimension #0 of operand #1}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<2x3xi3>) -> tensor<4x2x!FHE.eint<2>> return %0 : tensor<4x2x!FHE.eint<2>> @@ -10,7 +10,7 @@ func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<2x3xi3>) -> tensor<4x2x!FHE. // ----- -func @main(%x: tensor<2x3xi3>, %y: tensor<4x3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +func.func @main(%x: tensor<2x3xi3>, %y: tensor<4x3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op should have the same size on dimension #1 of operand #0 and dimension #0 of operand #1}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x3xi3>, tensor<4x3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> return %0 : tensor<2x4x!FHE.eint<2>> @@ -18,7 +18,7 @@ func @main(%x: tensor<2x3xi3>, %y: tensor<4x3x!FHE.eint<2>>) -> tensor<2x4x!FHE. // ----- -func @main(%x: tensor<2x4x3x5x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<2x4x3x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x5x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<2x4x3x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op should have the same size on dimension #3 of operand #0 and dimension #1 of operand #1}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x5x!FHE.eint<2>>, tensor<4x3x2xi3>) -> tensor<2x4x3x2x!FHE.eint<2>> return %0 : tensor<2x4x3x2x!FHE.eint<2>> @@ -26,7 +26,7 @@ func @main(%x: tensor<2x4x3x5x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<2x4 // ----- -func @main(%x: tensor<2x4x3x5xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<2x4x3x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x5xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<2x4x3x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op should have the same size on dimension #3 of operand #0 and dimension #1 of operand #1}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3x5xi3>, tensor<4x3x2x!FHE.eint<2>>) -> tensor<2x4x3x2x!FHE.eint<2>> return %0 : tensor<2x4x3x2x!FHE.eint<2>> @@ -34,7 +34,7 @@ func @main(%x: tensor<2x4x3x5xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<2x4 // ----- -func @main(%x: tensor<2x4x3x5x!FHE.eint<2>>, %y: tensor<10x5x2xi3>) -> tensor<2x4x3x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x5x!FHE.eint<2>>, %y: tensor<10x5x2xi3>) -> tensor<2x4x3x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op should have the same size or size of 1 on dimension #1 of operand #0 and dimension #0 of operand #1}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x5x!FHE.eint<2>>, tensor<10x5x2xi3>) -> tensor<2x4x3x2x!FHE.eint<2>> return %0 : tensor<2x4x3x2x!FHE.eint<2>> @@ -42,7 +42,7 @@ func @main(%x: tensor<2x4x3x5x!FHE.eint<2>>, %y: tensor<10x5x2xi3>) -> tensor<2x // ----- -func @main(%x: tensor<2x4x3x5xi3>, %y: tensor<10x5x2x!FHE.eint<2>>) -> tensor<2x4x3x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x5xi3>, %y: tensor<10x5x2x!FHE.eint<2>>) -> tensor<2x4x3x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op should have the same size or size of 1 on dimension #1 of operand #0 and dimension #0 of operand #1}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3x5xi3>, tensor<10x5x2x!FHE.eint<2>>) -> tensor<2x4x3x2x!FHE.eint<2>> return %0 : tensor<2x4x3x2x!FHE.eint<2>> @@ -50,7 +50,7 @@ func @main(%x: tensor<2x4x3x5xi3>, %y: tensor<10x5x2x!FHE.eint<2>>) -> tensor<2x // ----- -func @main(%x: tensor<2x!FHE.eint<2>>, %y: tensor<5x3x4x2xi3>) -> tensor<5x3x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x!FHE.eint<2>>, %y: tensor<5x3x4x2xi3>) -> tensor<5x3x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op should have the same size on dimension #0 of operand #0 and dimension #2 of operand #1}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x!FHE.eint<2>>, tensor<5x3x4x2xi3>) -> tensor<5x3x2x!FHE.eint<2>> return %0 : tensor<5x3x2x!FHE.eint<2>> @@ -58,7 +58,7 @@ func @main(%x: tensor<2x!FHE.eint<2>>, %y: tensor<5x3x4x2xi3>) -> tensor<5x3x2x! // ----- -func @main(%x: tensor<2xi3>, %y: tensor<5x3x4x2x!FHE.eint<2>>) -> tensor<5x3x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2xi3>, %y: tensor<5x3x4x2x!FHE.eint<2>>) -> tensor<5x3x2x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op should have the same size on dimension #0 of operand #0 and dimension #2 of operand #1}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2xi3>, tensor<5x3x4x2x!FHE.eint<2>>) -> tensor<5x3x2x!FHE.eint<2>> return %0 : tensor<5x3x2x!FHE.eint<2>> @@ -66,7 +66,7 @@ func @main(%x: tensor<2xi3>, %y: tensor<5x3x4x2x!FHE.eint<2>>) -> tensor<5x3x2x! // ----- -func @main(%x: tensor<5x3x4x2x!FHE.eint<2>>, %y: tensor<4xi3>) -> tensor<5x3x4x!FHE.eint<2>> { +func.func @main(%x: tensor<5x3x4x2x!FHE.eint<2>>, %y: tensor<4xi3>) -> tensor<5x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op should have the same size on dimension #3 of operand #0 and dimension #0 of operand #1}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x3x4x2x!FHE.eint<2>>, tensor<4xi3>) -> tensor<5x3x4x!FHE.eint<2>> return %0 : tensor<5x3x4x!FHE.eint<2>> @@ -74,7 +74,7 @@ func @main(%x: tensor<5x3x4x2x!FHE.eint<2>>, %y: tensor<4xi3>) -> tensor<5x3x4x! // ----- -func @main(%x: tensor<5x3x4x2xi3>, %y: tensor<4x!FHE.eint<2>>) -> tensor<5x3x4x!FHE.eint<2>> { +func.func @main(%x: tensor<5x3x4x2xi3>, %y: tensor<4x!FHE.eint<2>>) -> tensor<5x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op should have the same size on dimension #3 of operand #0 and dimension #0 of operand #1}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x3x4x2xi3>, tensor<4x!FHE.eint<2>>) -> tensor<5x3x4x!FHE.eint<2>> return %0 : tensor<5x3x4x!FHE.eint<2>> @@ -82,7 +82,7 @@ func @main(%x: tensor<5x3x4x2xi3>, %y: tensor<4x!FHE.eint<2>>) -> tensor<5x3x4x! // ----- -func @main(%x: tensor<4x!FHE.eint<2>>, %y: tensor<4xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x!FHE.eint<2>>, %y: tensor<4xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op should have at least one multi dimensional tensor as an operand}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -90,7 +90,7 @@ func @main(%x: tensor<4x!FHE.eint<2>>, %y: tensor<4xi3>) -> tensor<1x!FHE.eint<2 // ----- -func @main(%x: tensor<4xi3>, %y: tensor<4x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4xi3>, %y: tensor<4x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op should have at least one multi dimensional tensor as an operand}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4xi3>, tensor<4x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -98,7 +98,7 @@ func @main(%x: tensor<4xi3>, %y: tensor<4x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2 // ----- -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -106,7 +106,7 @@ func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.ei // ----- -func @main(%x: tensor<4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -114,7 +114,7 @@ func @main(%x: tensor<4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.ei // ----- -func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -122,7 +122,7 @@ func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint // ----- -func @main(%x: tensor<3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -130,7 +130,7 @@ func @main(%x: tensor<3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint // ----- -func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<2>>, tensor<4x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -138,7 +138,7 @@ func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<1x!FHE.ei // ----- -func @main(%x: tensor<3xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<3xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3xi3>, tensor<4x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -146,7 +146,7 @@ func @main(%x: tensor<3xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.ei // ----- -func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x5x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x5x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <4x5x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<2>>, tensor<4x5x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -154,7 +154,7 @@ func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x5x3x2xi3>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<3xi3>, %y: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<3xi3>, %y: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <4x5x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3xi3>, tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -162,7 +162,7 @@ func @main(%x: tensor<3xi3>, %y: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <4>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -170,7 +170,7 @@ func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint // ----- -func @main(%x: tensor<4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <4>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -178,7 +178,7 @@ func @main(%x: tensor<4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint // ----- -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2x4>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -186,7 +186,7 @@ func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.ei // ----- -func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2x4>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -194,7 +194,7 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.ei // ----- -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -202,7 +202,7 @@ func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -210,7 +210,7 @@ func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -218,7 +218,7 @@ func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FH // ----- -func @main(%x: tensor<2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -226,7 +226,7 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FH // ----- -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<1x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<1x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<1x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -234,7 +234,7 @@ func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<1x3x2xi3>) -> tensor<1x!FH // ----- -func @main(%x: tensor<2x4x3xi3>, %y: tensor<1x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<1x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<1x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -242,7 +242,7 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<1x3x2x!FHE.eint<2>>) -> tensor<1x!FH // ----- -func @main(%x: tensor<1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<1x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -250,7 +250,7 @@ func @main(%x: tensor<1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FH // ----- -func @main(%x: tensor<1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<1x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -258,7 +258,7 @@ func @main(%x: tensor<1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FH // ----- -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -266,7 +266,7 @@ func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FH // ----- -func @main(%x: tensor<4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -274,7 +274,7 @@ func @main(%x: tensor<4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -282,7 +282,7 @@ func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -290,7 +290,7 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE. // ----- -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -298,7 +298,7 @@ func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1 // ----- -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -306,7 +306,7 @@ func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1 // ----- -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -314,7 +314,7 @@ func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x! // ----- -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -322,7 +322,7 @@ func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x! // ----- -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -330,7 +330,7 @@ func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<1x!FH // ----- -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -338,7 +338,7 @@ func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<1x!FH // ----- -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -346,7 +346,7 @@ func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x! // ----- -func @main(%x: tensor<2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -354,7 +354,7 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x! // ----- -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -362,7 +362,7 @@ func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<1x!FH // ----- -func @main(%x: tensor<4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -370,7 +370,7 @@ func @main(%x: tensor<4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<1x!FH // ----- -func @main(%x: tensor<5x1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_eint_int' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x1x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> @@ -378,7 +378,7 @@ func @main(%x: tensor<5x1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<1x! // ----- -func @main(%x: tensor<5x1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { +func.func @main(%x: tensor<5x1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.matmul_int_eint' op does not have the proper output shape of <5x2x4x2>}} %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x1x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<1x!FHE.eint<2>> return %0 : tensor<1x!FHE.eint<2>> diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/matmul.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/matmul.mlir index 73abdcca9..047d0bcb7 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/matmul.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/matmul.mlir @@ -2,132 +2,132 @@ // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<4x2x!FHE.eint<2>> return %0 : tensor<4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> return %0 : tensor<4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<2x!FHE.eint<2>> { +func.func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<2x!FHE.eint<2>> return %0 : tensor<2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> { +func.func @main(%x: tensor<3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<2x!FHE.eint<2>> return %0 : tensor<2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<3x!FHE.eint<2>>, tensor<4x3x2xi3>) -> tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x3x2xi3>) -> tensor<4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<2>>, tensor<4x3x2xi3>) -> tensor<4x2x!FHE.eint<2>> return %0 : tensor<4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3xi3>, %[[a1:.*]]: tensor<4x3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3xi3>, %[[a1:.*]]: tensor<4x3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<3xi3>, tensor<4x3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<3xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<3xi3>, %y: tensor<4x3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3xi3>, tensor<4x3x2x!FHE.eint<2>>) -> tensor<4x2x!FHE.eint<2>> return %0 : tensor<4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x5x3x2xi3>) -> tensor<4x5x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x5x3x2xi3>) -> tensor<4x5x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<3x!FHE.eint<2>>, tensor<4x5x3x2xi3>) -> tensor<4x5x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x5x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x5x3x2xi3>) -> tensor<4x5x2x!FHE.eint<2>> { +func.func @main(%x: tensor<3x!FHE.eint<2>>, %y: tensor<4x5x3x2xi3>) -> tensor<4x5x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x!FHE.eint<2>>, tensor<4x5x3x2xi3>) -> tensor<4x5x2x!FHE.eint<2>> return %0 : tensor<4x5x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3xi3>, %[[a1:.*]]: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<4x5x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3xi3>, %[[a1:.*]]: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<4x5x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<3xi3>, tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<4x5x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x5x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<3xi3>, %y: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<4x5x2x!FHE.eint<2>> { +func.func @main(%x: tensor<3xi3>, %y: tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<4x5x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<3xi3>, tensor<4x5x3x2x!FHE.eint<2>>) -> tensor<4x5x2x!FHE.eint<2>> return %0 : tensor<4x5x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3xi3>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3xi3>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<4x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<4x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<4x!FHE.eint<2>> return %0 : tensor<4x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<3x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<3x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> return %0 : tensor<4x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3xi3>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3xi3>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<2x4x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<2x4x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<2x4x!FHE.eint<2>> return %0 : tensor<2x4x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<2x4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> return %0 : tensor<2x4x!FHE.eint<2>> } @@ -135,44 +135,44 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<2x4x!FHE. // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3xi3>) -> tensor<5x2x4x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3xi3>) -> tensor<5x2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<5x2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<5x2x4x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3xi3>) -> tensor<5x2x4x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<3xi3>) -> tensor<5x2x4x!FHE.eint<2>> return %0 : tensor<5x2x4x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<3x!FHE.eint<2>>) -> tensor<5x2x4x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<3x!FHE.eint<2>>) -> tensor<5x2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<5x2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<5x2x4x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x!FHE.eint<2>>) -> tensor<5x2x4x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<3x!FHE.eint<2>>) -> tensor<5x2x4x!FHE.eint<2>> return %0 : tensor<5x2x4x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<2x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } @@ -180,198 +180,198 @@ func @main(%x: tensor<2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2 // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<1x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<1x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<1x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<1x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<1x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<1x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<1x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<1x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<2x4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<2x4x2x!FHE.eint<2>> return %0 : tensor<2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3x!FHE.eint<2>>, %y: tensor<3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x2x4x3x!FHE.eint<2>>, tensor<3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x2x4x3xi3>, %[[a1:.*]]: tensor<3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<5x2x4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x2x4x3xi3>, %y: tensor<3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x2x4x3xi3>, tensor<3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<2x4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<2x4x3xi3>, %[[a1:.*]]: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<2x4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<2x4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<2x4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3x!FHE.eint<2>>, %y: tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<4x3x!FHE.eint<2>>, tensor<5x2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x3xi3>, %[[a1:.*]]: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<4x3xi3>, %y: tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<4x3xi3>, tensor<5x2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x1x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x1x4x3x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_eint_int"(%[[a0]], %[[a1]]) : (tensor<5x1x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x1x4x3x!FHE.eint<2>>, %y: tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<5x1x4x3x!FHE.eint<2>>, tensor<2x3x2xi3>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<5x1x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<5x1x4x3xi3>, %[[a1:.*]]: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.matmul_int_eint"(%[[a0]], %[[a1]]) : (tensor<5x1x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: return %[[v0]] : tensor<5x2x4x2x!FHE.eint<2>> // CHECK-NEXT: } -func @main(%x: tensor<5x1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { +func.func @main(%x: tensor<5x1x4x3xi3>, %y: tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> { %0 = "FHELinalg.matmul_int_eint"(%x, %y): (tensor<5x1x4x3xi3>, tensor<2x3x2x!FHE.eint<2>>) -> tensor<5x2x4x2x!FHE.eint<2>> return %0 : tensor<5x2x4x2x!FHE.eint<2>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/ops.invalid.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/ops.invalid.mlir index 512994e7f..b368fd599 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/ops.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/ops.invalid.mlir @@ -5,7 +5,7 @@ ///////////////////////////////////////////////// // Incompatible dimension of operands -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint_int' op has the dimension #2 of the operand #1 incompatible with other operands, got 2 expect 1 or 3}} %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> return %1 : tensor<2x2x3x4x!FHE.eint<2>> @@ -14,7 +14,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor // ----- // Incompatible dimension of result -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x10x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x10x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint_int' op has the dimension #3 of the result incompatible with operands dimension, got 10 expect 2}} %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x10x3x4x!FHE.eint<2>> return %1 : tensor<2x10x3x4x!FHE.eint<2>> @@ -23,7 +23,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor // ----- // Incompatible number of dimension between operands and result -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint_int' op should have the number of dimensions of the result equal to the highest number of dimensions of operands, got 3 expect 4}} %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x3x4x!FHE.eint<2>> return %1 : tensor<2x3x4x!FHE.eint<2>> @@ -32,7 +32,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor // ----- // Incompatible width between clear and encrypted witdh -func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4xi4>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4xi4>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint_int' op should have the width of integer values less or equals than the width of encrypted values + 1}} %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<2x3x4x!FHE.eint<2>>, tensor<2x3x4xi4>) -> tensor<2x3x4x!FHE.eint<2>> return %1 : tensor<2x3x4x!FHE.eint<2>> @@ -45,7 +45,7 @@ func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4xi4>) -> tensor<2x3 ///////////////////////////////////////////////// // Incompatible dimension of operands -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint' op has the dimension #2 of the operand #1 incompatible with other operands, got 2 expect 1 or 3}} %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x2x3x4x!FHE.eint<2>> return %1 : tensor<2x2x3x4x!FHE.eint<2>> @@ -54,7 +54,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) // ----- // Incompatible dimension of result -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x10x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x10x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint' op has the dimension #3 of the result incompatible with operands dimension, got 10 expect 2}} %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x10x3x4x!FHE.eint<2>> return %1 : tensor<2x10x3x4x!FHE.eint<2>> @@ -63,7 +63,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) // ----- // Incompatible number of dimension between operands and result -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint' op should have the number of dimensions of the result equal to the highest number of dimensions of operands, got 3 expect 4}} %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4x!FHE.eint<2>>) -> tensor<2x3x4x!FHE.eint<2>> return %1 : tensor<2x3x4x!FHE.eint<2>> @@ -72,7 +72,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4x!FHE.eint<2>>) // ----- // Incompatible width between clear and encrypted witdh -func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4x!FHE.eint<3>>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4x!FHE.eint<3>>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint' op should have the width of encrypted equals, got 3 expect 2}} %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<2x3x4x!FHE.eint<2>>, tensor<2x3x4x!FHE.eint<3>>) -> tensor<2x3x4x!FHE.eint<2>> return %1 : tensor<2x3x4x!FHE.eint<2>> @@ -85,7 +85,7 @@ func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4x!FHE.eint<3>>) -> ///////////////////////////////////////////////// // Incompatible dimension of operands -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.mul_eint_int' op has the dimension #2 of the operand #1 incompatible with other operands, got 2 expect 1 or 3}} %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> return %1 : tensor<2x2x3x4x!FHE.eint<2>> @@ -94,7 +94,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor // ----- // Incompatible dimension of result -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x10x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x10x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.mul_eint_int' op has the dimension #3 of the result incompatible with operands dimension, got 10 expect 2}} %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x10x3x4x!FHE.eint<2>> return %1 : tensor<2x10x3x4x!FHE.eint<2>> @@ -103,7 +103,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor // ----- // Incompatible number of dimension between operands and result -func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.mul_eint_int' op should have the number of dimensions of the result equal to the highest number of dimensions of operands, got 3 expect 4}} %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x3x4x!FHE.eint<2>> return %1 : tensor<2x3x4x!FHE.eint<2>> @@ -112,7 +112,7 @@ func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor // ----- // Incompatible width between clear and encrypted witdh -func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4xi4>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4xi4>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.mul_eint_int' op should have the width of integer values less or equals than the width of encrypted values + 1}} %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<2x3x4x!FHE.eint<2>>, tensor<2x3x4xi4>) -> tensor<2x3x4x!FHE.eint<2>> return %1 : tensor<2x3x4x!FHE.eint<2>> @@ -124,7 +124,7 @@ func @main(%a0: tensor<2x3x4x!FHE.eint<2>>, %a1: tensor<2x3x4xi4>) -> tensor<2x3 // FHELinalg.apply_lookup_table ///////////////////////////////////////////////// -func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi32>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi32>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.apply_lookup_table' op should have as operand #2 a tensor<2^pxi64>, where p is the width of the encrypted integer of the operand #1,expect tensor <4xi64>}} %1 = "FHELinalg.apply_lookup_table"(%arg0, %arg1): (tensor<2x3x4x!FHE.eint<2>>, tensor<4xi32>) -> (tensor<2x3x4x!FHE.eint<2>>) return %1: tensor<2x3x4x!FHE.eint<2>> @@ -132,7 +132,7 @@ func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi32> // ----- -func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<12xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<12xi64>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.apply_lookup_table' op should have as operand #2 a tensor<2^pxi64>, where p is the width of the encrypted integer of the operand #1,expect tensor <4xi64>}} %1 = "FHELinalg.apply_lookup_table"(%arg0, %arg1): (tensor<2x3x4x!FHE.eint<2>>, tensor<12xi64>) -> (tensor<2x3x4x!FHE.eint<2>>) return %1: tensor<2x3x4x!FHE.eint<2>> @@ -140,7 +140,7 @@ func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<12xi64 // ----- -func @apply_lookup_table(%arg0: tensor<3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @apply_lookup_table(%arg0: tensor<3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.apply_lookup_table' op should have same shapes for operand #1 and the result}} %1 = "FHELinalg.apply_lookup_table"(%arg0, %arg1): (tensor<3x4x!FHE.eint<2>>, tensor<4xi64>) -> (tensor<2x3x4x!FHE.eint<2>>) return %1: tensor<2x3x4x!FHE.eint<2>> @@ -152,7 +152,7 @@ func @apply_lookup_table(%arg0: tensor<3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) // FHELinalg.apply_multi_lookup_table ///////////////////////////////////////////////// -func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x6xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +func.func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x6xi64>) -> tensor<2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.apply_multi_lookup_table' op should have as operand #2 a tensor, where p is the width of the encrypted integer of the operand #1,expect tensor }} %1 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<2x3x4x!FHE.eint<2>>, tensor<2x6xi64>) -> (tensor<2x3x4x!FHE.eint<2>>) return %1: tensor<2x3x4x!FHE.eint<2>> @@ -164,7 +164,7 @@ func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor< ///////////////////////////////////////////////// // FHELinalg.apply_mapped_lookup_table ///////////////////////////////////////////////// -func @apply_mapped_lookup_table_bad_lut_size_127_vs_128( +func.func @apply_mapped_lookup_table_bad_lut_size_127_vs_128( %input: tensor<2x3x4x!FHE.eint<7>>, %luts: tensor<127xi64>, %map: tensor<2x3x4xindex> @@ -176,7 +176,7 @@ func @apply_mapped_lookup_table_bad_lut_size_127_vs_128( // ----- -func @apply_mapped_lookup_table_bad_map_size( +func.func @apply_mapped_lookup_table_bad_map_size( %input: tensor<2x3x4x!FHE.eint<7>>, %luts: tensor<128xi64>, %map: tensor<2x3xindex> @@ -188,7 +188,7 @@ func @apply_mapped_lookup_table_bad_map_size( // ----- -func @apply_mapped_lookup_table_bad_map_elmt_type( +func.func @apply_mapped_lookup_table_bad_map_elmt_type( %input: tensor<2x3x4x!FHE.eint<7>>, %luts: tensor<128xi64>, %map: tensor<2x3xindex> @@ -204,7 +204,7 @@ func @apply_mapped_lookup_table_bad_map_elmt_type( // FHELinalg.conv2d ///////////////////////////////////////////////// -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op padding isn't yet supported, but got a non zero value (1) at index 0}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[1,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -213,7 +213,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14 // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected height of output to be equal to 8 but got 15}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0 ,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -223,7 +223,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14 // ----- -func @conv2d(%input: tensor<101x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<101x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected result batch size to be equal to input batch size (101) but got 100}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0 ,0, 0, 0]> : tensor<4xi64>}: (tensor<101x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -231,7 +231,7 @@ func @conv2d(%input: tensor<101x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14 // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x4x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x4x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected number of channels in weight to be equal to number of channels in input (3) but got 4}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x4x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -240,7 +240,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x4x14x14 // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi4>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi4>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected weight element type to have width 3 but got 4}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi4>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -249,7 +249,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14 // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi4>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi4>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected bias element type to have width 3 but got 4}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi4>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -257,7 +257,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14 // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x2x2xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x2x2xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected height of output to be equal to 27 but got 15}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x2x2xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -266,7 +266,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x2x2xi // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x2xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x2xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected width of output to be equal to 27 but got 15}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x2xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -275,7 +275,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x2x // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected height of output to be equal to 2 but got 15}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[2,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> @@ -283,7 +283,7 @@ func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14 // ----- -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.conv2d' op expected width of output to be equal to 2 but got 15}} %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,2]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/ops.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/ops.mlir index 0ad5241f3..9f3c8ce83 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/ops.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/ops.mlir @@ -5,51 +5,51 @@ ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @add_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { +func.func @add_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 2D tensor -// CHECK: func @add_eint_int_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { +func.func @add_eint_int_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> return %1: tensor<2x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @add_eint_int_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint_int"(%[[a0]], %[[a1]]) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @add_eint_int_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } // Broadcasting with tensor with dimensions equals to one -// CHECK: func @add_eint_int_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint_int"(%[[a0]], %[[a1]]) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { +func.func @add_eint_int_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> return %1: tensor<3x4x5x!FHE.eint<2>> } // Broadcasting with a tensor less dimensions of another -// CHECK: func @add_eint_int_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_int_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_int_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { +func.func @add_eint_int_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { %1 ="FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> return %1: tensor<3x4x!FHE.eint<2>> } @@ -59,51 +59,51 @@ func @add_eint_int_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4xi3>) ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @add_eint_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @add_eint_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 2D tensor -// CHECK: func @add_eint_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint"(%[[a0]], %[[a1]]) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +func.func @add_eint_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> return %1: tensor<2x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @add_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @add_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint"(%[[a0]], %[[a1]]) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @add_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } // Broadcasting with tensor with dimensions equals to one -// CHECK: func @add_eint_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +// CHECK: func.func @add_eint_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint"(%[[a0]], %[[a1]]) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +func.func @add_eint_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { %1 = "FHELinalg.add_eint"(%a0, %a1) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> return %1: tensor<3x4x5x!FHE.eint<2>> } // Broadcasting with a tensor less dimensions of another -// CHECK: func @add_eint_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +// CHECK: func.func @add_eint_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.add_eint"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: } -func @add_eint_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +func.func @add_eint_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { %1 ="FHELinalg.add_eint"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> return %1: tensor<3x4x!FHE.eint<2>> } @@ -114,51 +114,51 @@ func @add_eint_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4x!FHE.ein ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @sub_int_eint_1D(%[[a0:.*]]: tensor<4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @sub_int_eint_1D(%[[a0:.*]]: tensor<4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_int_eint"(%[[a0]], %[[a1]]) : (tensor<4xi3>, tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_int_eint_1D(%a0: tensor<4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @sub_int_eint_1D(%a0: tensor<4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<4xi3>, tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 2D tensor -// CHECK: func @sub_int_eint_2D(%[[a0:.*]]: tensor<2x4xi3>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @sub_int_eint_2D(%[[a0:.*]]: tensor<2x4xi3>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_int_eint"(%[[a0]], %[[a1]]) : (tensor<2x4xi3>, tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_int_eint_2D(%a0: tensor<2x4xi3>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +func.func @sub_int_eint_2D(%a0: tensor<2x4xi3>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { %1 = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<2x4xi3>, tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> return %1: tensor<2x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @sub_int_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @sub_int_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_int_eint"(%[[a0]], %[[a1]]) : (tensor<1x2x3x4x5x6x7x8x9x10xi3>, tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_int_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @sub_int_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<1x2x3x4x5x6x7x8x9x10xi3>, tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } // Broadcasting with tensor with dimensions equals to one -// CHECK: func @sub_int_eint_broadcast_1(%[[a0:.*]]: tensor<3x4x1xi3>, %[[a1:.*]]: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +// CHECK: func.func @sub_int_eint_broadcast_1(%[[a0:.*]]: tensor<3x4x1xi3>, %[[a1:.*]]: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_int_eint"(%[[a0]], %[[a1]]) : (tensor<3x4x1xi3>, tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_int_eint_broadcast_1(%a0: tensor<3x4x1xi3>, %a1: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +func.func @sub_int_eint_broadcast_1(%a0: tensor<3x4x1xi3>, %a1: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { %1 = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<3x4x1xi3>, tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> return %1: tensor<3x4x5x!FHE.eint<2>> } // Broadcasting with a tensor less dimensions of another -// CHECK: func @sub_int_eint_broadcast_2(%[[a0:.*]]: tensor<3x4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +// CHECK: func.func @sub_int_eint_broadcast_2(%[[a0:.*]]: tensor<3x4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_int_eint"(%[[a0]], %[[a1]]) : (tensor<3x4xi3>, tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_int_eint_broadcast_2(%a0: tensor<3x4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +func.func @sub_int_eint_broadcast_2(%a0: tensor<3x4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { %1 ="FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<3x4xi3>, tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> return %1: tensor<3x4x!FHE.eint<2>> } @@ -169,51 +169,51 @@ func @sub_int_eint_broadcast_2(%a0: tensor<3x4xi3>, %a1: tensor<4x!FHE.eint<2>>) ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @sub_eint_int_1D(%[[a0:.*]]: tensor<4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_1D(%[[a0:.*]]: tensor<4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint_int"(%[[a1]], %[[a0]]) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_1D(%a0: tensor<4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @sub_eint_int_1D(%a0: tensor<4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 2D tensor -// CHECK: func @sub_eint_int_2D(%[[a0:.*]]: tensor<2x4xi3>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_2D(%[[a0:.*]]: tensor<2x4xi3>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint_int"(%[[a1]], %[[a0]]) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_2D(%a0: tensor<2x4xi3>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +func.func @sub_eint_int_2D(%a0: tensor<2x4xi3>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> return %1: tensor<2x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @sub_eint_int_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint_int"(%[[a1]], %[[a0]]) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @sub_eint_int_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10xi3>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } // Broadcasting with tensor with dimensions equals to one -// CHECK: func @sub_eint_int_broadcast_1(%[[a0:.*]]: tensor<3x4x1xi3>, %[[a1:.*]]: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_broadcast_1(%[[a0:.*]]: tensor<3x4x1xi3>, %[[a1:.*]]: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint_int"(%[[a1]], %[[a0]]) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_broadcast_1(%a0: tensor<3x4x1xi3>, %a1: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +func.func @sub_eint_int_broadcast_1(%a0: tensor<3x4x1xi3>, %a1: tensor<1x4x5x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> return %1: tensor<3x4x5x!FHE.eint<2>> } // Broadcasting with a tensor less dimensions of another -// CHECK: func @sub_eint_int_broadcast_2(%[[a0:.*]]: tensor<3x4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_int_broadcast_2(%[[a0:.*]]: tensor<3x4xi3>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint_int"(%[[a1]], %[[a0]]) : (tensor<4x!FHE.eint<2>>, tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_int_broadcast_2(%a0: tensor<3x4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +func.func @sub_eint_int_broadcast_2(%a0: tensor<3x4xi3>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { %1 ="FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<4x!FHE.eint<2>>, tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> return %1: tensor<3x4x!FHE.eint<2>> } @@ -224,51 +224,51 @@ func @sub_eint_int_broadcast_2(%a0: tensor<3x4xi3>, %a1: tensor<4x!FHE.eint<2>>) ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @sub_eint_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @sub_eint_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 2D tensor -// CHECK: func @sub_eint_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint"(%[[a0]], %[[a1]]) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { +func.func @sub_eint_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4x!FHE.eint<2>>) -> tensor<2x4x!FHE.eint<2>> return %1: tensor<2x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @sub_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint"(%[[a0]], %[[a1]]) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @sub_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } // Broadcasting with tensor with dimensions equals to one -// CHECK: func @sub_eint_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint"(%[[a0]], %[[a1]]) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { +func.func @sub_eint_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> { %1 = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1x!FHE.eint<2>>) -> tensor<3x4x5x!FHE.eint<2>> return %1: tensor<3x4x5x!FHE.eint<2>> } // Broadcasting with a tensor less dimensions of another -// CHECK: func @sub_eint_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +// CHECK: func.func @sub_eint_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.sub_eint"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: } -func @sub_eint_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { +func.func @sub_eint_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> { %1 ="FHELinalg.sub_eint"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<3x4x!FHE.eint<2>>) -> tensor<3x4x!FHE.eint<2>> return %1: tensor<3x4x!FHE.eint<2>> } @@ -279,31 +279,31 @@ func @sub_eint_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4x!FHE.ein ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @neg_eint_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @neg_eint_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.neg_eint"(%[[a0]]) : (tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @neg_eint_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { +func.func @neg_eint_1D(%a0: tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.neg_eint"(%a0) : (tensor<4x!FHE.eint<2>>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 1D tensor -// CHECK: func @neg_eint_2D(%[[a0:.*]]: tensor<4x4x!FHE.eint<2>>) -> tensor<4x4x!FHE.eint<2>> { +// CHECK: func.func @neg_eint_2D(%[[a0:.*]]: tensor<4x4x!FHE.eint<2>>) -> tensor<4x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.neg_eint"(%[[a0]]) : (tensor<4x4x!FHE.eint<2>>) -> tensor<4x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x4x!FHE.eint<2>> // CHECK-NEXT: } -func @neg_eint_2D(%a0: tensor<4x4x!FHE.eint<2>>) -> tensor<4x4x!FHE.eint<2>> { +func.func @neg_eint_2D(%a0: tensor<4x4x!FHE.eint<2>>) -> tensor<4x4x!FHE.eint<2>> { %1 = "FHELinalg.neg_eint"(%a0) : (tensor<4x4x!FHE.eint<2>>) -> tensor<4x4x!FHE.eint<2>> return %1: tensor<4x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @neg_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @neg_eint_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.neg_eint"(%[[a0]]) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @neg_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @neg_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.neg_eint"(%a0) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } @@ -314,51 +314,51 @@ func @neg_eint_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>) -> tensor<1x2 ///////////////////////////////////////////////// // 1D tensor -// CHECK: func @mul_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_1D(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.mul_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<4x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { +func.func @mul_eint_int_1D(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } // 2D tensor -// CHECK: func @mul_eint_int_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_2D(%[[a0:.*]]: tensor<2x4x!FHE.eint<2>>, %[[a1:.*]]: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.mul_eint_int"(%[[a0]], %[[a1]]) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<2x4x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { +func.func @mul_eint_int_2D(%a0: tensor<2x4x!FHE.eint<2>>, %a1: tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> { %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<2x4x!FHE.eint<2>>, tensor<2x4xi3>) -> tensor<2x4x!FHE.eint<2>> return %1: tensor<2x4x!FHE.eint<2>> } // 10D tensor -// CHECK: func @mul_eint_int_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_10D(%[[a0:.*]]: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %[[a1:.*]]: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.mul_eint_int"(%[[a0]], %[[a1]]) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { +func.func @mul_eint_int_10D(%a0: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, %a1: tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> { %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>>, tensor<1x2x3x4x5x6x7x8x9x10xi3>) -> tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> return %1: tensor<1x2x3x4x5x6x7x8x9x10x!FHE.eint<2>> } // Broadcasting with tensor with dimensions equals to one -// CHECK: func @mul_eint_int_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_broadcast_1(%[[a0:.*]]: tensor<1x4x5x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.mul_eint_int"(%[[a0]], %[[a1]]) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x5x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { +func.func @mul_eint_int_broadcast_1(%a0: tensor<1x4x5x!FHE.eint<2>>, %a1: tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> { %1 = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<1x4x5x!FHE.eint<2>>, tensor<3x4x1xi3>) -> tensor<3x4x5x!FHE.eint<2>> return %1: tensor<3x4x5x!FHE.eint<2>> } // Broadcasting with a tensor less dimensions of another -// CHECK: func @mul_eint_int_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { +// CHECK: func.func @mul_eint_int_broadcast_2(%[[a0:.*]]: tensor<4x!FHE.eint<2>>, %[[a1:.*]]: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.mul_eint_int"(%[[a0]], %[[a1]]) : (tensor<4x!FHE.eint<2>>, tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<3x4x!FHE.eint<2>> // CHECK-NEXT: } -func @mul_eint_int_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { +func.func @mul_eint_int_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> { %1 ="FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<3x4xi3>) -> tensor<3x4x!FHE.eint<2>> return %1: tensor<3x4x!FHE.eint<2>> } @@ -367,8 +367,8 @@ func @mul_eint_int_broadcast_2(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<3x4xi3>) // FHELinalg.apply_lookup_table ///////////////////////////////////////////////// -// CHECK-LABEL: func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> -func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +// CHECK-LABEL: func.func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> +func.func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V1:.*]] = "FHELinalg.apply_lookup_table"(%arg0, %arg1) : (tensor<2x3x4x!FHE.eint<2>>, tensor<4xi64>) -> tensor<2x3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V1]] : tensor<2x3x4x!FHE.eint<2>> @@ -380,8 +380,8 @@ func @apply_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<4xi64> // FHELinalg.apply_multi_lookup_table ///////////////////////////////////////////////// -// CHECK-LABEL: func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x3x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> -func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x3x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +// CHECK-LABEL: func.func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x3x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> +func.func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x3x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V1:.*]] = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1) : (tensor<2x3x4x!FHE.eint<2>>, tensor<2x3x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V1]] : tensor<2x3x4x!FHE.eint<2>> @@ -389,8 +389,8 @@ func @apply_multi_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor< return %1: tensor<2x3x4x!FHE.eint<2>> } -// CHECK-LABEL: func @apply_multi_lookup_table_broadcast(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> -func @apply_multi_lookup_table_broadcast(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { +// CHECK-LABEL: func.func @apply_multi_lookup_table_broadcast(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> +func.func @apply_multi_lookup_table_broadcast(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg1: tensor<2x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> { // CHECK-NEXT: %[[V1:.*]] = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1) : (tensor<2x3x4x!FHE.eint<2>>, tensor<2x4xi64>) -> tensor<2x3x4x!FHE.eint<2>> // CHECK-NEXT: return %[[V1]] : tensor<2x3x4x!FHE.eint<2>> @@ -402,8 +402,8 @@ func @apply_multi_lookup_table_broadcast(%arg0: tensor<2x3x4x!FHE.eint<2>>, %arg // FHELinalg.apply_mapped_lookup_table ///////////////////////////////////////////////// -// CHECK-LABEL: func @apply_mapped_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<7>>, %arg1: tensor<10x128xi64>, %arg2: tensor<2x3x4xindex>) -> tensor<2x3x4x!FHE.eint<7>> { -func @apply_mapped_lookup_table( +// CHECK-LABEL: func.func @apply_mapped_lookup_table(%arg0: tensor<2x3x4x!FHE.eint<7>>, %arg1: tensor<10x128xi64>, %arg2: tensor<2x3x4xindex>) -> tensor<2x3x4x!FHE.eint<7>> { +func.func @apply_mapped_lookup_table( %input: tensor<2x3x4x!FHE.eint<7>>, %luts: tensor<10x128xi64>, %map: tensor<2x3x4xindex> @@ -418,8 +418,8 @@ func @apply_mapped_lookup_table( // FHELinalg.dot_eint_int ///////////////////////////////////////////////// -// CHECK-LABEL: func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>) -> !FHE.eint<2> -func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, +// CHECK-LABEL: func.func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>) -> !FHE.eint<2> +func.func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>) -> !FHE.eint<2> { // CHECK-NEXT: %[[RET:.*]] = "FHELinalg.dot_eint_int"(%arg0, %arg1) : (tensor<2x!FHE.eint<2>>, tensor<2xi3>) -> !FHE.eint<2> @@ -434,31 +434,31 @@ func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, // FHELinalg.conv2d ///////////////////////////////////////////////// -// CHECK: func @conv2d(%[[ARG0:.*]]: tensor<100x3x28x28x!FHE.eint<2>>, %[[ARG1:.*]]: tensor<4x3x14x14xi3>, %[[ARG2:.*]]: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +// CHECK: func.func @conv2d(%[[ARG0:.*]]: tensor<100x3x28x28x!FHE.eint<2>>, %[[ARG1:.*]]: tensor<4x3x14x14xi3>, %[[ARG2:.*]]: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.conv2d"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) {dilations = dense<1> : tensor<2xi64>, padding = dense<0> : tensor<4xi64>, strides = dense<1> : tensor<2xi64>} : (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<100x4x15x15x!FHE.eint<2>> // CHECK-NEXT: } -func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { %1 = "FHELinalg.conv2d"(%input, %weight, %bias){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> } -// CHECK: func @conv2d_without_attr(%[[ARG0:.*]]: tensor<100x3x28x28x!FHE.eint<2>>, %[[ARG1:.*]]: tensor<4x3x14x14xi3>, %[[ARG2:.*]]: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +// CHECK: func.func @conv2d_without_attr(%[[ARG0:.*]]: tensor<100x3x28x28x!FHE.eint<2>>, %[[ARG1:.*]]: tensor<4x3x14x14xi3>, %[[ARG2:.*]]: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.conv2d"(%[[ARG0]], %[[ARG1]], %[[ARG2]]) : (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<100x4x15x15x!FHE.eint<2>> // CHECK-NEXT: } -func @conv2d_without_attr(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d_without_attr(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>, %bias: tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { %1 = "FHELinalg.conv2d"(%input, %weight, %bias): (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>, tensor<4xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> } -// CHECK: func @conv2d_without_bias(%[[ARG0:.*]]: tensor<100x3x28x28x!FHE.eint<2>>, %[[ARG1:.*]]: tensor<4x3x14x14xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +// CHECK: func.func @conv2d_without_bias(%[[ARG0:.*]]: tensor<100x3x28x28x!FHE.eint<2>>, %[[ARG1:.*]]: tensor<4x3x14x14xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { // CHECK-NEXT: %[[V0:.*]] = "FHELinalg.conv2d"(%[[ARG0]], %[[ARG1]]) {dilations = dense<1> : tensor<2xi64>, padding = dense<0> : tensor<4xi64>, strides = dense<1> : tensor<2xi64>} : (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> // CHECK-NEXT: return %[[V0]] : tensor<100x4x15x15x!FHE.eint<2>> // CHECK-NEXT: } -func @conv2d_without_bias(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { +func.func @conv2d_without_bias(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: tensor<4x3x14x14xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> { %1 = "FHELinalg.conv2d"(%input, %weight){strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0, 0, 0]> : tensor<4xi64>}: (tensor<100x3x28x28x!FHE.eint<2>>, tensor<4x3x14x14xi3>) -> tensor<100x4x15x15x!FHE.eint<2>> return %1 : tensor<100x4x15x15x!FHE.eint<2>> } @@ -468,7 +468,7 @@ func @conv2d_without_bias(%input: tensor<100x3x28x28x!FHE.eint<2>>, %weight: ten ///////////////////////////////////////////////// // CHECK-LABEL: @transpose_eint_2D(%arg0: tensor<2x10x!FHE.eint<6>>) -> tensor<10x2x!FHE.eint<6>> -func @transpose_eint_2D(%arg0: tensor<2x10x!FHE.eint<6>>) -> tensor<10x2x!FHE.eint<6>> { +func.func @transpose_eint_2D(%arg0: tensor<2x10x!FHE.eint<6>>) -> tensor<10x2x!FHE.eint<6>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.transpose"(%arg0) : (tensor<2x10x!FHE.eint<6>>) -> tensor<10x2x!FHE.eint<6>> // CHECK-NEXT: return %[[v0]] : tensor<10x2x!FHE.eint<6>> // CHECK-NEXT: } @@ -477,7 +477,7 @@ func @transpose_eint_2D(%arg0: tensor<2x10x!FHE.eint<6>>) -> tensor<10x2x!FHE.ei } // CHECK-LABEL: @transpose_int_2D(%arg0: tensor<2x10xi6>) -> tensor<10x2xi6> -func @transpose_int_2D(%arg0: tensor<2x10xi6>) -> tensor<10x2xi6> { +func.func @transpose_int_2D(%arg0: tensor<2x10xi6>) -> tensor<10x2xi6> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.transpose"(%arg0) : (tensor<2x10xi6>) -> tensor<10x2xi6> // CHECK-NEXT: return %[[v0]] : tensor<10x2xi6> // CHECK-NEXT: } @@ -486,7 +486,7 @@ func @transpose_int_2D(%arg0: tensor<2x10xi6>) -> tensor<10x2xi6> { } // CHECK-LABEL: @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> -func @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { +func.func @transpose_eint_3D(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.transpose"(%arg0) : (tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> // CHECK-NEXT: return %[[v0]] : tensor<5x4x3x!FHE.eint<6>> // CHECK-NEXT: } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/sum.invalid.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/sum.invalid.mlir index f63d8f5f8..16b334a24 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/sum.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/sum.invalid.mlir @@ -2,7 +2,7 @@ // ----- -func @sum_invalid_bitwidth(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<6> { +func.func @sum_invalid_bitwidth(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<6> { // expected-error @+1 {{'FHELinalg.sum' op should have the width of encrypted inputs and result equals}} %1 = "FHELinalg.sum"(%arg0): (tensor<4x!FHE.eint<7>>) -> !FHE.eint<6> return %1 : !FHE.eint<6> @@ -10,7 +10,7 @@ func @sum_invalid_bitwidth(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<6> { // ----- -func @sum_invalid_axes_1(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @sum_invalid_axes_1(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // expected-error @+1 {{'FHELinalg.sum' op has invalid axes attribute}} %1 = "FHELinalg.sum"(%arg0) { axes = [4] } : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %1 : !FHE.eint<7> @@ -18,7 +18,7 @@ func @sum_invalid_axes_1(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // ----- -func @sum_invalid_axes_2(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @sum_invalid_axes_2(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // expected-error @+1 {{'FHELinalg.sum' op has invalid axes attribute}} %1 = "FHELinalg.sum"(%arg0) { axes = [-1] } : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %1 : !FHE.eint<7> @@ -26,7 +26,7 @@ func @sum_invalid_axes_2(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // ----- -func @sum_invalid_shape_01(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_01(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <>}} %1 = "FHELinalg.sum"(%arg0) : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -34,7 +34,7 @@ func @sum_invalid_shape_01(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_02(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_02(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <3x4x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -42,7 +42,7 @@ func @sum_invalid_shape_02(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_03(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_03(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x4x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -50,7 +50,7 @@ func @sum_invalid_shape_03(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_04(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_04(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x3x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [2] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -58,7 +58,7 @@ func @sum_invalid_shape_04(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_05(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_05(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x3x4>}} %1 = "FHELinalg.sum"(%arg0) { axes = [3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -66,7 +66,7 @@ func @sum_invalid_shape_05(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_06(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_06(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <4x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -74,7 +74,7 @@ func @sum_invalid_shape_06(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_07(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_07(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <3x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 2] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -82,7 +82,7 @@ func @sum_invalid_shape_07(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_08(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_08(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <3x4>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -90,7 +90,7 @@ func @sum_invalid_shape_08(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_09(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_09(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1, 2] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -98,7 +98,7 @@ func @sum_invalid_shape_09(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_10(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_10(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x4>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -106,7 +106,7 @@ func @sum_invalid_shape_10(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_11(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_11(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x3>}} %1 = "FHELinalg.sum"(%arg0) { axes = [2, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -114,7 +114,7 @@ func @sum_invalid_shape_11(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_12(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_12(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -122,7 +122,7 @@ func @sum_invalid_shape_12(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_13(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_13(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <4>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -130,7 +130,7 @@ func @sum_invalid_shape_13(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_14(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_14(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <3>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 2, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -138,7 +138,7 @@ func @sum_invalid_shape_14(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_15(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_15(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1, 2, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -146,7 +146,7 @@ func @sum_invalid_shape_15(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_16(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_16(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2, 3] } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -154,7 +154,7 @@ func @sum_invalid_shape_16(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_17(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_17(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x1x1x1>}} %1 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -162,7 +162,7 @@ func @sum_invalid_shape_17(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_18(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_18(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x3x4x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -170,7 +170,7 @@ func @sum_invalid_shape_18(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_19(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_19(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x1x4x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -178,7 +178,7 @@ func @sum_invalid_shape_19(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_20(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_20(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x3x1x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [2], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -186,7 +186,7 @@ func @sum_invalid_shape_20(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_21(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_21(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x3x4x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -194,7 +194,7 @@ func @sum_invalid_shape_21(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_22(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_22(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x1x4x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -202,7 +202,7 @@ func @sum_invalid_shape_22(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_23(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_23(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x3x1x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 2], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -210,7 +210,7 @@ func @sum_invalid_shape_23(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_24(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_24(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x3x4x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -218,7 +218,7 @@ func @sum_invalid_shape_24(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_25(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_25(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x1x1x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1, 2], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -226,7 +226,7 @@ func @sum_invalid_shape_25(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_26(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_26(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x1x4x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -234,7 +234,7 @@ func @sum_invalid_shape_26(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_27(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_27(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x3x1x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [2, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -242,7 +242,7 @@ func @sum_invalid_shape_27(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_28(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_28(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x1x1x2>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -250,7 +250,7 @@ func @sum_invalid_shape_28(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_29(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_29(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x1x4x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -258,7 +258,7 @@ func @sum_invalid_shape_29(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_30(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_30(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x3x1x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 2, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -266,7 +266,7 @@ func @sum_invalid_shape_30(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_31(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_31(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <5x1x1x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [1, 2, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> @@ -274,7 +274,7 @@ func @sum_invalid_shape_31(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x // ----- -func @sum_invalid_shape_32(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { +func.func @sum_invalid_shape_32(%arg0: tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.sum' op does not have the proper output shape of <1x1x1x1>}} %1 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2, 3], keep_dims = true } : (tensor<5x3x4x2x!FHE.eint<7>>) -> tensor<10x20x!FHE.eint<7>> return %1 : tensor<10x20x!FHE.eint<7>> diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/sum.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/sum.mlir index 4f3592858..9a7139880 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/sum.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/sum.mlir @@ -2,286 +2,286 @@ // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) : (tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) : (tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<3x0x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [1]} : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> return %0 : tensor<3x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [1], keep_dims = true} : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x1x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x1x4x!FHE.eint<7>> return %0 : tensor<3x1x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [2]} : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x0x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [2] } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x!FHE.eint<7>> return %0 : tensor<3x0x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [2], keep_dims = true} : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x0x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [2], keep_dims = true } : (tensor<3x0x4x!FHE.eint<7>>) -> tensor<3x0x1x!FHE.eint<7>> return %0 : tensor<3x0x1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0]} : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) { axes = [0] } : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {keep_dims = true} : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0], keep_dims = true} : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0], keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {keep_dims = true} : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> return %0 : tensor<1x1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0]} : (tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0] } : (tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0], keep_dims = true} : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> return %0 : tensor<1x4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [1]} : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> return %0 : tensor<3x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [1], keep_dims = true} : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> return %0 : tensor<3x1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0, 1]} : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1] } : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0, 1], keep_dims = true} : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> return %0 : tensor<1x1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {keep_dims = true} : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> return %0 : tensor<1x1x1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [1]} : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x2x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> return %0 : tensor<3x2x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [1], keep_dims = true} : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<3x1x2x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [1], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> return %0 : tensor<3x1x2x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0, 2]} : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<4x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0, 2], keep_dims = true} : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x4x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> return %0 : tensor<1x4x1x!FHE.eint<7>> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0, 1, 2]} : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> // CHECK-NEXT: return %[[v0]] : !FHE.eint<7> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } // ----- -// CHECK: func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +// CHECK: func.func @main(%[[a0:.*]]: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { // CHECK-NEXT: %[[v0:.*]] = "FHELinalg.sum"(%[[a0]]) {axes = [0, 1, 2], keep_dims = true} : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: return %[[v0]] : tensor<1x1x1x!FHE.eint<7>> // CHECK-NEXT: } -func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%arg0) { axes = [0, 1, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> return %0 : tensor<1x1x1x!FHE.eint<7>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/tensor-ops-to-linalg.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/tensor-ops-to-linalg.mlir index 3989761d9..7f80b8360 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/tensor-ops-to-linalg.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/tensor-ops-to-linalg.mlir @@ -3,7 +3,7 @@ //CHECK: #map0 = affine_map<(d0) -> (d0)> //CHECK-NEXT: #map1 = affine_map<(d0) -> (0)> //CHECK-NEXT: module { -//CHECK-NEXT: func @dot_eint_int(%arg0: tensor<2x!TFHE.glwe<{_,_,_}{2}>>, %arg1: tensor<2xi3>) -> !TFHE.glwe<{_,_,_}{2}> { +//CHECK-NEXT: func.func @dot_eint_int(%arg0: tensor<2x!TFHE.glwe<{_,_,_}{2}>>, %arg1: tensor<2xi3>) -> !TFHE.glwe<{_,_,_}{2}> { //CHECK-NEXT: %c0 = arith.constant 0 : index //CHECK-NEXT: %0 = "TFHE.zero_tensor"() : () -> tensor<1x!TFHE.glwe<{_,_,_}{2}>> //CHECK-NEXT: %1 = linalg.generic {indexing_maps = [#map0, #map0, #map1], iterator_types = ["reduction"]} ins(%arg0, %arg1 : tensor<2x!TFHE.glwe<{_,_,_}{2}>>, tensor<2xi3>) outs(%0 : tensor<1x!TFHE.glwe<{_,_,_}{2}>>) { @@ -16,7 +16,7 @@ //CHECK-NEXT: return %2 : !TFHE.glwe<{_,_,_}{2}> //CHECK-NEXT: } //CHECK-NEXT: } -func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, +func.func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>) -> !FHE.eint<2> { %o = "FHELinalg.dot_eint_int"(%arg0, %arg1) : diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/tiling.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/tiling.mlir index c936a3c43..5a99318e4 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/tiling.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/tiling.mlir @@ -1,6 +1,6 @@ // RUN: concretecompiler --action=dump-fhe %s 2>&1 --split-input-file | FileCheck %s -// CHECK: func @tiled_2x2(%[[Varg0:.*]]: tensor<8x4x!FHE.eint<6>>, %[[Varg1:.*]]: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { +// CHECK: func.func @tiled_2x2(%[[Varg0:.*]]: tensor<8x4x!FHE.eint<6>>, %[[Varg1:.*]]: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { // CHECK-NEXT: %[[Vc2:.*]] = arith.constant 2 : index // CHECK-NEXT: %[[Vc0:.*]] = arith.constant 0 : index // CHECK-NEXT: %[[Vc8:.*]] = arith.constant 8 : index @@ -23,14 +23,14 @@ // CHECK-NEXT: } // CHECK-NEXT: return %[[V1]] : tensor<8x2x!FHE.eint<6>> // CHECK-NEXT: } -func @tiled_2x2(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { +func.func @tiled_2x2(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { %0 = "FHELinalg.matmul_eint_int"(%a, %b) { "tile-sizes" = [2,2,2] } : (tensor<8x4x!FHE.eint<6>>, tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> return %0 : tensor<8x2x!FHE.eint<6>> } // ----- -// CHECK: func @tiled_one_big_tile(%[[Varg0:.*]]: tensor<8x4x!FHE.eint<6>>, %[[Varg1:.*]]: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { +// CHECK: func.func @tiled_one_big_tile(%[[Varg0:.*]]: tensor<8x4x!FHE.eint<6>>, %[[Varg1:.*]]: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { // CHECK-NEXT: %[[Vc8:.*]] = arith.constant 8 : index // CHECK-NEXT: %[[Vc4:.*]] = arith.constant 4 : index // CHECK-NEXT: %[[Vc2:.*]] = arith.constant 2 : index @@ -53,7 +53,7 @@ func @tiled_2x2(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) -> tensor<8x2x // CHECK-NEXT: } // CHECK-NEXT: return %[[V1]] : tensor<8x2x!FHE.eint<6>> // CHECK-NEXT: } -func @tiled_one_big_tile(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { +func.func @tiled_one_big_tile(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> { %0 = "FHELinalg.matmul_eint_int"(%a, %b) { "tile-sizes" = [8,4,2] } : (tensor<8x4x!FHE.eint<6>>, tensor<4x2xi7>) -> tensor<8x2x!FHE.eint<6>> return %0 : tensor<8x2x!FHE.eint<6>> } diff --git a/compiler/tests/check_tests/Dialect/FHELinalg/transpose.invalid.mlir b/compiler/tests/check_tests/Dialect/FHELinalg/transpose.invalid.mlir index 9cc7ab6c1..ba9609f44 100644 --- a/compiler/tests/check_tests/Dialect/FHELinalg/transpose.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/FHELinalg/transpose.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // Incompatible types -func @transpose_eint(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<7>> { +func.func @transpose_eint(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<7>> { // expected-error @+1 {{'FHELinalg.transpose' op input and output tensors should have the same element type}} %c = "FHELinalg.transpose"(%arg0) : (tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<7>> return %c : tensor<5x4x3x!FHE.eint<7>> @@ -10,7 +10,7 @@ func @transpose_eint(%arg0: tensor<3x4x5x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.ein // ----- // Incompatible shapes -func @transpose_eint(%arg0: tensor<3x4x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { +func.func @transpose_eint(%arg0: tensor<3x4x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { // expected-error @+1 {{'FHELinalg.transpose' op input and output tensors should have the same number of dimensions}} %c = "FHELinalg.transpose"(%arg0) : (tensor<3x4x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> return %c : tensor<5x4x3x!FHE.eint<6>> @@ -19,7 +19,7 @@ func @transpose_eint(%arg0: tensor<3x4x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint< // ----- // Incompatible shapes -func @transpose_eint(%arg0: tensor<3x4x6x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { +func.func @transpose_eint(%arg0: tensor<3x4x6x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> { // expected-error @+1 {{'FHELinalg.transpose' op output tensor should have inverted dimensions of input}} %c = "FHELinalg.transpose"(%arg0) : (tensor<3x4x6x!FHE.eint<6>>) -> tensor<5x4x3x!FHE.eint<6>> return %c : tensor<5x4x3x!FHE.eint<6>> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.invalid.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.invalid.mlir index 3b249a640..563076d19 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // GLWE p parameter result -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { // expected-error @+1 {{'TFHE.add_glwe' op should have the same GLWE 'p' parameter}} %1 = "TFHE.add_glwe"(%arg0, %arg1): (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,12,64}{6}>) return %1: !TFHE.glwe<{1024,12,64}{6}> @@ -10,7 +10,7 @@ func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64 // ----- // GLWE p parameter inputs -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{6}>) -> !TFHE.glwe<{1024,12,64}{7}> { +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{6}>) -> !TFHE.glwe<{1024,12,64}{7}> { // expected-error @+1 {{'TFHE.add_glwe' op should have the same GLWE 'p' parameter}} %1 = "TFHE.add_glwe"(%arg0, %arg1): (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{1024,12,64}{6}>) -> (!TFHE.glwe<{1024,12,64}{7}>) return %1: !TFHE.glwe<{1024,12,64}{7}> @@ -19,7 +19,7 @@ func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64 // ----- // GLWE dimension parameter result -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { // expected-error @+1 {{'TFHE.add_glwe' op should have the same GLWE 'dimension' parameter}} %1 = "TFHE.add_glwe"(%arg0, %arg1): (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{512,12,64}{7}>) return %1: !TFHE.glwe<{512,12,64}{7}> @@ -28,7 +28,7 @@ func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64 // ----- // GLWE dimension parameter inputs -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{512,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{512,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // expected-error @+1 {{'TFHE.add_glwe' op should have the same GLWE 'dimension' parameter}} %1 = "TFHE.add_glwe"(%arg0, %arg1): (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{512,12,64}{7}>) -> (!TFHE.glwe<{1024,12,64}{7}>) return %1: !TFHE.glwe<{1024,12,64}{7}> @@ -37,7 +37,7 @@ func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{512,12,64} // ----- // GLWE polynomialSize parameter result -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { // expected-error @+1 {{'TFHE.add_glwe' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.add_glwe"(%arg0, %arg1): (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,11,64}{7}>) return %1: !TFHE.glwe<{1024,11,64}{7}> @@ -46,7 +46,7 @@ func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64 // ----- // GLWE polynomialSize parameter inputs -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,11,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,11,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // expected-error @+1 {{'TFHE.add_glwe' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.add_glwe"(%arg0, %arg1): (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{1024,11,64}{7}>) -> (!TFHE.glwe<{1024,12,64}{7}>) return %1: !TFHE.glwe<{1024,12,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.mlir index 77c6b398a..3445d0187 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> -func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +// CHECK-LABEL: func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> +func.func @add_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>, %arg1: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = "TFHE.add_glwe"(%arg0, %arg1) : (!TFHE.glwe<{1024,12,64}{7}>, !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> // CHECK-NEXT: return %[[V1]] : !TFHE.glwe<{1024,12,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.invalid.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.invalid.mlir index ebf85fdeb..7dcf3b0be 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // GLWE p parameter -func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { +func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.add_glwe_int' op should have the same GLWE 'p' parameter}} %1 = "TFHE.add_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i8) -> (!TFHE.glwe<{1024,12,64}{6}>) @@ -11,7 +11,7 @@ func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64 // ----- // GLWE dimension parameter -func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { +func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.add_glwe_int' op should have the same GLWE 'dimension' parameter}} %1 = "TFHE.add_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i8) -> (!TFHE.glwe<{512,12,64}{7}>) @@ -21,7 +21,7 @@ func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64} // ----- // GLWE polynomialSize parameter -func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.add_glwe_int' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.add_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i8) -> (!TFHE.glwe<{1024,11,64}{7}>) @@ -31,7 +31,7 @@ func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64 // ----- // integer width doesn't match GLWE parameter -func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { %0 = arith.constant 1 : i9 // expected-error @+1 {{'TFHE.add_glwe_int' op should have the width of `b` equals or less than 'p'+1}} %1 = "TFHE.add_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i9) -> (!TFHE.glwe<{1024,12,64}{7}>) diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.mlir index b73a51d7a..19cf01fd1 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_add_glwe_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> -func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +// CHECK-LABEL: func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> +func.func @add_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "TFHE.add_glwe_int"(%arg0, %[[V1]]) : (!TFHE.glwe<{1024,12,64}{7}>, i8) -> !TFHE.glwe<{1024,12,64}{7}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{1024,12,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.invalid.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.invalid.mlir index bfcd29f71..f1118aeba 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // GLWE p parameter -func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { +func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.mul_glwe_int' op should have the same GLWE 'p' parameter}} %1 = "TFHE.mul_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i8) -> (!TFHE.glwe<{1024,12,64}{6}>) @@ -11,7 +11,7 @@ func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64 // ----- // GLWE dimension parameter -func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { +func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.mul_glwe_int' op should have the same GLWE 'dimension' parameter}} %1 = "TFHE.mul_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i8) -> (!TFHE.glwe<{512,12,64}{7}>) @@ -21,7 +21,7 @@ func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64} // ----- // GLWE polynomialSize parameter -func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.mul_glwe_int' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.mul_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i8) -> (!TFHE.glwe<{1024,11,64}{7}>) @@ -31,7 +31,7 @@ func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64 // ----- // integer width doesn't match GLWE parameter -func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { %0 = arith.constant 1 : i9 // expected-error @+1 {{'TFHE.mul_glwe_int' op should have the width of `b` equals or less than 'p'+1}} %1 = "TFHE.mul_glwe_int"(%arg0, %0): (!TFHE.glwe<{1024,12,64}{7}>, i9) -> (!TFHE.glwe<{1024,12,64}{7}>) diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.mlir index 70af889de..1c8cfaa4d 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_mul_glwe_int.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> -func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +// CHECK-LABEL: func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> +func.func @mul_glwe_int(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "TFHE.mul_glwe_int"(%arg0, %[[V1]]) : (!TFHE.glwe<{1024,12,64}{7}>, i8) -> !TFHE.glwe<{1024,12,64}{7}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{1024,12,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.invalid.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.invalid.mlir index d04a9d159..dc81bb31e 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // GLWE p parameter -func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { +func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { // expected-error @+1 {{'TFHE.neg_glwe' op should have the same GLWE 'p' parameter}} %1 = "TFHE.neg_glwe"(%arg0): (!TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,12,64}{6}>) return %1: !TFHE.glwe<{1024,12,64}{6}> @@ -10,7 +10,7 @@ func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6} // ----- // GLWE dimension parameter -func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { +func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { // expected-error @+1 {{'TFHE.neg_glwe' op should have the same GLWE 'dimension' parameter}} %1 = "TFHE.neg_glwe"(%arg0): (!TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{512,12,64}{7}>) return %1: !TFHE.glwe<{512,12,64}{7}> @@ -19,7 +19,7 @@ func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> // ----- // GLWE polynomialSize parameter -func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { // expected-error @+1 {{'TFHE.neg_glwe' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.neg_glwe"(%arg0): (!TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,11,64}{7}>) return %1: !TFHE.glwe<{1024,11,64}{7}> @@ -28,7 +28,7 @@ func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7} // ----- // integer width doesn't match GLWE parameter -func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { // expected-error @+1 {{'TFHE.neg_glwe' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.neg_glwe"(%arg0): (!TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,11,64}{7}>) return %1: !TFHE.glwe<{1024,11,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.mlir index 2c43da700..727117c27 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_neg_glwe.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> -func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +// CHECK-LABEL: func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> +func.func @neg_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = "TFHE.neg_glwe"(%arg0) : (!TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> // CHECK-NEXT: return %[[V1]] : !TFHE.glwe<{1024,12,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.invalid.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.invalid.mlir index 2f671bc3a..eaca7061a 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.invalid.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.invalid.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --split-input-file --verify-diagnostics --action=roundtrip %s // GLWE p parameter -func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { +func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{6}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.sub_int_glwe' op should have the same GLWE 'p' parameter}} %1 = "TFHE.sub_int_glwe"(%0, %arg0): (i8, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,12,64}{6}>) @@ -11,7 +11,7 @@ func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64 // ----- // GLWE dimension parameter -func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { +func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.sub_int_glwe' op should have the same GLWE 'dimension' parameter}} %1 = "TFHE.sub_int_glwe"(%0, %arg0): (i8, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{512,12,64}{7}>) @@ -21,7 +21,7 @@ func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{512,12,64} // ----- // GLWE polynomialSize parameter -func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.sub_int_glwe' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.sub_int_glwe"(%0, %arg0): (i8, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,11,64}{7}>) @@ -31,7 +31,7 @@ func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64 // ----- // integer width doesn't match GLWE parameter -func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { +func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,11,64}{7}> { %0 = arith.constant 1 : i8 // expected-error @+1 {{'TFHE.sub_int_glwe' op should have the same GLWE 'polynomialSize' parameter}} %1 = "TFHE.sub_int_glwe"(%0, %arg0): (i8, !TFHE.glwe<{1024,12,64}{7}>) -> (!TFHE.glwe<{1024,11,64}{7}>) diff --git a/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.mlir b/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.mlir index 1a1ba1b56..9ff8e2744 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/op_sub_int_glwe.mlir @@ -1,7 +1,7 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK-LABEL: func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> -func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +// CHECK-LABEL: func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> +func.func @sub_int_glwe(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // CHECK-NEXT: %[[V1:.*]] = arith.constant 1 : i8 // CHECK-NEXT: %[[V2:.*]] = "TFHE.sub_int_glwe"(%[[V1]], %arg0) : (i8, !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> // CHECK-NEXT: return %[[V2]] : !TFHE.glwe<{1024,12,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/ops.mlir b/compiler/tests/check_tests/Dialect/TFHE/ops.mlir index fc695247c..1d0d9772c 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/ops.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/ops.mlir @@ -1,23 +1,23 @@ // RUN: concretecompiler --action=roundtrip %s 2>&1| FileCheck %s -// CHECK: func @keyswitch_glwe(%[[A0:.*]]: !TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1,527,64}{7}> -func @keyswitch_glwe(%arg0: !TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1,527,64}{7}> { +// CHECK: func.func @keyswitch_glwe(%[[A0:.*]]: !TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1,527,64}{7}> +func.func @keyswitch_glwe(%arg0: !TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1,527,64}{7}> { // CHECK-NEXT: %[[V0:.*]] = "TFHE.keyswitch_glwe"(%[[A0]]) {baseLog = 2 : i32, level = 3 : i32} : (!TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1,527,64}{7}> // CHECK-NEXT: return %[[V0]] : !TFHE.glwe<{1,527,64}{7} %0 = "TFHE.keyswitch_glwe"(%arg0) {baseLog = 2 : i32, level = 3 : i32} : (!TFHE.glwe<{1,1024,64}{7}>) -> !TFHE.glwe<{1,527,64}{7}> return %0: !TFHE.glwe<{1,527,64}{7}> } -// CHECK: func @bootstrap_glwe(%[[GLWE:.*]]: !TFHE.glwe<{1,527,64}{7}>, %[[LUT:.*]]: !TFHE.glwe<{1,527,64}{7}>) -> !TFHE.glwe<{1,1024,64}{7}> -func @bootstrap_glwe(%glwe: !TFHE.glwe<{1,527,64}{7}>, %lookup_table_glwe: !TFHE.glwe<{1,527,64}{7}>) -> !TFHE.glwe<{1,1024,64}{7}> { +// CHECK: func.func @bootstrap_glwe(%[[GLWE:.*]]: !TFHE.glwe<{1,527,64}{7}>, %[[LUT:.*]]: !TFHE.glwe<{1,527,64}{7}>) -> !TFHE.glwe<{1,1024,64}{7}> +func.func @bootstrap_glwe(%glwe: !TFHE.glwe<{1,527,64}{7}>, %lookup_table_glwe: !TFHE.glwe<{1,527,64}{7}>) -> !TFHE.glwe<{1,1024,64}{7}> { // CHECK-NEXT: %[[V0:.*]] = "TFHE.bootstrap_glwe"(%[[GLWE]], %[[LUT]]) {baseLog = 2 : i32, glweDimension = 1 : i32, level = 3 : i32, polynomialSize = 2048 : i32} : (!TFHE.glwe<{1,527,64}{7}>, !TFHE.glwe<{1,527,64}{7}>) -> !TFHE.glwe<{1,1024,64}{7}> // CHECK-NEXT: return %[[V0]] : !TFHE.glwe<{1,1024,64}{7}> %0 = "TFHE.bootstrap_glwe"(%glwe, %lookup_table_glwe) {baseLog = 2 : i32, glweDimension = 1 : i32, level = 3 : i32, polynomialSize = 2048 : i32} : (!TFHE.glwe<{1,527,64}{7}>, !TFHE.glwe<{1,527,64}{7}>) -> !TFHE.glwe<{1,1024,64}{7}> return %0 : !TFHE.glwe<{1,1024,64}{7}> } -// CHECK: func @glwe_from_table(%[[LUT:.*]]: tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> -func @glwe_from_table(%lookup_table: tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> { +// CHECK: func.func @glwe_from_table(%[[LUT:.*]]: tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> +func.func @glwe_from_table(%lookup_table: tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> { // CHECK-NEXT: %[[V0:.*]] = "TFHE.glwe_from_table"(%[[LUT]]) : (tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> // CHECK-NEXT: return %[[V0]] : !TFHE.glwe<{1,1024,64}{7}> %0 = "TFHE.glwe_from_table"(%lookup_table) : (tensor<128xi64>) -> !TFHE.glwe<{1,1024,64}{7}> diff --git a/compiler/tests/check_tests/Dialect/TFHE/types_glwe.mlir b/compiler/tests/check_tests/Dialect/TFHE/types_glwe.mlir index 7c0e540c0..5c232d96b 100644 --- a/compiler/tests/check_tests/Dialect/TFHE/types_glwe.mlir +++ b/compiler/tests/check_tests/Dialect/TFHE/types_glwe.mlir @@ -1,13 +1,13 @@ // RUN: concretecompiler %s --action=roundtrip 2>&1| FileCheck %s -// CHECK-LABEL: func @glwe_0(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> -func @glwe_0(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { +// CHECK-LABEL: func.func @glwe_0(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> +func.func @glwe_0(%arg0: !TFHE.glwe<{1024,12,64}{7}>) -> !TFHE.glwe<{1024,12,64}{7}> { // CHECK-LABEL: return %arg0 : !TFHE.glwe<{1024,12,64}{7}> return %arg0: !TFHE.glwe<{1024,12,64}{7}> } -// CHECK-LABEL: func @glwe_1(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> -func @glwe_1(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> { +// CHECK-LABEL: func.func @glwe_1(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> +func.func @glwe_1(%arg0: !TFHE.glwe<{_,_,_}{7}>) -> !TFHE.glwe<{_,_,_}{7}> { // CHECK-LABEL: return %arg0 : !TFHE.glwe<{_,_,_}{7}> return %arg0: !TFHE.glwe<{_,_,_}{7}> } diff --git a/compiler/tests/end_to_end_fixture/end_to_end_encrypted_tensor.yaml b/compiler/tests/end_to_end_fixture/end_to_end_encrypted_tensor.yaml index ab58e4f4d..449f8e787 100644 --- a/compiler/tests/end_to_end_fixture/end_to_end_encrypted_tensor.yaml +++ b/compiler/tests/end_to_end_fixture/end_to_end_encrypted_tensor.yaml @@ -1,6 +1,6 @@ description: identity program: | - func @main(%t: tensor<2x10x!FHE.eint<6>>) -> tensor<2x10x!FHE.eint<6>> { + func.func @main(%t: tensor<2x10x!FHE.eint<6>>) -> tensor<2x10x!FHE.eint<6>> { return %t : tensor<2x10x!FHE.eint<6>> } tests: @@ -16,7 +16,7 @@ tests: --- description: extract program: | - func @main(%t: tensor<2x10x!FHE.eint<6>>, %i: index, %j: index) -> + func.func @main(%t: tensor<2x10x!FHE.eint<6>>, %i: index, %j: index) -> !FHE.eint<6> { %c = tensor.extract %t[%i, %j] : tensor<2x10x!FHE.eint<6>> return %c : !FHE.eint<6> @@ -61,7 +61,7 @@ tests: --- description: extract_slice program: | - func @main(%t: tensor<2x10x!FHE.eint<6>>) -> tensor<1x5x!FHE.eint<6>> { + func.func @main(%t: tensor<2x10x!FHE.eint<6>>) -> tensor<1x5x!FHE.eint<6>> { %r = tensor.extract_slice %t[1, 5][1, 5][1, 1] : tensor<2x10x!FHE.eint<6>> to tensor<1x5x!FHE.eint<6>> return %r : tensor<1x5x!FHE.eint<6>> } @@ -77,7 +77,7 @@ tests: --- description: extract_slice_stride program: | - func @main(%t: tensor<2x10x!FHE.eint<6>>) -> tensor<1x5x!FHE.eint<6>> { + func.func @main(%t: tensor<2x10x!FHE.eint<6>>) -> tensor<1x5x!FHE.eint<6>> { %r = tensor.extract_slice %t[1, 0][1, 5][1, 2] : tensor<2x10x!FHE.eint<6>> to tensor<1x5x!FHE.eint<6>> return %r : tensor<1x5x!FHE.eint<6>> } @@ -93,7 +93,7 @@ tests: --- description: insert_slice program: | - func @main(%t0: tensor<2x10x!FHE.eint<6>>, %t1: tensor<2x2x!FHE.eint<6>>) -> tensor<2x10x!FHE.eint<6>> { + func.func @main(%t0: tensor<2x10x!FHE.eint<6>>, %t1: tensor<2x2x!FHE.eint<6>>) -> tensor<2x10x!FHE.eint<6>> { %r = tensor.insert_slice %t1 into %t0[0, 5][2, 2][1, 1] : tensor<2x2x!FHE.eint<6>> into tensor<2x10x!FHE.eint<6>> return %r : tensor<2x10x!FHE.eint<6>> } diff --git a/compiler/tests/end_to_end_fixture/end_to_end_fhe.yaml b/compiler/tests/end_to_end_fixture/end_to_end_fhe.yaml index b2ed17e9f..f1cc70cfe 100644 --- a/compiler/tests/end_to_end_fixture/end_to_end_fhe.yaml +++ b/compiler/tests/end_to_end_fixture/end_to_end_fhe.yaml @@ -1,6 +1,6 @@ description: identity program: | - func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { + func.func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { return %arg0: !FHE.eint<3> } tests: @@ -11,7 +11,7 @@ tests: --- description: zero_tensor program: | - func @main() -> tensor<2x2x4x!FHE.eint<6>> { + func.func @main() -> tensor<2x2x4x!FHE.eint<6>> { %0 = "FHE.zero_tensor"() : () -> tensor<2x2x4x!FHE.eint<6>> return %0 : tensor<2x2x4x!FHE.eint<6>> } @@ -22,7 +22,7 @@ tests: --- description: add_eint_int_cst program: | - func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { + func.func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 1 : i3 %1 = "FHE.add_eint_int"(%arg0, %0): (!FHE.eint<2>, i3) -> (!FHE.eint<2>) return %1: !FHE.eint<2> @@ -47,7 +47,7 @@ tests: --- description: add_eint_int_arg program: | - func @main(%arg0: !FHE.eint<2>, %arg1: i3) -> !FHE.eint<2> { + func.func @main(%arg0: !FHE.eint<2>, %arg1: i3) -> !FHE.eint<2> { %1 = "FHE.add_eint_int"(%arg0, %arg1): (!FHE.eint<2>, i3) -> (!FHE.eint<2>) return %1: !FHE.eint<2> } @@ -65,7 +65,7 @@ tests: --- description: sub_int_eint_cst program: | - func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { + func.func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 7 : i3 %1 = "FHE.sub_int_eint"(%0, %arg0): (i3, !FHE.eint<2>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> @@ -90,7 +90,7 @@ tests: --- description: sub_eint_int_cst program: | - func @main(%arg0: !FHE.eint<5>) -> !FHE.eint<5> { + func.func @main(%arg0: !FHE.eint<5>) -> !FHE.eint<5> { %0 = arith.constant 7 : i6 %1 = "FHE.sub_eint_int"(%arg0, %0): (!FHE.eint<5>, i6) -> (!FHE.eint<5>) return %1: !FHE.eint<5> @@ -107,7 +107,7 @@ tests: --- description: sub_eint_int_arg program: | - func @main(%arg0: !FHE.eint<4>, %arg1: i5) -> !FHE.eint<4> { + func.func @main(%arg0: !FHE.eint<4>, %arg1: i5) -> !FHE.eint<4> { %1 = "FHE.sub_eint_int"(%arg0, %arg1): (!FHE.eint<4>, i5) -> (!FHE.eint<4>) return %1: !FHE.eint<4> } @@ -130,7 +130,7 @@ tests: --- description: sub_eint program: | - func @main(%arg0: !FHE.eint<4>, %arg1: !FHE.eint<4>) -> !FHE.eint<4> { + func.func @main(%arg0: !FHE.eint<4>, %arg1: !FHE.eint<4>) -> !FHE.eint<4> { %1 = "FHE.sub_eint"(%arg0, %arg1): (!FHE.eint<4>, !FHE.eint<4>) -> (!FHE.eint<4>) return %1: !FHE.eint<4> } @@ -153,7 +153,7 @@ tests: --- description: sub_int_eint_arg program: | - func @main(%arg0: i3, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { + func.func @main(%arg0: i3, %arg1: !FHE.eint<2>) -> !FHE.eint<2> { %1 = "FHE.sub_int_eint"(%arg0, %arg1): (i3, !FHE.eint<2>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> } @@ -176,7 +176,7 @@ tests: --- description: neg_eint program: | - func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { %1 = "FHE.neg_eint"(%arg0): (!FHE.eint<7>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -200,7 +200,7 @@ tests: --- description: neg_eint_3bits program: | - func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { + func.func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { %1 = "FHE.neg_eint"(%arg0): (!FHE.eint<3>) -> (!FHE.eint<3>) return %1: !FHE.eint<3> } @@ -224,7 +224,7 @@ tests: --- description: mul_eint_int_cst program: | - func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { + func.func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 2 : i3 %1 = "FHE.mul_eint_int"(%arg0, %0): (!FHE.eint<2>, i3) -> (!FHE.eint<2>) return %1: !FHE.eint<2> @@ -249,7 +249,7 @@ tests: --- description: mul_eint_int_arg program: | - func @main(%arg0: !FHE.eint<2>, %arg1: i3) -> !FHE.eint<2> { + func.func @main(%arg0: !FHE.eint<2>, %arg1: i3) -> !FHE.eint<2> { %1 = "FHE.mul_eint_int"(%arg0, %arg1): (!FHE.eint<2>, i3) -> (!FHE.eint<2>) return %1: !FHE.eint<2> } @@ -272,7 +272,7 @@ tests: --- description: add_eint program: | - func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<7>, !FHE.eint<7>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -295,7 +295,7 @@ tests: --- description: apply_lookup_table_1_bits program: | - func @main(%arg0: !FHE.eint<1>) -> !FHE.eint<1> { + func.func @main(%arg0: !FHE.eint<1>) -> !FHE.eint<1> { %tlu = arith.constant dense<[0, 1]> : tensor<2xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<1>, tensor<2xi64>) -> (!FHE.eint<1>) return %1: !FHE.eint<1> @@ -312,7 +312,7 @@ tests: --- description: apply_lookup_table_2_bits program: | - func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { + func.func @main(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %tlu = arith.constant dense<[0, 1, 2, 3]> : tensor<4xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<2>, tensor<4xi64>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> @@ -333,7 +333,7 @@ tests: --- description: apply_lookup_table_3_bits program: | - func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { + func.func @main(%arg0: !FHE.eint<3>) -> !FHE.eint<3> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7]> : tensor<8xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<3>, tensor<8xi64>) -> (!FHE.eint<3>) return %1: !FHE.eint<3> @@ -354,7 +354,7 @@ tests: --- description: apply_lookup_table_4_bits program: | - func @main(%arg0: !FHE.eint<4>) -> !FHE.eint<4> { + func.func @main(%arg0: !FHE.eint<4>) -> !FHE.eint<4> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]> : tensor<16xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<4>, tensor<16xi64>) -> (!FHE.eint<4>) return %1: !FHE.eint<4> @@ -375,7 +375,7 @@ tests: --- description: apply_lookup_table_5_bits program: | - func @main(%arg0: !FHE.eint<5>) -> !FHE.eint<5> { + func.func @main(%arg0: !FHE.eint<5>) -> !FHE.eint<5> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]> : tensor<32xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<5>, tensor<32xi64>) -> (!FHE.eint<5>) return %1: !FHE.eint<5> @@ -396,7 +396,7 @@ tests: --- description: apply_lookup_table_6_bits program: | - func @main(%arg0: !FHE.eint<6>) -> !FHE.eint<6> { + func.func @main(%arg0: !FHE.eint<6>) -> !FHE.eint<6> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]> : tensor<64xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<6>, tensor<64xi64>) -> (!FHE.eint<6>) return %1: !FHE.eint<6> @@ -417,7 +417,7 @@ tests: --- description: apply_lookup_table_7_bits program: | - func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]> : tensor<128xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<7>, tensor<128xi64>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> @@ -438,7 +438,7 @@ tests: --- description: apply_lookup_table_8_bits program: | - func @main(%arg0: !FHE.eint<8>) -> !FHE.eint<8> { + func.func @main(%arg0: !FHE.eint<8>) -> !FHE.eint<8> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]> : tensor<256xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<8>, tensor<256xi64>) -> (!FHE.eint<8>) return %1: !FHE.eint<8> @@ -459,7 +459,7 @@ tests: --- description: apply_lookup_table_multiple_precision program: | - func @main(%arg0: !FHE.eint<6>, %arg1: !FHE.eint<3>) -> !FHE.eint<6> { + func.func @main(%arg0: !FHE.eint<6>, %arg1: !FHE.eint<3>) -> !FHE.eint<6> { %tlu_7 = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]> : tensor<64xi64> %tlu_3 = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7]> : tensor<8xi64> %a = "FHE.apply_lookup_table"(%arg0, %tlu_7): (!FHE.eint<6>, tensor<64xi64>) -> (!FHE.eint<6>) @@ -476,7 +476,7 @@ tests: --- description: apply_lookup_table_random_func program: | - func @main(%arg0: !FHE.eint<6>) -> !FHE.eint<6> { + func.func @main(%arg0: !FHE.eint<6>) -> !FHE.eint<6> { %tlu = arith.constant dense<[16, 91, 16, 83, 80, 74, 21, 96, 1, 63, 49, 122, 76, 89, 74, 55, 109, 110, 103, 54, 105, 14, 66, 47, 52, 89, 7, 10, 73, 44, 119, 92, 25, 104, 123, 100, 108, 86, 29, 121, 118, 52, 107, 48, 34, 37, 13, 122, 107, 48, 74, 59, 96, 36, 50, 55, 120, 72, 27, 45, 12, 5, 96, 12]> : tensor<64xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<6>, tensor<64xi64>) -> (!FHE.eint<6>) return %1: !FHE.eint<6> diff --git a/compiler/tests/end_to_end_fixture/end_to_end_fhelinalg.yaml b/compiler/tests/end_to_end_fixture/end_to_end_fhelinalg.yaml index 0ddacce9b..ae15b9e04 100644 --- a/compiler/tests/end_to_end_fixture/end_to_end_fhelinalg.yaml +++ b/compiler/tests/end_to_end_fixture/end_to_end_fhelinalg.yaml @@ -1,6 +1,6 @@ description: transpose1d program: | - func @main(%input: tensor<3x!FHE.eint<6>>) -> tensor<3x!FHE.eint<6>> { + func.func @main(%input: tensor<3x!FHE.eint<6>>) -> tensor<3x!FHE.eint<6>> { %1 = "FHELinalg.transpose"(%input): (tensor<3x!FHE.eint<6>>) -> tensor<3x!FHE.eint<6>> return %1 : tensor<3x!FHE.eint<6>> } @@ -15,7 +15,7 @@ tests: --- description: transpose2d program: | - func @main(%input: tensor<3x2x!FHE.eint<6>>) -> tensor<2x3x!FHE.eint<6>> { + func.func @main(%input: tensor<3x2x!FHE.eint<6>>) -> tensor<2x3x!FHE.eint<6>> { %1 = "FHELinalg.transpose"(%input): (tensor<3x2x!FHE.eint<6>>) -> tensor<2x3x!FHE.eint<6>> return %1 : tensor<2x3x!FHE.eint<6>> } diff --git a/compiler/tests/end_to_end_fixture/end_to_end_programs.yaml b/compiler/tests/end_to_end_fixture/end_to_end_programs.yaml index 54e5f7967..adb90c66a 100644 --- a/compiler/tests/end_to_end_fixture/end_to_end_programs.yaml +++ b/compiler/tests/end_to_end_fixture/end_to_end_programs.yaml @@ -1,7 +1,7 @@ description: mnist_28_mlir_7b program: | // reported by concrete-ml on https://github.com/zama-ai/concrete-numpy-internal/issues/1553 - func @main(%arg0: tensor<1x784x!FHE.eint<7>>) -> tensor<1x10x!FHE.eint<7>> { + func.func @main(%arg0: tensor<1x784x!FHE.eint<7>>) -> tensor<1x10x!FHE.eint<7>> { %cst = arith.constant dense<"0x000000000000000002000000000000000000000000000001020000010000000000000000000000020000000100010200000000000001000000000002000002000000000001000000000000010000000002020000000000000200000000000000000000000000000000000000000000000000000001000000000000020001000000010000000000000000000000010000000002000000000000010000000000000000000000020000000000020000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000020000020100000000000000000000010000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000200020000000202000000000000000000000000000000000200000000000000010000020000000200000200000100000000000001000000000000000000000001000000000000000000000000000002000000000100000000000000000000000200000000000000000000000000000000000000000000000000000000020000000000000000000200000200000200000000000000020002000101020000000000000000000000000000000000000001000200000002000000000000000001000000010000000200000000000000000000000000000001000000000000000000000002000000000000000000000000000100000000000000000000000002000000000000000000000000000000000200000200000002000000000000000000000000000000000002000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000100010000000000020000010000020000020200000000020000000000020000000000000000000000000200000000000000010000000002000000000000000000000200000000010100000000000000000000000000000002000000000000000200000000000000000000000000000000000000000000000000000000020000000001000000000000000000000000000000000000000000000000000000000000000002000200000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000010000000000000000000100000000000000000000000000000000000000000000000000000001000000000000000000020000000000000001020000000000000200000000020000000000000000000000000000000200020000010000000000000000000000000002000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000002000000000000000200000002000000000000010000000000000000000000000000000000000000000100010000000000000000000000000000020000000001000000000000000000000000000200000001020000010200000000000000020000020000000200020202020000000000000000000000000000000000000000000001020000000000020200000200000000000000000200000000000100000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000001000000000002010000000002000000000100000000020000000000000000000200000000000002000000000000000002010000000000000000000000000000000100000000000000000000000000000002000000000000000100020000000000000000000000000001000000000000000000000000000000000000000000000000000000000001000000000000000000000000000002000200000002000200020000000200000100000000000000000000000100000000000102000201000200020200000000000000020000000000000000000000020200000000000000000000000000000000000002000200020002000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000001000000000000020000000000020100000000000000000000000000010000000000000000000000000000000102010000000000000000000000020000000002020000000000000000000100000000000000000000000100000000000000000002000002000000000100010201000100000200000000000000000000000200000000000201000000000200000002000000000000000000000000000000000100000001000100000000000000000000000000000000000000000000000000000000000100000000000000000001000000000000000002000000000000000200000000000000020000000000000000000001000000000000000000000000000000000000000000000000020000000000020000000000000100000000000000000000000000010001000000000000000000010000000100010000000000000000000100020000000000000001000000000000010000010000000000000100000000000000000000000000000000000000000000000000020000000000000000000000000000020000000000000000000002000000020000000000000000000000000000000002"> : tensor<192x10xi8> %cst_0 = arith.constant dense<"0x000000000000000000000000000000020000020000000000000000000000000001000000000000000002000000000002000100000000000200020000000000020200000000000000000000020000020000000000000000000002000200000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000001000000000200010000000000010000020000000000000000000000000000000000000200000000000002000000000000000000000000000000000000000002020000000000020000000200000000000000000000000000000000000000000000000000000000000000000000000000010000000002000000000000000000000000000000000200000000000000000000020000000000000000010200000000000000020002000002000000000000000001000001000000000101000000020000000000000000000000000000000200000000010002000000000200020000020002010000000000000000000000000000000000000002000000020000000000000000000000000000000000000002000000000000000000000000000002020000000002000000000000000000000000000000000200000002000000000000010000000000010000000000000000000000000000000000000200000000000001020000000002000000010002000000000001000000000200000000000000000001000200010000000002000000000000000000000000000200020000000000000000020200000002000002000000000000000002000000020000000000000000000000000000000200000000000000000002000000000000000002000000000200000000000000000000020000000000000000020000020202000200000000000000000000000000000000000100000200020000000000000000000000000000000000000000010000010000000000000000000200020000000002000202000000000000000200000000000000000000020000000200020200000000000000000000000000000000000000000002000000000000020002000000000000000000000200000000000000000000000000000000000000000200000002000000000000000000000000000000000000020000000200000000000002020000000000000000000000000000000000000000000000000000000002000000000000000100000000020000010000000000000000000000000000000000000000000000000001000002000000000000000000000200000000020000000000000000000000000000000000000000000002000000000100000000000000000000000002020000000000000000000000000202000000000000000000000000000000000000020000000002000002000000000000000000000001000000000000000200000000020000000000000200000000000000000000000000010000000202000000000000000000000000000002000200000000000000000000000000000000000000020000000000000201000000000100000000000000000000000000000000000000000000000200000000000000000000000000000000020001000000000200020200000000000000020000000000000000020000000000000000000000000002020000000000010000020000000001000002000000020000000000000000000000020000000100000000000000020000010100000000000000000000010000000000000000000000000000000000000000000001000200000000000002000002000000000000000000000000000000000000000000000000000000020000000000000001000000000000000002000000000000000000000000000000020000000000000002000000000000000000000000000000000000000000010000000000000200000000000000000002000000000000020000000000000000000000020000000000000000000000000002020000000000000200000200020000000000000000000200000000000000000000000000000000000200000200000000000000000200000000000000000000000001000000000000000200000000000000000000020000020000000000000000000000000100000000000200000002000000000000000000000000000000020000000002000002000100000200000000000000020000000200000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000020000000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000000200000001000000020000000200000000000000000000000000000000000000020000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000002020000000000000000000000000002010001000000020202000000000000020000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000002000000000000010000000200000000000201000000000002000000000000000000000100000000000000000000000000000200020202000200000200000002020002000000000002000000000000000002000000000000000000000000000000000000000000000000000000000000000000000002020000020000000000020000000000000000020000000000000000000200000000000000000000000000000000020000000000000000000002000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002000000020000000000000000000000000000000000000001000000000000000200000200000000000002020000000000000000000000000000000002000100000000000200000000000000020000000001000000000000000000000000000000000100000000000002000002000000000000000000000000000000000002000000000000020200000002000000010000000000000000000000000000000200000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000000000000000000000000000000020100010000000000000000000000020000010000000000020200000000000000000000000000020000000000000000000000000000000000000000000200000000020000000200000000000000000000000000000200000000000200000000000000000000000100020000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000200000002020000000000000200000000000000000200000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000200010100000200000000000000000000000000000200000000000002000000000000000002000002020000000000000000000000000000010000000000000000020000000000000200000100000000000001000000000000000000000000000000000000000000000000020000000000000000000000000000000002000002000000000000020200010200000000000000000000000200000000000200000002000000000000000000020000000000000000000000000000000000000000000200000000000001000000000000000000000002000000000000000000000200020000000000000000000000000000000000020000000000000001000000000000020200010000000000000000000000000200000000000000000002000000000000000000000002000100000000000000000000000000000200000000000000000200000000020000000000000000000200000000000200000000000000000002000001000000010000000000000000000000000000000000000200020000000000000000020000020200000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000000100000002000000000000000000000000000000000000000200000000000000000000000002000000000200000000000000000000000000000002000202000200000002000000000002000000000000000200000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000200000000000000000200010000000002000000000002000000010000020000000000000000000000000000000000000000000000000000000000000002000000000000000000000000020002000000000000000000000000020000000000000000000000000000000000000000000200000000000000000000020000000000000002000000000000000000000000000000000100000000000000000000000100000000000000000200000000000200000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000000020002000000000000020000020000000000000000000000000000000000020000000000000000000000000002000000000000020000000001000000000002000000020000000000000000000002000000000000000000000000000000010000000000000000000000000000020000000000000000000000000000000000000002000000000000000000000000000000000201000002000000000000000000000000000200000200000000010000000000000200000000000000000000000000000000000000000000000000000000000000020002000200000000000002000000000000000000000000000000000000000202000000000000000000000000000000000000020000000000000000020000000000000000000000000002010000000000000001000000020000000000000200000000000000000000000002020100000000020000000000000000020000000000000000020200000000000000000002000000000000000000000000000002000000020000000000000000000000000200000002000000000000000000000000020000000000000000000000000000000000020200000000000000000000000000000000000000000000020200000002000000000000000000000000000000000001000200010000000000000000000000000000000200000200020000000000000000000000000000000000000000000000000002000000000000000000000000020000000200000002000000000000000200000000000000000000000000000000000000000000000000020000000002000000000002000200000000000000000101000002000000020000000000000000020000000000000000000000000200000002000000000000000000000000000200000000000000020200000000000000000000000000020000000200000000020000000000000002000000000001000000000000000000020000000000000000000000000000000000000200000000000000000000000200000000000000000000000000000000000002000002020000000002000000000001000000000000000000020200000000000000020002020000000000000000010002000000000000000000020000000000000002020000020000010200000000000000000000020000000000020201000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000001000000020000020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000200000002000000000000000000000000000000000000000000000000000000000000000200000000000000020000000000020000000000000000000000000000000000000000000000000002000000020000000000000200000000000000000000000000000200000001000000000000000000000000000000000000020000020100020000000002000000000002000000000000000000000000000000020000000200000000000000000000000000000000000000000200020000000000000200000000000000000000020000000000000001000000000000000000000002000200000001000000020000000000000000020000000000000000000000020000000100000000000000000000000000000000000000000200000000000000000200000200000000000000000000000000000200000000020001000000000000000000000000000000020000000000000000000000000000000000000000000000000000000002000000000000000200000000000000000001000000000000000000000000020000000000000000000000000200000002000000000200000000000000020001000000000200000000000000000000000200000000000000000000000000000000000000000000000000000000020000020000000200010200000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000002020000000000000000000000000000000000000000000200000001000002000000000000000000000000000000000000010000000000000000000002010000000000000000000000000000000000000000000002000002000000000200000000000100000000010000000000000001000002000200000200000000020000000200000200000002000000000202000000000000000000000000000000010000000000000000000000000000000000020000000000000000000100000000000000000200000000000000000000000000000000000000000000000000000200000000000000000000000000000000000200000000000000000000000000010000000000000000000000000000000000000000000000000202000202000000000000000000000000000000000000000000000000000000000001000000000002000000000000000000000000000002000000000002000000000000000000020002000000000000000000000000000000000000000000000000000000000000000002000000000000000200000000000000000000000000000000000200020000000000000000000000000200000000020000000000000000010102000000020200000000000002020002000200000000000000000002020002010000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000002000000000000000000000000000000000000000000000000000000000202000000000000000100000000000000000000000000000000000000000000000000000000000200000000020000000000000200000000000000000200000000000000000100000000000000000000000000000000000000000000000200000000000000000000010000000000020000000000000000000000000000020000000000000000000000000000000000010000000001000000000000000002000000000000000000000000000000000100000000000100000002000000000000000200000000000000000002000000000000000000000101000000000000000000000000000000000002000000000200000000000002000002000000000200000000020000000000000002000002000000000000000000000000010002000000000000000000000001000001000000000000000000000000000000000000000000000001000000000200000000000000000000000000000002000002000000000000000000000000000000000000000000000200020000000000000000000202000000010000000000000000000000000200000002000002000000000000000000000000000000020000000200020000000000000000000100000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000020000000000000000020202000000000000020200000000000000000000000002000000000000000000000000020100000000000000000000000000000000020000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000200000000000000000000000100000200000000000002000100000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000200000000020200000000000001000200000000000000000000000000000000000000000002000000000000010000000000000000000000000000000200000000000000000000000202000000000000000000000002000000020000000000000000000000000000000200000200000000000000020000000000000000000200000000000000000002020200000000000100000000000000000000020002000000000000000000000000000002000000000002020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000001000002000000000000000000000000020002000100000000020000020000000100000000000000000202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200020000000100000000000200000000000000000000000000000000000000000000000000000000000000000200000001000000000000000000000000000000000100000000000000000200000000000000000000000000000200000000000000000200000000000000000000000000000000000002000000000000020002000000000000000000000000000000000000020000000000000000000000000000010000000002000200000000000000000000020000000000020000020002020002000000000200000000000000000002020000000000000000000000000000000000000200000001000000000200000000000000000000000001000000000000000000000000000002000000000200000000000000000000020000000000020000000000000000000000000000000000020000000100000002020002000000000000000000000000000000000100000000000000000000010000000000000000000200000000000000000000000202000000000200020002000002000000000000000000000200000000000002000000000000000000000001000000000000000000000200000000000000000000000000000000000000000000000000000000000002000000000000020000000000000000020000000000000000000000000002000002000002000000000100000002000000000100000000000002000001000000000200000000000000000000000000000000000000000000000002000000000000000000000202000000000002000000000000000000000000000000000002000002000000000002000200020000000000000000010000000000000000000000000002000000000000000000000000000000000000000000000000000200000000000000000000020000000000000000000102020000000200000002000000000202000000000000000100000000000000000000000000000002000002000000000200000000000200000002000001000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000200000001000000000002000000000000000000000000000000000000000000000000000000000000010000000000000002000200000000000200000002000000000200000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000020200010001000000020000000000000000000000000200020002000000000000020000000000000000000000020000000002000000000000000200000000000002000000000200000000000000000000000000000000020001000000000000000000000000000000000002010002000000000000010200000000000000000001000002000000000000000000000000000202000202000200000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000020001000000020000000000000000000000000000000000000000020202000000000100000002000000000002000000000001000000000000000000000001000000000000000000000000000000000000020000000000000000000000000000000200000000000000020000000000000000000000000000000000000000000201000000000000000000010000000002000002000200000000000000020000000000000000000000000002000000000000000000000100000202000000000000020000000000000000000000000200000000000000000000000000000200000000000000010200000000020000000000000200000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000200000000020000000000000000000000000000000000000100000000020200000000000000000000000000000200010002000000000001000000000000000000000000000000000000000000000000000200000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000200000000000001000000000000000000000000000001000000000000000000020200020000000000000000000000000002000002000000020000000000000000000000000000000001000000000000000100000000000000020000000000000000020002000000000000000000000000000000000200000002000000000002000000000000000000000000000000000000000000000000000000000000000200020200000000000000000000000000000000020000000000000000000000000000000100000002000002000000020000000200000000000000020000000002020000000002000000000002000000000002000000000000000000000000000000000000000200000202000000000000000000000000000002000000000000000000020000000000000000000200000000000000000000000000000000000000000000000000000000000000000200010200000000000000020000000000000000000001000000020000000000000002010000000000020000000000000002000200000000000002000000000000020200000000000001000000000000000002000000000201000002000000000000000000000000000200000000010000020000000000000000000000000000000000020000000000000000000000000000000000020000010000000000000000020000000000000000000000020000000000000001000000000000000000000000000000020200000202000101000000000000000000000002000000000000000000000200000000000000000200000000000000020000000000000000000000000000020000000000000002000000000000000000000200000200010000020000000000000000010002020000000000010000000000000000000002000202000000000000000000000000000001000000000000000000000001000000000000000002000000000000000000000000000000020000000001000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000002000200000000000000000002000000000002000000000000000000000002000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000002000000000001000000000002000200000000000000000100000000000000020000000200000000000000000000000000000000000000010000000000020100000000000000000000000000020000000002000000000000000000000200000000000200000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000020000020000000000000000000000000201000001000000000000000002000000000000020200000000000000000000000000000000000000000000000000020000000000000001000000000000020000000000000000020000000000000000000000000000000200000000000202000000020000000000000000020000020000000000000000000000000001000000000002000000010000000000000000000001000000000000000000020002000000000000000000000000000000000000000000000000000000020002000000000000000000020000020000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000002000000000000020000000001000000000100000000000000000002000000000000000000000000000000020000000000000200000000000000000000000000000000000000000000000000000000020000000002000000000000000000000000000000000000020000020000000200000100000000010000000000000000000000000200000000000000000000000000000000000002000000000000000000000000000200000200000000020000020000000000000000000000000002000000000000000200000000000000020000000200020000000000000002000000000000000000020200000001000000000000000200000000020000000000020000000000000000000000000000000000000000000002000000020000000000000200000000000000000000000000020000020201000200020200000000000002000000000000000200000200000000000200000000000000000000000100000000000000000000000000000000000000000000000002010000000000000000000001000000020200000200000000000000000200000200020000000000000000000000000000000000000000020000000200020000000000000000010000000000000200000200000201000000000000000000000000000200000000000000000000000000000000000002000000000000000000000000000000000002000000000000020000000002000000000000000000000000000000000000000002020000000200000000000000010100000000000000000000000000000000000000020000000000000001000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000010000000000000200000200000000000200000000020000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000200000000000000000000000200000201000000000000000000000202000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000001000000000100010000000000000000000200000000000000020000000100000002000000000000000000000000000000000000000000000002000000000002000000000000000000000000000000000000000000000200000000000000000202000000000000000000020200020200000000000000000200000000000000000002000000000002000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000010000000002000000000000000000000000000000000000010000000000000000000000000000010000000000010000000000020100000000000000000000000000000002000000010000000200000000000000000000000000000000000001000101000000000001000000000200000000000000000001000000000000000000000000000000000000000000000000000000000000000000000100000000000200000000000100000000000000000001000000020000000000000000000000000000000000000000000000020000000000000200000000000000000000020200000000000000000000000000020000000000000000000000000002000002020000000000000000000200000002000000000000000002000002000202000000000200000000020000000000000002000000000000000000000000020000000002000000000000000000000000000000000000000000000000000000000000000000000000000200010000000002000000000000000200000000000000000002000000000000000000000000000202000000000000000000000000000000020000000000000000000000000000000000000002000000000100000000000000000002000001000000000000000000000000000000000000000000000200000000000001000000000000020000000000000000000000000001000000000002000000000200020000020200010000000000000001000000000001000002000000000000000000000000000100000002000000000000000000000100000000000000000200000000000000000100000000000000000000000000000000000000000000000000000000020000000200000000000000000000000200000000000000000200000000000000000000000000000000000000000000000000000000000002020000000000000200000000000000000000000000020000000000000000000000000000000000000000000001020000000000000000000000000100000000000000000200020000000000000000020001000200000000010000000000000000000000000002000000020000000000000000000200000000000000000000000000000000000002000000000000000000020000000000000000000000020002000002000000020200000000000000020000000000000000000000000000000000000000020200000000000200000000020000020000000000000000000000000000000000010000000001000000000000020001000000000000000100000000000000000000000000000002000000020000000000000000000000000000020000000000000000000000000000000000020000000000000000000002000000000000000001000000000000020002000100000000000000000000000000000000000000000000000000000200000202000000020000000000020000000000000000000000020000000000000000000000000000000002000000000000000000000000020000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000002000002000000000000000000000000000002000000000100000000000000000000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000010000010000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000001000201000200000000000000000100000000000000010000000000020000000001000200000201000000010000000000000000000002020000000000000000020000000002000002000000000000000200020000000200000200000200000000000002000002000000000001000000000000000000000000000200000000000000000200000200000001000000000000000000000000000201000000000000020000000000000000000000000000000000000000000000000000020000010000000000000000000000000200000000010000000000000000020000000000000002000000000000000000000000000000000000000000000000020200000000010000000000000000010000000000000002000000000000000000000000000000020000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000002000000000000000000000200000000000000000000000002020200000000000000000000010000000000000000000000000000000000000200000000000000000002000000000000000000000000000000000000000000000002020000000000000000000001000002000002000200000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000200000000000000000000000200000000000000000000000000000000000000000000000002000000000000000001010000000000000000000200000000000200000000020000020000000200000200000000000000000000000000000000000000000002020000000000000000020000000000000000000000000000000000020000020000000000000000000000000000000002000000000000000000000000020000000002000000010101020002000000000000000000000002000000000000000000000000000000020002000000000001000000000002000000000000000000020000000000000000000000000000000000000000000000000000000200000200020000000000000102010000000000000000000000000000000000000000000000000202000000000000000000000000000200000000020000000000000001000200000000020000000000000000000000000200000000000200000000000000000000000100000000000000000000000002000200000000000002000200000000000000000101000000020000000000000000000000000000000000000000000000000000000000000000020000000000000000000001000001000200020002000000000000000000000000000002000000000000010002000000000000000000000000000002000000000000000000000000000002000200000000000000020000020000000000000000000000000200000000000000000000000000000002020000000200000201020000000002000000000000000200020200000000000000000000000002000000000000000000000100020000000000000002020000020001000000000000020000020000000000000000000000000000000000000000000000020000000000000000000000000000000200000002000000000000000000000000000000000001000000000000000000000000000000000000000000000000000200000000020000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000002000000020000000100000000000000000000010000000000000100000000000000000000000000000200000000000202000000000000000000000000020000000000000000000002020000000000000000020000000000000000020000000000000000020000000000000002000000000200000000000002000000000000000000000200000000000102000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000020000000200000000000200000000000000000200000000000000000000020000000000000000000000000000000000000000020200020000000000000000000000000000000000000000000000000100000000000000010000000000000000000000000000000000020000000000000202000100000000000000000000000000000000000002000000000000000200000000000000020000000002000002000000000000000200000002000000000000000000000100000000000200000002000000000100000000020200000000000000000000000000000000000000000000000100000000000002000000010100000000000001020000000000000000000000000000000000000000000000000001020002020000020000000000010000000000000000000000000000000200000000000000020000000000000000000200000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000200000200000000000000020000000000000002000000000200000000000001000000000000000200000000000000000200000000000000000000000000000200000000000000000000000000000000020000000000020000000000020002000000000000000000000000000000000000000000000002000000000000000200000200000002000000000000000200000000000000000000000000000000000000020000000000000000010000000000000000000000000000000002000000000202000000000000000000000000000000000000000002000000000002000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000000000000000000000000000000000000202010000000002000000000000000000000001000000000000000000000002000002000100000000000200020100000000000002020000000002000000000000000000020000000200000001000002020000000002000000000100000202000000000000020200020000020000000000000002000000000002000000000000000000000001000000000000020000010000000002000002000000000000020002000000000000000100020000000000020000000200000000000200000000000000010200020000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000200000000000000000000000202000000000002000000000000000000000000000000000000000000000000000100000000000000000002000000000000000000020200000000000000000000000000020200020200000000000000000000000000000000000000000000000000000000000000020000000000000200020000000000000000020000000000000000000000000200000000000000010000000000000000000000000001000000000000000000020001000000000000000000000000000000000000000000000000000000000000020200000000000000000000000000000000000100000200000000000000000000000000000000000000020202000000000000000000000000000000000000000000000002020000000000020000000000000000000200000000000000000000000200000000000000000000000000000000020000000000010202000000000000000000000000000000010000000002000000000000000000000000020000000002020000000000000000000000000000000000000000000000000100000000000000000002000000000000000000000000000000000000000000000000010200020000000000000000010000000202000100000000000000000000000200000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000020000000000000000000000000000000200000000000000000000000202020000000000000000000000000000020000020000020200000000020000000000000000000000000000000000000000020200000000000000000001000000000000000102000000000000000200000000000000000000000000000000000000000000000000000000010000000200000000000000000000000000000100000000000000000000020000000000020002000000000002000000000002000002000000000000000000000000000200000000000000000000000000000002000000000000000000000000000000000000000000000000000000000200020000000002000000000000000000000000000000000000000000000000000002020000000100000000020000000000000000000000000000020000000000000000000000000002000000000001000000000000000002000000000000000001000000000000000000000002000000000000000000000000000000000000000200020000000000000000010202000000020000000000000200000000000000000000000000000002010000000000000000020000000000000000020000000000000200000000000000000002020000000200000000020000020000000000020000000000000000000000000000010000000000000000000000020000010000000200000000000000000202010000010000000000000000000000000001000000020000000000000000010000000100000000020000000000000000000000000000000000000000000000020000000002000000000000000000000000000000010000000000000000000000000000000000000000000000000000000002000000000000000000020000000000000002000000000000000000000000000000000000000000000000000000000000000000000002000000000000000200000000000000000000000000000002000000000100000000000000000100000000000000000000000000000000000100000000020000000000000000000000000000000000000000000000000000000000000000000000020200000000000000000000010000000000000000000000020000000202000000000000000000000000000001000000000000000000000000000000000000000000020000000000000000000000000100000000020000000000000000000000000002000000000001000000000000000000000000000000000000000000000000000000000002020000000000000000000000000000000000010000000000000000000000000000000002000000000000000001020000000000000000020000000202000002000000000000000000000000020000000000000000000200000000020201000000000200000000000000000000000000000000000000000000000000000202000000000000000000000200000000000000000000000000000200000000000000000001000001000002000000000000000000000002000000000201000000000000000000000100000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200020002000000000000000000000000000000000200020000000000000000020000000000000000010000020000000000000000000000000102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000002000000000001000001000200000002000000000000020000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000200000200000000000200000000020000020000000000000000000000020000000000000200000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000010000000000000000000000000000000000000000000000000001000000000000000000000000000000000100010200000000000000000000000002000000000200000000020200000000000000000000000000000000000000000000020002000000000000000002000000000000000000000000000000000000000000000000000002000001000000000000000000000200000000000002000000000200000000000000020000000000000000000000000000000000000000000000000202000002000000000002000000000000000000000002000000000000000000000000000000000000000000000000000002020000000002000000000000000000000000000002000000000000010000000000000000000000000000000000000000000002000200000200000000000000000000000000000000020000000000000000000000020000000000000200000000000000000000000200000000000000020000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000020000000002000000000000000000000000000000020200000002000001000000000000000000000002000000000000000000000000000000020000020000000002000000000000000000000000000000020200000000000002000000020000000100000000000002000000000000000100000000000000020002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000002000200000000000002000100000002000000000001000001000000020000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000020000000000000000000000000000000000000000000000000000000200000200000200000000020000000000020000000000000000010002000002000000000000000000000000010000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000200000000000002000000020002000000000000000000000000020000000000000000000000000002000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000200000000000000000000000000020002000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000020000020000000000020000000000000000000000000000000000000000020000000002000000000000000000000002000200000000000000000000000002020000000000000200000000000000000000000000000000000000000000020100000000000200000000000000000000020000000000000000000000000100000000000000000000010000000000000000000002000000000000000002000000000000020001000000000200000000000000000000020000000000000002020000000102000000000000000000000000000000000002000000000000000002000000020000000000000000000000000000000000000000000000000000000002000000000000000000000000000200000000000200000000000200020000000000000000000102000000000200000000000000000000000000000000000000020002000000000000000000000002000000000000000000000000000000000000000000000000000000000202000000000000000100020001000000000000000002000000000000000200000202000000000000020000000000020000000000000000000000000000000000000200000000000000000000000000000000000000000002020000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000002000002020000000000000000000200000100020000000000000000000000000000000000000000000000000000000000000000000100020002020000000002000000000200000000000200000000000000000000000200000000000000000000000000020202000000020000000000000000000000020000000000000000000000000000000000020000020000000000000000000200000000000000000000000000000100010000000000010200000000000002000000000000000200000000000000000000000001000000000000000000000200000000000000000200000001000000000000000000000000000000000000000000000000000200000000000000000200000000000200000000000000000000000000000000000000000000000000000000000000000200020000020000000000000002000002000000000000000200000000000002000000000000000000000002020000000000020000000000000000000002000100010000000000000100000002000100000000000000000000020000000000000000000000000000000000000000000000020000000000000000020000000000000200020000000000000000000000000000000000000000000000000000020001000000000000000000000000000002000000000000020000000000000000000100000200000000000002000000000000000000000000000002020000000100000002000002000000000002000000000002000000000000000200000000000000000000000000020000000000000002000000000200000000000000000000000000000000000001020000000000000000000000000000000000000002000000000000000200000000000200000000000000000002000000000000000000010000000000000000000000000200000000000000000000000000000000000000000002000000000200000000000000000200000000020200000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000001000000000000000000010000000002000000000000020000000000000000000002000002000200000000000200000000000000000000000000000000000100000000000002000000000000000200000000010000000000000000000000000200000000000000000001000000020000000000000200000000000000000000000000000000000000000000000000000000000100000000000001000000000000000000000000000000000000000000000000000000000102000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000200000200000000000002020100000000000200000000000000000000000000000000000002000002000000000000000000000000000000000001000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000200000000010000000002000000000000000000000000000000000000000002000000000000000000000000020000000000000000000000000000000000000001000000000000000000000000000000000000000002000000000002000200000000000000000000010000000000000200000000020000000000000000000000000000000002000002000100000200000000000002000000000000020000000000000000000000000000000000000000000200000000000000000000000000020000000000000000000200000000000000000000000200000000000000000002000100000000010200000000000000000000000000000000000000000000000000000000000000010000000200010001000000000002000000000000020000000000000000000000000000000000000000020000000000000000000000000000000002020000000000000000010000020002000000000000000002000000000200000000020000000000000000000000000000000200000000000000000000000000000000000000020000000000000000000000000002000000010000000000000201000001000000000000000000000000000000000000000000000000000000000000000000000000010200000200000000000000000000000200000000020000000000000000000000000000000202000000000000000000000200000000000000000000000000000000000200000000000000000000000100000200000200000000000000000000000100020000000200000000000001000000010000000000000000000002000000000000000000000001000200000000000000000000000000020201000000000002000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000010000000000020200000000000000000002000000000002000000000000000000000200000000000000000000000000000000000000000000020000000000000000010200000000000000000000000000000000000000000000000000000000000002020000000000000000000000000000000000000000000000020000000001000000000000000000000000000000000000000002000000000000000000000000020000000001000000000000020000000000000000000000000002020000000000000000000000000000000000000000000000000002000000020200020000000000000200000100000000020000020000000002000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000200000000000000000000000000000000000000000000000000020000000002000000000002000000000200000000020000000002000000000000000000000200000200000000000000000001000000020000010000000000000000000000000000020000020000000000000200000100020000000000000000020202000002000000000200020000000000000000000000000000000000000000000000000002020000000000020000000000000000000000000000000000000000000002000000000000000000000000000000000000020000000100000000000002000000000200000000000000000002000000020200000000000001000000000000020000000000000000000000000000000000020002000000000000000000000002000100000000020000000000000000000000000000020000000000020000020000000000000000000000000200000000020000000000000000000001010000000100000000000000000000000000000000000000000000020000000000000000000000000200000000000000000000020000000000020000000000000000000000000000000000000200000000000000000000000000010000000000000000000000000000020200000000000000000002000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000020000000000000200000000000002000000000002000100000201000000000000000000000000000000000000000000000002020000000000000100000000000000000000000000000000000000000000000000000002000002000000000000000000000000000000000002000000000000000000000000000200000000020000000002000000000000000000020000000000000000000000000000000000000000020000000002020200000001000000000200000000000000000000000000000000000001000002000000000000020200000000000000000002000000000000000002000000000000000000000000020000020000000000020000000000000000000100000000000000000000000002000000000000020000020000000000000000000000000000000000000000000000000000000000000000000000000000000000020002000000000002000000000000000000000000020000000000000001000000000200000000000000000000000000000002000000000000000001000000000002000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000100000200000000000000000000000002000000000000000000000000000000000000000000000000020000000000000000000200000000000002020000000001000200000001000000000200000000000002000200020000000000000200000000000000000000000000000200000000000000000000000202000000000200000000000000020000000000000000010000000000000000000100000000000000000000000000000000000002000000000200000000000000000002000000000001020000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000002020000000000000000000000000000000000000000000002000000000000000000000000020000000000000000000000000000000000000002000000000100000000020000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020002000000000000000000000000000000000000020000000000000002000202000000000000000000010000000000000000000100000000000200000200000000000000000000000002000000000000020000000002000000000000000000000000000000000000000000000000000000000000000200000100000001000000000000000200020200000001000000000000000000000000000000000001000000020000000000000000000000000100000000000000000000000200000000000000000002000000000000000000020200020000000000000002000000000000000000000000000000000000000000000000000000000002000000000000000000010000000000000001000200000000000000020200000002000000000000000000000000000000000000000000000000000000020200000002000000020002000102000000000000000000000000000000000200000000000002000002000000000000000200000000000000000000000000000000000000000200020000000000000000000000020000000001000200000200000000000000000002000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000002000000000000020000000000000200000200000000000000000000000000000000000000000000020000000000000001000000000000000002000000000000000000000000000000000001000000000000020000000000000000000000000000000000000000000000000200000000000000000000010000000000000000000000000000000000000000000000000200000000020000020000000000000000000000000000000201000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000002000100000000000000000002000000000200000000000000000000000000000000000200000002000000000000000000000000000000000000000000000000000001000002000000000000000000000000000000000000000000000000000000000000000000010000000000000000000001000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000020200000202000000000000000000000000000000000000000002000000000000000000000000000100000000000000000002000000000000000000000200010000000000000002000000000000000000000200000000000000020000000000000000000000010000000000000000000000000002010000000000000000020000000000020000000000000000000000000000010000000000000000000000000000000000000200000000000002000000000000000200000000020000000000000000000200000000000000000000000100000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000200000000000000020000020200000000000000000000020200000000000000000000020000000100000000020000000000000000000002000000000000000000020000000200000000000000000200000000010000000000000000000002000000000000000000000000000000020000000000000002020000020002000000020000000000000200000000000000000000000100000200000000000000000000000002000000000000000000000000000200020200020000000100000000000200000000000000000000000002000000000000000000000000000000020200000000000100010000000001000000000002020000020000020000000000000000000000000000000002000000000201010000000000000000000200000002000000000000000000000000000000000000000000000000000002000000000002000000000000000002000200000002000000020000000000020002000000020002000000000002000002000000000000000000000200000200010000020000000000000000000000000000020000020000000000000000020000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000200000000000000000000000000000000000000000000000000000200000000000000020000020000000000020000000200000000000000000000000000000000000000020000000200000000020000000200000000000000000002000202000000000000020000000000000200000000000100000000000000010000000200000000000000000000000000000000010000000000000000000200000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000102000000000000000000000000000000000000000000000000000002000002000100000000000002020000000000000000000000020000000000000000000000000000000000000000000000000002020000000000000000000000010000000000000002000000000001000000000000000000000000000000000200000000000200000000000000000000000000000000000000000000020000000000000000000002000000000000000000000000000000000000020000000000020002000000000000000000000000000202000000000000000000000000000000000000010000000001000002020200000000000200000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000002000000000000000000010000000000010000000002000000000002000000000002000000000001000001000100020000020000000000000000000000000000000000000002000000000000000002020000000000000200000000000000000000000000000200000000000000000000000000000000000000000000000000020000000000000000000000000000000000000202000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000020000000000000000000000000000000000010000000000000000000000000000000000020000000000020200020002000000000000000000020000000000000200000000000000020000000000000000000002000000000000000000000000000000000200000000000000020000000000000000000000000000000000020000000200000000000000020000000000000000000000000000000000000200000000000000000000000000000000000000010000000000000000000001000200000000000000000000020000020000000000000100000200000002000000020002000000000000000000020000000000000000000002000000020000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000001000200000000000000000000020000000000000000000000010000000202000000000000020002000002020000000000000000000000000000000000000200000000000200000000000000000000000000020000000000000000000200000000000000000002000000000000000000000000000002000000000000000000000000000000000200000000000000000000000100020000000000000000000000000000000000000002000000020000000000000000000000020000000000000000000000000000000000000102010000000000020000000200000000000000000000000000000000020000000000000000000002000000000000000000000000000000000000000001000000000000000200000000000000000100000000000000000000010000000000000000000000000000000000020000020000000002000000000000000000000002000000000000000000000000020000000000000000000000000000000200000000020002000000000000000000020000000002000000000000000001000000000000000000000000020000000000000000000000000002000000000200000000000100000200000000000200000000000000000002000000000000000000000000000000000000000000000000020000000000000000000000000102010000000000000000000000000100000200000000000000000000000001000001000000020200000000000000000000000000000000000000000002000200000000000000000000000000000000000002000200000000000000000000000000000000000200000000000000020000000000020000000000000000000000000000000000000000000000000000000200000000000200000000000002000000000000010200000000000000000002020002000200000000000001000000000100000000000000000002000000000000000000000000000000000000020000000000000002000000000000000000000000000000000000000000000000000000020000000000000002000000000200000000000000000000010000020000000000000000000000000000020000000000000200000000000000000200000000000000000000000000000000020000000000000002000000000000010200000000000001000000000200020000000000000000000000000000000000000000000000000000020000000000010000000000020002000000020000000000000002000200000000000000000000000000000000000000020000000000020000000000000200000000000000000000000202000000000000000000000001000202000200000000000000000200000002000200000000000000000000020000000202000200000000000000020000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000102000000000200000201020202000000000000000001000000020200000000000000000000000200000000000000020200020000000000000000000002000000000001000000000000020200000000000200000200000000000000000001000000020000010000000200010000020200000000000000000000000000000000000000000000000001000000000100020000000000000000000000000000000000000000000000000000000002000002000000000000000000000002020002000000000000000000000002000000000200000000000000000000000000020200000000000002000000000002000000000000000000000000000000000200000000000000000000000000000000000000000000020000000000000000000001000000020000000000000000000000000200000000000000000000000000000000000000000002000000000102000000000000000000000000000000000002000000000000000000000000020000000000000000000000000000000000000202000000000000000000020200020000000000000000000000000001000000000200000000000200000000000200000000000000000000010000000000020000000202000000000000000000000000000000010000020000020000000000020000000000000000000000000000000000020000000000000000000000000002000202000000000000000000000000000000000000000000000200000002000000000000000200000000000000000001000000000001000000000000000200000000000000000000000000000200000000000200000000020000000200000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000020000000000000000000000000000000100000200000100000002000200000000000000000000020000000200000002020000000002000000000000000000000000000000000000000200000000010200000000000000000000000000000102000000000000020000000000000000000000000000000200000000000000000000000000000000000002000000000000000000000000000000000000000000000100000000000000000000020000020002000000010002000000000000000000020000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000020000000000000000000001000000000000000200020000000200000000000000000000000000000000000000000002000000000000000000000200000002000000000000000000000000000000000000000000000001000000000000020000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000020000000000000000010200000000000000000000000002000002000000000002000000000000000000000000000000000000000000020000000000000002000000000000000000000202000100020200000000000000000000000200000000000100000000000000000000000000000000000002000000000000000200000000000000000000000000000200010000000000020000000000020001000002020000020000000000000100000000000000000000000000000000000000020000000000000000000000000000020000000001010000000000000000000000000000000000000000000000000000000000000002010000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000001020000000000000200000000020002000000000000000000000200000000000000000000000000000000000000000000000002000000000000010000000200000000000000000000000000000000020000000000000000000000000000000001000001000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000200000001000000000000000000000000000000000200000000000000000000000000000000000000010000020202000002000000000000000000000000000000000000000000000001020000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000002000000000000020000000000000000000200000000010200000002020000000000000000000000000200000000000000000002000200000000000000000000000202000002000000000000000000000000000000000000020000000200000000000000000200000000000002000000000200000000000000000200000000000000000000000000000202000002000000000000000000000200000000020200000200000000000000000002010000000000000002000200000000020000000202000002000000000000000200000000000200000000000000000000000000000000000000000000010000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000002000000000001000002000000000000020000000000000000020202000000000200020000000200000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000200000000000000000000000000000000020200000000000000000000000000000000000000000000020000010002000000000200000000000000000202020000000202000000000000000000000001000000000000000000000001000000000000000000000000000200000000000000000000000000000200000000010000020000000000000000000000000002000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000002000000020000000000000200000000000000000000000000000000000000000000000100020000000200000000000000000000000000000002000000000000000000000000000000000000000000000000000000000202000000000200000000000000000001000000000002000000000000020001000000000000000000020000000000000002000000000001010000000000000000020002020000000000020100000000000000000000000000000000020002000000010000000000000000000000000000000000000000000000000002000100020000000100020000000000000000010000000000000000000000020000000000000001000000000000020000020000000000000000000000000000000200000000000000000000000000000000000100000000000000000000000102000000020000000200020000000000000000000000000002020000000000000100000000020000000002000000000000000000000000000000000100000000000000000200000000000000000002020000000000000000000000000000000000000000000000020000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000002020000000000000000000000010000000000020001000000000002020000010000000000000200000000000000000000000000000000000000000001000000000000000002000000000000000000000000000000000000000001000200000202000000000000000100000002000002000000020000000000000000010000020000000000000002000000000000000000000000000000000000000200000000000000000002000000020000000002000000000200000000000000000000000000000000000000000000000002010200000000000002000000000000000000000000000000000000020000000000000000000000000000000000000002000000000002000000000001000000000000000000000000000000020000000000000000000000000000000100020000000000020000000000000000000000000000000000000000000200000000000000000000010200020000000000020000000000000000000000000000000000000200000002000000020000000000000200000000000000000000000000000000000000000000000000020000000000000000000000000000000000000200020000000000000000000000000000000000000002000000000100020000000000000000000000000000000200000000000000010000020000000000000000000000000000000000000000000000000000000002000100000000000000000000000001000200000000000000020000000000020000000000000000000002000000000000020000000200000000000000000000000000000000020000000000000002000000000000000000000002000000000002000000000000000000000000020002000001000000000100000000000000000000010000000000020002000000000000000000020000000000000000000000000000000000000000000100000000000200000000000000020000000000020000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000020002000000000000000000000000000002000000000000020201000000000002000000020000010000000000000000000200000000000000020000000000000002000100000000000000000200000100020000000000000000020002000202000200000000000000000000000000000001000000000000000000000200000002000000000000000001000200000000000200000000000000000000000000000002000002000200000000000002000000000000000000000002000000000100000000000000000000000000020002000000000000000000000001000000000000000202020000000002000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000202000000000000000002000000000000000000000000000200000000020000000000020000020000000000000000000000020002000000000000010000000000000000000000020000000000000000000000010200000000000000020000000000000000000000000000000000000002000000000001000002020002000000000000000000000001020200000000020000000100010000000000000000000000000000000000000000000000000000000100000000000002000000000000000002000000020000000002000000000000000000020000000000000000020200000000000000000000000000010000000000000000000001000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000020000000000000000000002000000000000000000000000020000020002000002020002000000000200010000000000000000000000000002000000020000000000000000000000000000000200000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000020100000000000000000000020001020200000000000000000000000000000002000000000000000000000000000000000000000000000000000000000002020000000000000002000002000000000000020000000000000100000001020002000000000000000000000000020000000002000000000000000001000000000000000000000002020000000000000000000200000100000002000000000000000000000200000000000000000000000000000000020001000000000001000000000000020000000000000000000000000100000000000002000000000000000000000000000000000002000200000000000000000000000002000000000100000002000000000000020102000002000002000000020000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000200000000000200000000000100000000010002000000000002000000000000000000000000000001000000000200000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000000000000100000000000000000000000000000002000000000000020001000000000000000000000000000000000200000000000002000000000000000000000000000000000000000000020000010000000000000000000000000000000000000000000000000002000000000002020000000000020000000000000002000000000000000000000200000000000000000002000000000000000200020000000000000000000000000000020000000000000000000000000002000000000000000000000000000000000202000000000000000000000002000000000000020000020000020000000000000000000000020000000000000000000000000200000001000000000200020000000000000100000000000000000000000000000200000000000000000000000000000000000200000200000000000000000002000002000000000000000000000000020200000000000002000000000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000000000000001000000000000000002000000000000000000000000000002000000000000000200000000020000000002000200000202000000000200000000000000000000000000000000020100000000000000000000000000000000000000000000000100000000000000000000020001000000000200000000000000000000000000000000000000000200020000000000000000000000000000000200000000020000000000000000020200000000000000000000000200000002000000000002020000000000000000000200000000000000000000000000000000000000000002000000000000020000000002000000000000000000000000000000000000000000000000000200000000000002000200000000000000010000000200000000010000000200020000000002000000000000000200010000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000200000000000000000000020000000000020001000100000000000000000000000202000000020000000200010200000200000000000000000000000000000000000000000200000000000000000000000000000000000100000000000000000000020001000000000200000101000000000000000000000001000000000100000000000000000000000200000000000000000000000000000200000100000000000000000000000000000000000000020000000202000000000000000200000000000000000000000000000000000200000000000000000000000002000001000000000000020000000002000000000000000000000000020000000000000000020000000000000000000000000000000000000000000000000000000002000000000000000000000002000200000000000000000000000000000000000000000000000000000001000200000000010002000000000000000000000000000000020000000100000000000000000000000000000000000000000000000000020000000000000202000000000000000200000000020000000000000000020200000002000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000002000000000000000000000000020100010000000000000000000000000000000000000002000000000000000000020000000000000000000000000002000000020200000000000000010000000000000000020000000000000000020100000000000000020000000002000000000000000000000000000000000000000000020200020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000200000000000000000000020000000200000000000000000000000000000000020000000000000000000002000000020000000000020002000000000000020000000000000000000000000000000000000200000200000001000000000000000001000000000000000000000100000000000002000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000002000002000000000100000002000001000100000000000000000000000000000000000000020202000000000000000000000002000200000200000002000000000200020000000000000000000000000000020000000000000000000000000002000000000002000000000000000000000200000000000000000000000000000000000000020000000000000000000000000000020000000000000000000200020000000000000000000002000000000000000000000000000200000000000000000000000100000000020000000000000002000000000000000000000002000000020000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000002000000000000010000000000000000000000000000000000000000000000000000000000000000020000000000000002000100000200000202000000000000000000000000020000000000000000000000000000000000000200000200000100020000000000000000000000000000000200000002000001000000000000000000000000000000000000000000000002010002000000000000000000000000000000000202000000000000000000020000000000000000000000000000010000000000000000000000000000000000020000000000020200000000000000000000000202000200000000000000000000000000000000000000000000000001000000000200000000000000000000000000000000000000020000020200000000020000000000000000000000000000000000000000000000000000000000000000000002000000000000000100000200010000000000000000010000000200000000000000000200000000000200000000000200000002000000000000000000000002000000000000020000020000000000000000000000000000020200000000000000000100020000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000000200000000000000000000000000000000000200000000000000000000000200000000000000000000000000000000000002000000000000000000000000000000020000000000000200000000000000000000000002000000000002000000020000000000000000000200000000000002000002000000000001020000000200000000000000000002000000000200000000000002000000000000000200020000000000000000000000000000000000000002000000000000000200000000000000000202000000000000000200000000000001000200000000000002000000000000000002000000000000000000020000000000000002000000000200000000000000000000000002000000000000000000000000000000000000000000000000000200000000000000000000000000000000000002000000020000000000000100000000000000000000000000000000000000000000000000000000000200000000000000000200000002000000000000000100000000000000020000000002000002000000000000020000000000000001000000000000000000000000000002020000000000000000000000000000000000000000000200000200000000000000000000000000000000020000000000000000000000000000000000000100000000000000000000000000000002000000000100000200000000000000000000020000000000000002000001000000000200000000000001000000020200000002000000000002000000000001000000020000020000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000020000000000000100000000000000000000000000020002000000000000000000000000000000000000000000000000000002000200000002020000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000020000000000000000000000000000000002000000000000000000020000000000000000010002000000000000000000000000000000000100000000000000000002000000000000010002020000000200000000000002000000000000000000000000000200000200000200000000000000000000000000000000000000000000000000000000000000000000000002000200000001000000000000000000000002000000000000000000000200000000000000000000000000020002000200000000000000000000000000000000000000000000000000020000000000000000000200000000000000000000000000000000000200000000000000000000000000000000000000000000000200000000000000020000000002000000020000000000000000000000000000000000000200000002000000000000000100000001000000000000000000000000020000000000000000010000000000000200000000020000000200020002000000000002000000000000000000000102020000000000020000000002000000000000000000000000000000000000000000000000000000000002000000020000000002000000000000000000020000000000000000000000000200020200020000000000000002000000020000000000000000000000000000000000020000020200000000000000000000000000000000000000020000000000000000020100000000000000000000000000020000000000020000000000000000000002000000020000000000000000000000000000000100000000000200000000000000010000020000010000000000000000000000000000000000000000000000000001000000020000000000000000000000020002020000010200000000000002000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000020000000000000002000000000200000000000000000000000000000001000000000000000000000000000000000000000000000000000000000002000000000000000000000000020000000000000000000000000002000000000000000000000000000000000000000000000200000000000000000000000000000000000200000000020000000000000000020000000000000000000000020000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000020000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000200000200000000000000000000000000000000000000000000000000000201000000000000010000020000000000000000000000000000000000020000000200000000020100000002000000000000000000000000000000000000000000000000000000000000020200000000000000000000000000000002000200000000000000000000000000000000000000000000000000000000020002000000000000000000000000020000000000000002000000000000000200020000000000000000000000000000000000000000010000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000000000000200000200000000000000000001000000020000000000000000000000000000000000000000000000020000000002000000000000000000000000000000020000000000000000000000000000000000000000000000000000020000020002000000000000000000020000000000000000000000000000000000000000000000000200000000000000000000000100020200000000000000000000000000000000020000000200000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000002010000000100000000000200000000000000000000020000000000000001000000000200000200000200000000000002000000000000000002000000000000000000000000000002000002000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000002020000000000020000000002020000000201000000000000000000000000000000000002000002020000000002000000000000000000000000000000000000000200000000000000000100000000000000000000000001000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000200000000000200000002000000000000000000000000020000000000000002000000000000000000000000020000000002000000000000000000000000000000000002000000000000000000000002000000000000000000000000000000000002000000000000000000000000000000000000000200020000000200000201000000000000000000020000000000000000000000020200000000020000000000000002000001020000020000010000000000000000020000000000000000000000000000000002000000000000000000000000000200000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000020000000000000000000002000200000000000000000000000000000000000001000000020200000002020000000000000000020200000001000000000000000002010200000000000000000000000000000000000000000000020002000200000000000000000000000000000000000200000000000000000000000200000000000200000000000000000000000000000000000000000001000002000201000000000200000002000000000000020000000000000000000000000000000000000000000000000000000000000000000000000200000200000000000000000000000100000000000000000000000002000000000000000000000000000000000000000200000000000000000000000200000002000000000000000000000000000000000000000000000000000000000000020000000002000200000200020000000000000000000000000001000002000000000000000000000000000000000000020002000000000000000000000000000000000000000000000002000000000001000000000000000000020000000200020000000000000000000000000200000000000000000000000000000002000000000000000000010000000000000000000000000000000001020200000200000000000000020000000000000000000001000000000000000002000000000000000000000000000000000001000000000002000100000000000000000000000000000002000000000002020200000000000000000000000000020000000200000000000000000000000000000002000000000000000000000000000000010000000200010200000000000002000000000002000001000000000000000000000000000200020000000000000000000000000000000000020000000000000000000000020000000000000000000002000000000000000000000000000200000000000000000002000001000200000000000000000100000000000000000000000000000100020000000000000000000000020000000000020000000000000000000000020000020000000000000000000000000000000200000000000000010002000000000000000002000000000000000000020202020000000100000000000002020000000000000000000000000000000000000000000000000000000002000000010000000000000200000001000000000000000000000000000000000000000100000000010000000000000000000000000000000000000000000001000000020000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000101020200000000000000000000000000000000000000000000000200000000000000000000000000000000000000000001010000000000000000000000000200000000010002000000000000000000020002000000000000000200000002000000000000000000000000000000000000010000000001000000000200020000000000000001000000000000000000000000000000000000000200020200000000000200000000000002000000000200000000000002000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000102000000020000000002000000020000000000000000010000000200000000000000000001000200020000020001000000000002000000000000000000000000020000020000000000000000000000020000000000000000000000000000000000020200000000000000000000000000000001000000000000000000000100000000000200000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000002000000020000000000000000000000000000000000000200020000000000000200000000010000000000000000000000000000000000000000000000000000000000020000000200000000020000000000000002000000000000000000000000000002000000000000000000000000000000000200000000000002020000000000000000000000000002000000000000000000000001000000000002000200000000000000000002000000000000000000020000000000000000000200000000000000000000000200000000000000000000000000000201000000000200000000020000000200000000000000000000000002000102000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000020000020000000102000000000000000000000002000000000000000000000002000002000000010000000000000000010200000001000100000000000000000000000001020200000000000000000000000000000000000002000000020000000201000000000000000000000002000002000000000000000000000000000000000000000000000000000000000000000000000000000000000100000200000000020000000200000000000000000000000000010000000000020000000000000000000000000000000000000000000000000000000000000000000000020000000100020000000000000000000000000001000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000002"> : tensor<192x192xi8> %cst_1 = arith.constant dense<"0x000000000000010000000002000200000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000020000000000000000020000000000000000000000000000000000000000000000000000000000000000000001000000020000000100000000000000000100000000000000000000000000000000000000000000000000000000000000020000000201010000000000000001000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000000000100000000000002000000000000000000000000000000010000000000000000020000000000000000000000020002020000000000000000000000000200000100000000000000020000000000000100000000000002000000000001000002000000000000000200010000000000000000020000000000000000000000000000000000000200020000000000000000000000000000000000000200000002000002010001000000000000000000000100000000000000000000000000000000000000000000000001000000020000000000000000000000000000000000000000000000000000000200000000000000010000000000000000000000000000000000000000000000000000000200000000020002000000000000000000020002000100000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000000100000000000000000000010000000000000100010000000000000000000000000000000000000000000000000000000100000000000000000200000000000000000000000000000000000001000000020000000200000000000002000000000000000000000000000000000000000200020001000000000002000200000000000000000000000000000000000000020001000002000100000200000000000000000000000000000000020000000000020000000100000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000010000000000000000000200000000010000000000000000000000000000000000000000000000000000010000010000000000000002000000000002000000000000000000000000000000000000000001000000000000010200000200000001000000000000000000000000000000000000000000000000000000000000000000000000000200020000000000000001000001000000000200000000000000000000000002020000000000000000000000000001000000000000000000000000000000000000000000000100000000000000000000000000000000000000020000000000020000000000000000000200000000000000000000000200000000010000000100000000010000020000010000000000000000000000000000000001000000000002000000000000000000000000000000000000000000000000000000000000010200000200000000000100000000000000000000000100000000000100000000000201000200010000000002000000000000000000000000000000000000020000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000002000000000000000000000000000200000000000000020000000000000000000000000100000000000001000000000000000000000000000000000001000000000000000000000000000000000000010002000000000000000100000002000000000000000000000000000000000000000200000000000000000001000000000000000000000001000200000000000000000200000100000000000000000200000000000000000000000000000000010000000000000002000000000000000002000000000000000001000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000002000000000000000100000000000200000000000100000000020100000000000000000000000000000001000100000000000000000000000000000000000000000200000000000000000001000000000000000000000200000000000000010000000000000000000100000000020200000000000000000000000000000000000000000000000000000000000000000000000000010000000002000001000001020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000200000100000000000000000000000000000000000000000000000000000000000002010000020000010002000000020000000000000000000002000000000000000000000000000000000000000000000000000000000002000200000000000000000000000002000000000002000000000000000000000000000002000200000200000000000000000000000002000000000000020000000000000000000000000200000000000000000000000000000001000000000000000000000000000000000000000000000000000001000000000000000000000000000000000002000000000000000000000200000002000000000000000100000000010000000000000000000000000002010000020000000001000000000000000000000000020000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000200000000000000000001000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010101000000000002000000000000000000000100000000000000020000000100000000000000000000000100000000000000000000000000000000000000000000000002010000000000000000020000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000201000000000000000001000000000000000002000201000002000000000200000100000000000000000000020000000000010000000100010000000000020100000100000000000000000100000000000200000000000002000000000000000000000000000000000000000000000000000000000000000000000000020000000000000001000000000002000000000000000001000000000000000000020000000001000000000000000000000000000001000000000000000000000000000000000000000000000100020000000000000000000100000000000000010000000002010100020000020002000000000000000000020000000000000002000200000000000000020200000000000000000002000001000002000000000000000100010000000000000000000000010000000000000200020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000002000000000000000000000000010000000000000000000000000000000000020000000000000000000002000100000000010000000000000000000000000000000000000000000000000000000100000000020000000000000000020000000000000200000000000000000000000000000000000000000000000000010000000002000000000000000000000000000000000000000001000000000000000101000000000100010000000100000000000000000000000000000000000000000000000000000200000000000100000000000002020000000001000000000000000001000000000000000000000200000000000000000200000000000000000000000000000000000000010002000000000001000000020000000000000000000000000000000000000000000000000000000000000001010000000002000000000000000000000000000002000000000000000000000000000000000000000100000000010000000000000000000200000000000200020000000000000000000000000002000000000000000000000000000100020000000000000000000000000000000000000000000000000001000000000000020000000000000000000000000000000002020000000100000000000000000001000000000000000001000001020000000000000100000000000000020000000000020000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000020000000000000000000000010000000000000000000000000000000000000000000000000000020000000200010000000000000000000001000000000002000200000000000000000000000000000000000000000000000000000000000000000000000100020000020001000000000000000000000100000000000002000000000000000000020200000000000200000000000000000000000000000200000000000100000000000000000000000000000000000002000000000000000000000002000200010100000000000000000000000200000000000000000200000000000100000000000100000000000100020000000000000000000000020000000000000000000002000000000000000202000000000001000002000000000000000000000002000000000000000002000000000200000000000000020000000000000200000000020100000000000000000000000000000100000000000000000000000000000000000001000100000001000100000000000000000000020002000000000000000100000000000000000000000000000000020000000100000000000000020000000000000000000000000001000000000001010000010000000000000000000000000000000000000000000000000001010000020000000002000001000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000200000000000200000000000000000000000000000000000000000000020000000000000200000000000000000000000000000000000200000000000000000000000000000000020000000000000000000002000002000000000001000000000000000000000000000000000000000000010000000000020000010001020000000000000000000000000000000201010100000000000000000002000000000000000000000000000000000000000000000000000000000200000200000200000200010000000000000000000000000100000000000000000001000000000200000001000002000000000000000000000000000000000000000000000000000000010000000000000000000000000200000000000001000000000000000001020000020000000100020100000000000001000200000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000002000100020000000000000000010000000000000000000100000000000000020000000000000000000000000000020000000000000202000000000000000000000000000000000000000000000001000000020002000000000001000000000002000000000000000000000000010000000001000000000000000000000000010000000200000000000000010000000000000002000002000000000100000000000000000000000001000000020200000000000002000000000000000200000100000000000002000000000000000000000000020001000200000000000000000000000200000000020001000000000000000000000200000000000000000000000000000000000200000000000000000000000000000000000000000000000200000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100020100000000000000000100000002000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000002000000000000000000020000000000000000000000000000000000000002000000000002000100000000000000000001000000000001000000020100000000000000000000010000010000010000000000000000000000000000000000010000020000000000000000000000000200000000020000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000000000000000002000000000000020001000101000002000000000000000000000000000002000100000000000000000000000000000000000000000000000001000000000000000000010000000000000202000000000000000000000000000000020000000000000000000000000000000000000002000000020002000000000000000000000200010000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000100000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000200010000020002000000000000000000000000000000000200000000000000000002000001000000000000000000000000000000000000000001000200000000000000000000000000000000000000000001000001000000020000000000000000000000000000000200000000000000000000010000000000000000000000000100000001000000000000000000000000000000020000000000000000000000000000010000000000000000000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000020000000002000000000000000100000000000100000000000001000000000000000000000000000002000000000000000000000000000000000200000200000000000000000100000000000000000002000000000000000200000000000102000000000000000002000000000002000000000000000000010000000000010000000000000000000000000000000000000000000000000000000001000100000000010000000000000200000000000100010000000000000000000000000200000000000200000000000000000000000000000200000100000000000200000000000002000202000000000000020000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000002000000000000000002000000000000000000000000000000000201020000000000000000000100000000000000000000000000020201000000010000000000000000000000000000000000000000000000000000000000000000000000000000000202000000000000000000000000000000000000000000000000000200000000000000000000000000000000000001000000000000000000000000000002000001000000000000000000000000020000000000000000000002000001000002000000000000000000000000000000000000000000000000020000000000010200000000000000000100010000000001000000000000000000000000000001000000000000000000020000000000000000000000000000000000000000000002000000000000000000000000000000000000010001000000000000000000010000000200000000000000000002000000000000000000000000000100000200000000000000000000000000000100000200000000000000000000000000000000000000000000000000000000000000010000000000010000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200010000000002000200000000020000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000010000000000000000000000000200000000000002000000000100000000000000000000020000000000010000000000000000000002000000000000000000000000000000000000000000000000000000000002000000000200000000000000000000010000000000000000000000000000000002000001000000000000000001000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100020000000000000000000000000002010000000000000000000000000000000000010000000000000001000000000000000000000200000000000000000000000000010000000000000000000000000000000000000000000000000200010000000000000200000200000200020002000000000000000000000000000000000000000201000000020000000000000000000002000000000000000000000000010200000000020001000000000000000000000000000000000000000000000000000000000000000200000200000001000200000000010200000000000000000000000000000001020000010000020000000000000000000200000000000002000000010000000001000000000001000001000000000000000000000000000100000200000000000000000000020000000000000000000100000000000000000000000001000000020002000002000100000000000000000200000000000000000000000200000000020000020000000000000000000002000000000000020000000000000000000000000000000100020000000000000001000000000000000000000200000000000000000100000000000000000000000000000000000000000000020000000001000000000000000000000000000000010000020000000200000000000000000000000000000000000000000000020000000000000001000001000000000000000000000000000000000000000002000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000010000000000000000000100000000000100000001000000000000020000000000000002000000000200000000000000000000000000000000000000000001000200000000000200000000000000020200000000000000000000000000000000000000000000000000000000020100000000010000010000020000000000000000000000000000000000000000020100000000000000000000000000000000000000000000000000000000020000020001000000000000000000000000000000000001000000000000000000000000000000010000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000020100000002000000020000000000010000000000000002000000000000000001000000000002000000000000000000000000020000000000000000000002010002000000000000000000000000000000000000000000000102000000000100000000010000000000000200000000020000000000010000000000000100000000000100000000000001000000000001000000000000000000020000000200010000010000000000000002000000000000000000000000000000000001000000000100000200000100000100000000010000000002010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000020000000000000000000002000000000002000000000000010000000000010000000100000000000000000002000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000001000000000000000200000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000002000000010002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000100000000000000000200010002000000000100000000000001000001000001000000000000000000000000000000000000000100000100000000000000000000000000000000020000000100000000000000000000000100000000000000000000000000010000000000000000000201000000000000010000000000000000000000000000000000000200000000000001000000010000000000000000000000000000000000020000000000000000000000000001000000010000020000000000000000000000020000000000010001000000000000000000000100000000000000000000000000000000000000000000000002000000000000000000000000010000000000000000000000000100000000000000000000000000000000000000000000000002000000020000000000000000000002000000000000000002000000000100000000000200000200000200000000000000000000000000010001010000000000000000000000000100000000000000020000000000000002000100000000010200010000000100000000000002000000000000000002000000000000000000000000000001000000000000000001000000000100010000000000000000010000020000000101000000000000010000000200020000000100000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000100000000000000000100000000000002000000000000010000000000000000000000000200000000020000000000000000020000000000000000000002000000000000000000020000010100000000000000000000000000000000000000000000000000000000000000000000000100000100000000000000000000000000000000000000000100000001000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000100000000000000000002000000000000000000000000000000000000000000000000000100000000000000000000000000000000000001000000000000000000000000000202000000000000000000000000000001020200000000000000000100000000000000000100000000000000000000000000000000010000020000000000000000000000000000000000000102020000000000000000010000000000000000020000020000000000000002000001000000000000000000000002000000000000010000000000000001000000000000000000000000000000020000000000000002000000000000010000000000000101000200000000000000000100000200000000000000000200000000000001000200000100020001000002000000000000000000020000010000000000000000000000000000000000000000000001000000000000000100000000000000000000000000000000000100000000000000000200000000000002000000000000000000000000000000000000010000000000020000000100000000020000000000000000000000000100000000000000010000000000000200020000000002000000000000000000000000000000000000000001000001000000000002000000000000000000000000000000000001000000000000000000000002000000000001000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000001000002010000000000000000000000000000000000010000000000000000000000000000000200000002000000010000020000000000000000000000000000000000010000000000000001000000000001000000000000000000000100000000000000000000000000000200000000000000000200000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000002000002000000000000000100000000000000000000000000000000000000000001000000000000000000000200010000000000020000000000000202000000000000000000000001000000000000000000000000000000000000000000020000000000000000000000020000000001000000000200000000000000000000000000000000000002000100000000020000000000020000000000000000000000000000000000000200000000000002000000000000000000000000000000000000000000000100000000000000000000000100000000000000000000010001000000000000000000000000000000000101000000000000000000000000000100000000000000000000000000000000000000000100000102000002000000000202000000000000000100000000000000000000010000000000000002000000000000000100000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000100000000000000000000000100000200000000000000000000000002000001000000000000000001000000000100000000000000000000000000000001000000000000000200000000000000000000000000000200000100000000000000000000000000000000010000000200000001000001000000000000000000010000020000000000010000000000000000000000000000000100000000000000000000000000000002020000000000000001000000000000000102000000000000000000000000000000000000000000010000000000000000000000000000000000000001000000000002000000000000010000000000000000000000000001020100000000000000000000020000000000000002000000000100000000000000000000000000000000000000000000000000000100000000010101000000000001000200000000000100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000200000000000100000000010000000002000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000020000000000020000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000020002000000000000000000000000000000000000000002000200000100000001000000000000010000000000000000000200000000000000000000000001000000000000000002000000000100000000000000000000010000000100000000000000020000000000000000000000000000000000000000000000000000000000010000000000000000010000000000010002000000000000000000000000000000020200000001010000000000010000000000020200000000000000020000000000000100000000000002000000020000010000000000000000000000000200000002000000000000000000020002020000000000000000000000000002000200000000000000000000000002000101000000000001000000000002000000000000000000000000000000000000000000000000000000020000000000000000010000000000000000000000000000000000010000000001000000000000020000010000000000000000000000000000000000000100000202000000000102000001000002000000010000000000000000000100000000000000010000000000000100000000000000000000010000000000010100000000000000020200000000000000000002000002000000000000000000000002000000000000000002000000000000020000000000000200000000000000000000000002000000000000000002000001000000000000000000000000000000000000000001020000000000000200000000000000000000000000000200020002000000000100000201000000000000000000000000000100020000000000000000000000010000000000000000000000000000020000010000000000000000000000000000000000000000000000000002000000010000000001000000020000000100010000000200000000000000000001000100000000000000000001000000000000020000010000000000010000000000000000020000000200000000000000020000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000002020000000000000000000200000000000000000000000000000000000000000000020000000000000000020000000200000102010000000000000000000000000000020000000000000100000000000000000000000100000000000000000000000000000000010000000000000000020000000000020000000002000000000000000001000000000000000000000200000000000000000000010000000000000000000000000000000000000000000000000000000002020000000000000000000202000200000000000000000002000002000100000001000000010000000000000000000000000100000000000000000000000000000000000000000002000002000000000000000000000002000000000001000000000000000000000001000000000000000000000000000000000000010100000000000000000000000000000000000200000000000001000000000000000001000000000000020002000000000000000000000000000000000000000000000000000000000000000100000000000200000000000000000000020000000002000000000000000000000000000000000200010000000002000001000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002000000000000020000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000020200000001000001000200000000000000000000010200000201000000000000000000000000010000010000000000000000000000000100000000000000000002000001000000000000010000000000000100000000000000000000000000020000000000000000000000000000000002020000000000000000000000000000000000000000000000000200000200000000000000000200000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000020000000000020000000000020000000000000000000000000000020002020000000000000000000000000000000000000000000000000000000002000000000000000000000000010000000000000000020000000002000000000000000000000000000000000000000100000200000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000020000000000000201000000000000000002000100000000000000000000000200000000000001000000000000020000000000000200000000000000000000000000000000000000000000000000000000000000010000010000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000002000000000001000000000000000001000000000002000000010000000200000000000002000000000100000000000000000000000100000000000000010000000000000000000000000100000000000000000000010000000000000202000002000000000200000002000000000000000000000000000000010000000000000000000000000000000100020000000000000000000000020000000001000000000000000000000000000001000000000000000000000001000000000000000000000000000000000000000001000000000002000000000001000100000000000002000000000000000000000200000002000000000001000000000000000100010000000000000000000000000000000000000000010000000000000000000200000000010000000000000000000000000002000100000000000001000000000000000000000000000000000000000000000000000000000002000000000000000000010001000000000000000000000000000001000000000000000000000000020000000000000000020000000000000000000202010000000001000000000000000000000002000000000000020000000001000000000000000000000000020000000000000000000000000000000000020000000000010100000000020000000000000000000000000000000000000000000000000000000000000001000000000000010200000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000020000000000000000000000000000000000000002000000000000000100000000000000000000000000000000000000000000010000000200000000000000000000020000000000000000000000000000000000000000010000000200010200000000000000020000000000000000000000000000000200000000000000000000000000000000000001020000000000000000000200000000000000020000000001000000000000000000020000000000000000000001000200000100000000000000000101000000000000000000000000000001000000000000000000000000020000000000000000000000000000000200000000000000000000010000000000000000000000000000000002000000000200000000000000000000020000000100000002000100000000000000020000000000000002000000000200000000000000000000000002000000000100000000000000000000000000000000000000000200000200000000000000000000000002000000000000020000000000010000000000000000000000000101000000000000000000000000000100000000000002000001000000000000020200000000000000000000000200000000000002000000000100000000000000000000000001000000000001000001000002020000000000000000000000000100020000020000000000000000000000000000000000000000000000000001000000000200000102000002000000000000000000000000000000000201000000000000020000000200000101000200010000000201000000000000000000000200000000000000000000000000000000000000000000020101000000000000000000000200000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000020000000000000000000000000000000100000000000000020002000000000000000201000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000001000000000000000000000200020200000000000000000002000000000200000000010000000000000000000000000000000100000000000000000000000002000000010200000000000000000000000201000000000100000100000000000000000000000000000100000001000000000002000100000000000000000000000000000000010000000000000000000000020000000002000000000000000100000000000000000000000000000000000000000000000000000000020000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000010000000102000000020000000000000000000000000000000000000001000000000000000000000000000000000000000100000000000000000000000000000000000001000001000002000200000000000000000000000100000000000000000000000000000000000202010000000000000000010000000000000000000200000000010200000000000000020000000000000002000000000002000000000000000000000001000200000200000000000000000002000100000200000002000000000100000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000020002000000000000000000000000000000000000010000000000000100000000020000000000000000000000010000010000000000000000000200000000000000000000000000000000000000020100000000000000000000000000000000000002010000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000002000000000200000000000000000100000000000000000000000000020000000000000200000000000000010000000000000000000000010000000000000000000000000000000000010002000000000000000000000000000000000202000000000000000000000000000000000000000202000000000000000000000000000000000002000000000200000000000000000100000001000000000000020001000000000000000000000000000000000100000000000000000000010002000000000001000000000000000000000200000000020000000000000000000000000200000000000000000000000000000000000000000000000100000000010000000100000000000000000000000002000000000000000000000001000000000000000000000200000000000000000200000000000000010000000000020002000000000000000000000000000000000000000000000202000000000000000000000000000000000000000100000000000000020100000000000000000200000000000000020000000202000000010000000000000100000000000002010200000000000000000000000000000000000001000000000000000000000100000000000000010101000000000000000000000000000002000000000000000000000000000000000201000000000000000000020002000201000000000000000000000000010000000000020000000000000100000000000000000000000201000000000000010000000000000001000000010000000100000000000000000000000002000000000000010100000000000000000000000000000000000000000000000000000000000200000000000000000000020000000000000000000001000000020000000000000000000000000000000000000200000000000000000000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000020000000200000000000000000001000000000000000001000100000000000000000000000000010001000000000000000000000000000000000000000000000000020000000000000000000000000100000000000000000000000000000000000100000000000000000002000001000200000100000000000000000000000000000000000102000000000000000101000000020002000000000200000000020000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000100000000000000010000000000000000000000010100000000010000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000200000000000000000000020000000000000000020000000000000002000000000000020000000202000000000000000000000000000000000000000000010000000000000001000000000000000000000000000000000001000000010200000200000000000000000000000000000000000001000000000000000002000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000010000000200000000000000000000000000000002000000020000000000000100000000020000000000000002010200000000000000000000000000000000000000000000010100000100000000000000020000000000000002000000000000020000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000000000001000000000100010000000000000100000000000000010000010000000000000000000000000000000000000000000000020100000000020000000000000000000000000000000000000000000000000000000100000001000100000200000000000000000000000000010000000000000000000000000000000000000000000000000002000000000000000000000100010000000000000000020001000000010000000000000000000000000000000000000000000200000000000000020000000000000000000000000000000000000000000100020000020000000000000000000000000000000000000000020200020000000002000000000000000000000000000000000000010000000000000000000000020000000000000000020000000000000000000000000001000000000000000000000000000200000000000000000000000001000000000000000000000000000000000000000000020000000000000000000000000000000000000200000000020000000001000000000000020200000000000000000000000000000000000000010000000000000000000000010000000000000000000002000000000000000000000000000000000000000000000000000000020000020000000000000000000200000000020000000100000201000000000100000000000000000000000000000000000000000000000000010000000000000000000200000000000000000002000000000000000200000000000000020000010000000000000002000000000000010000000000000000000000000000000200020000000000000000020000000200010001000000000000000200000200000000000000000000000000000000000000020100000000000000000000000000000000000000000000000001000000000000000000000000000000000200000000000000000100020000000200000000020002000000000002000202000000000000000000000000000001000000000000020000000000000001020000000200020000000002000100000000000000020000000100000000000000000000000100000000000000000000010000000001000100000001000000020000000000000000000002000000000000000000000000020000000000000000000000000000000000000000000000000100000000000000010000000000000000000001000200000000000002020000000000000000020000000000000000000000000000000000000002000000000001010000000000000000000000000000000000000202010000000100020000000001000000000000000000000000000000000000000100000100000000000200000200000202000000000000000000000000000100000000000000000000000002000000000000000000000200020000010000010000000000000000000000000200000000000000000002000001020000000000020002000000010000000000000000000000000000000000000000000000000002010000000000000000000000000002000000000000000000000002000000000200000200000000000200020000000000000000000000000002000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010002000000000000000000000000000000000001000000000000000000000001000000000000000001000002000001010000000200000100000000000100000000020000000000000100010000000000000000000000000000000000020001020000000102000000000000000001000000000001000000000000000000000000000000010000020000000000000000000000020100000000000000000000000000000000000000000001010002000000000000000001000000000001000000000000010000020000000200000000000000000002000002000000000000000000000000000000000000000000000001000001000000000100000000010000000000000002000200000000000000010000000200020000000000000000000000000000000202000000000000000000000000000000000000000000000000000000000000000000000002010000000000000001000000000000000000000000000000000000000200000000000002000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000001000000000002000000000000000000000000000000010000000000000000000000000200000000000000000200000002000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000010000000000000000000000000002000000000000000000020200000000000000000200000000000000000000000000010000000000000000000000000000020000000000000000010000000000000000000000000000020002010000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000020000010000000000000000000000000000000000000000000100000001000000000000000000000002000000000000000000000000000000000001000000000000000000000000000000000001000000000000000000000000010200000001000000000000000000000000000000000000000100010001000000000002000000000000000100000000000000000000000000000100020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000002010001000000000002000000000001000200000000000000000000000001000000000000000200000100000000000000020002000000000002000000000000000000000000000000000000000000000000000000000000000000000100000000010000000000000000000000000000000000000000000000000000020000000100000100000000000001000000000000000000000000000000000001020000000000000000000000000000000000000100000100000000000000000000000001020000000000000000000000000000020000000000000100000000000000010000000000000000000000020000000000000200000000000200000000000000000000000000000000000000000000000000000000000000010000000000000000000100000000000000000000010000000000000000000200000000000001000000000200000001000000000000000002000002000000000001000000000000000000000000000000000000000001000100000000020000000100000000000000000000000001000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000100000100000000000200000000000000000000010000000000000000000000000000000100000000010000000000000000020000000000000000000000000000000000020000000000000002000000000000000000010000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000001000000020000000000000000000002010000020000000101000000000000000000000000010000000000010000000000000000000000020000000000010000000002000100000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000020001000201000000000002000100000000000000000000000000020000000000000000000000010000000000010000000000000000000000000001000000000000000000010200000100000100000000000100000000000000000000000000000000000000000000000201000000000000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000001000100010000000000000000000000000000000000000000000001000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000010000020000000000000000000000000000000000000100000000000000000000000002000200000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000010000000002000000000000000000000002000000000000000000000000000000000000000000000002010000000000000000000000000000000000000002000000020100000100000000000000000000000000000000000000000000000000010000000000000000000200000000000000000000000000000000000000020000000000000000000200000000000000000000000000000001000000000000000000010000000000000202000000000000000000000000000000000000020000000001000000020000010100000000000000000000000000020000000000000000000000000002000000000000000000000200000100000000000000000002000000000000000000000000000000000100000100020000000000000000000000000000000000020001020000000000020000000000000200000001000000000000000100010000000000000000020000010002000100000000000000000000000000000000000000000001000000000000000100000000000000000000000000020000000000000001000000000000000000000000000000000000000000000200000000010002020000020000000000010000000000000001020000000000000202000000000000000000000000000001000000000000010100000200010000000000000200010000000000000000000000000000000200000000020000000000000000000000000001000000000000000200000000000200000100000202000102000000000000010200000000000100010000000000000001020000000200000000000000000000000000000000000000020000000002000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000010002000000000100020001000000000000000000000102000000000000000000000000020100010000000000000000020001000000000001000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000200000000000002000000000000000000000000000000000000000100000000000000010001000000000000010000000000000002000000000000000000000000000000000000000200000000000102000000000000000000000000000000000000000001000002000000000000000000000200000000000000000000020000000000000000010000000000020200000000000000000000000000000000020000000000000000000000000200000000000000000000000000000000000200000000000000000000020000000100000000000001000000000000000000000000000000000000000200000002000000000000010000000000000001000000000000020000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000001000100000000000000000000020000000000000000000000000000000002000000010000000000000000000000000000000000000000000000000000020001000000000000000000000000000000000200000000000000000000000002000000000000000100000200000100000000000000000000000000000000000000010000010000000000000000000000000000000100000000000000000200000000010000000000020000000200000001000000000000000000000002000000000000000000000000000000000200000000000000000001000000000000000200000000000000000000000000000000000000000000000000000000000000020000000200000000000000010000000000010001000000000000000000020000000000000200000000000000000000000000000000000000000200000000010000000000010000000000000000000000000001000000000000000000000000000000020000000000000000000000000000000000010000020000000000000000000000000100020000000000000000000000000001000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000000202000002000000000000000000000000000000000200000000000100000000000000000100000200000000000000000000020000000000000000000000000001000000000000000000000000000002000000000200000200000100000000000000010000010000010000000002000201000000000000000000000000000200000000020000000000000200010000020000000101000100000000000000020001000002010002010000000000000000000101000001000000020000000100000200000000000100000000000000020000000002000000000000000002000000000000000000000000000001000000000000000000000000000200000001000100000000000001020000000000000000000001000000000000000200000000000000000000020000000000000000000200000000000002000000000000000000000000000200000001000002000000000000000000000000010001000000000000000000000000000000000000000000000001000000000100000000010000000000000000020000000002000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000020200000000000002000000000000000000000000020000020000020000000000000000000000000000000000000000000100000000000000000200000000000100000000000000000200000100000000000000000000000000000000000000000001000000000100000000000000000001000000000000000200000000000000010000000000000000000000000000000100000200000000020200000000000000000202000000000000000000000000000000010200000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000200000000000200000000000000000002000000010000000000000000020001000000000000000000000000000000010000000000000000000100000000000100000002000000000000000000000000000000000000000000020000000000000000000000000000000000000000000001000000000000000000000000000000020000000100000000000000000000000000000000000000000000000200000000000000000000000200000000000000000000000000000000000000020000000100000000000000000002000000000000000000000200000000000000000000000000000000000100000000000000000000000000000100000100000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000000000000000000000002000000000201000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000002000000000000000000000000000200000000000100000000000000000000000000020000000000000000000000000000000000020000000000000002000000000000000100000200000000000000000000000000000000000001000000000000000000000100000000000000020000000000000000000000000002000000000101000000000100000000010000000000000000000000020000000000000000000000000100000000020000000200000200000000000100000002000000000000000000000000020000000000000000000000000000000000000000000000000000010000000200000000000100000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000020000000100000000000001000000000000000000000100000000000001000000000000000200020000000000000000000100000100010001000000000002000002000000000000000000000000010000000000000000000201000000000000000000000000000100000000000000000000000100000100000000010000000000000000000000000000000000000200000000000002000102000000000002010000000000000000000000000002000200000000000000000000000202000000000000000000000000000000000000000202000000000000020001000000000000000000000000000001000000020000010000000000000000000002000000000000000000000000000100000000000000000000000000000000000000000000000000000000000002000000010000000000000000000000000000000000000100000000000000000000000000000000000000000000020001000000010000000000000000000002000000000000000000000002020000000000000000000000000000000001000202000000000000000000000000000000000000000000000001000000000000000000000100000000000000000001000000000000000000000000000000020000000000000000000000000000010000000000010000000100010000000000000000000000000000000000000000020000010200000000000100000000000000000000000000000000000002000000000000000000000102000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000020000000000000200000000000100000000000100000000000000000000000001020000000000000001000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000020000000000000000000001000000000100000000000000000000020000000000000000000200000100000000000002000000000000000000000100000000000000000000000000000200000000020000000000000002000000000000000000000001000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000002000200000000000000000000000200000000000000000200000100000100000000020000000000010002000000000000000002000000000000000000000000000000000000000100000000000000000000000102000000000000000000000000000000010000000000000202000000000000020000000000000000000000000000020002000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000000000000000000000000200000000000002000000000000000000000000000000000000010000000102000000000000000002000000000200000000000000020200000000000100000000000000020000000000000200000000000000000000000000000001000200000000000000000200010000000000000200000000000000000000000000000000000200000000000002000000000001000000020000000000020000000000000100000000000000000200000000000200000100000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020001000200000000000000020000000000000000000001000000000000000000000001000000000000010000000000000002000000000000010000000000000000000000000000000000000000000202000000000002000000000200000000000002020000000000000000000000000000000000000000020000000000000000000000000100020000000000000000000201000000000000010000000000000000020002000000010000000102000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000000020000000000000200000000000000000000000000000000000001000000000000000000000000000000000000000002000000000002000000000200000100000000000000000200000000000000000000000000000200000000000200000000000000020000000000000002000200000000020000000000000100000001000000000000000000000000000000000000000000000100000002000000010000000000000000000000000000000000000000000000000000000000000001000000010000000000000000000000000000000100000000000000000100000100000000000000000000000000000100000000000200010000000100000000000000000000000000000000000000020001000000000000000000000000000000000000000100000000000100000000000000000000000000000000000000000000000000000002000001000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000020002000100000000000200000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000201000000000000000200000200000000000000000100000000000000000000000000000000000000000000000000000202000000010000000000000000000000000200000000000000000002000000000000000000000000000000020000020000020001000001000000000200000000000002000000020000000000000002000000000200000000000101000000000000000000000000000001000200000000000000020000000000000000000100000000000000000200000000000000000000000100020002000000020000000000000000000000000000000001010000000000000000000000010000000000000000010000000000000000000000000000000000000000000000000000010000020000000100000001000000000000000002000000000000000100010100000000020100000000010100000000000000000000000200000000000000000000000000000000000000010001020000000000000001000000000000000000000100000200000000000000000000000000000000000000000000000000000002000000000000000000000000000000010000000000020000000000000100000000000000000000000000000000000000020000020000000001000000000000020000000000000000000000000000000000000000000000000000000000020001000000000200000000000000010200000000000002000000000001020000000200000000000000000000000000000100000000000000000001000000020200000000000100000002010000000000020000000000000100000000000100000000020000000000000000000000020000020202000000000000000000000200000000000000000000000001000000000000000000000000000000000000000000020000000001000000020200000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000020000000000000101000000000000000001000000000200000000010000000000000000000000000002000000000000000000000000000000000000000000020000000000000000000000000002000000000000000000000000000000010000000002000002000000000000000000000000000000000000000000000000000000000000010200010000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000100000000000200000200000000000000000000000000000000000000000000000001000000000001000000000000000000020000000000000000020000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000200000000000100000000000000000000000000000000000102000000000000000000000000000000000000000001000100000000000000000002000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000100000002000001000100000000000000000000000000000001000000000000000000000100000000000100000000000002000000000000000000000000020200000000000000000000000000000000000000000000000000000000000000000200000000000002000000010000000000010000000000000000000000000000000000000000000100000000000000000002000000000000000000000001000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000102000000010000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000200010000000000020000000000000000000000020000020000000002000000000000000000000000000000000000000002000000000000000000000000010000000002000001000000000000000000000000000000000100000200000000000000000002000000000002000000000000000000010000000000000200000000000000000000000000000000000000000000000000000000000100010000020000000202000000000000000000000000000002000000000000020200010000000001000000000002020002000000000000000000000000000000000000020000000002000000000100010000020000000000000000000000000000000000000000010000000000000000000000000000000100000000000000000000000000000000000000000200000000020000000000000000000000000000000000000000000000000000000000000000000000020000020000000000000000000000000000000000000000000000000000000000000002000002000000000000000000000000000000000000000000000000000001000000000000000000000000000001000000010000000002000000000000000000000000000002000000020000000002000000000000000001000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000002010000000000000000020000000000000200000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000020000000002020000000102000100000000000000000002010000000000000201000000000000000000000000000000000200000000010000000000000000000000000000000002000000000000000000000002000000000000000200000000000000000000000000000000000000000001000000000000000000000000000000000000000100000000000000000001000000000000000000000000000000000000010002000100000001000000000000000000000000000200000000000000000100000000000000000000000000000000000000000001000000000000000000000000020000000000000000020001000000000200000000020000000000000000000000000000000100000000000000000001000000000000000000000002000000000000000000000000000000000000000000000001000200000000000000000000000000000001000001000000000200000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000200000000010000000000000100000000000000000000000000000000000000000000000100010000000000000000000000000000000200000000000000000000000000000000000100000000000000000000000000000200000002020000000002000000000000000001000000000000000000000000000200000100000200000002000000000002000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000000100010000000000000101000000000000010200010000000000000000000000000000010000000000000000000000000000000200000000000000000001000000000200000000000000000000000000000000000000020200000000000100000000000000000000000001020002000001000000000000010000000100000002000200000000000000000000000100000000000000000100010000020100000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000000000200000002000001000000000000000100000000000000000002000000000000000000000002000000000000000200000000000000000000000000000000000000000000000200000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000002000000000200000000000000020001000000000002000000000000000000000200020200010000000000000200000000000000000000000000010000000000000000010000000200000000000000010002000000000000000100000000000000000000000000000000000000010000000000000100000000000000000200000000000000000000000000000000000000000000020000000100000000000000000000000100000000000000020000000000000000000101000000000000020000010202000200000000000000020000000200020000000000000102000000000000000000000000000001000000000000020000000000000000000200000000000002000002000000000200000200000000000000000000000001020000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000001000000000000000200000000000000000000000000000002000000000000000000000200010000000001000000000000000000010000000000000000000000010000000000000000000001020001000200000000000001000000000000000200000000000000000000000000000200000000000000000000000000000002000001000000020201000001010100000000000000000000020000000000000000000002000000000000020002020000000000000000000002000000000000000000020000000000010100000000000000000000000000000001020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000100000000000000000000000000000000000000000100000002000001000000000001000000000000000002000001000000010000000000000000000000000000000000000000000000000001010000000000000000000000000000000000000000000000000000000000000000000000010000000000000002000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000100000000000000000200000000020000000200000200000000000000020000000000000000000000000100000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000020000000001000200000000000002000100000000000000000000000000000000020200000000000000000000020000000000010000000000010100000100000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000100000000000000000000020000000000000000000000000000000000000200000000000000000000000100000000000000000000000000000000000000000000020000000000000000000000000202000000000002000000000000000000000000000001000000000000020000000000000000000000000000000000000000000000020000000000000000000000000000000000010000020000000000000200000002000000000000000100000000000000000000000000010000000200000000000001000000000000000000000002000001000000000000000000020000000000010201000000000000000000000100000000000000020000000000000000000000000000000000000001000000000000000000000000000000000000010000000200000200020000000000000100000000000000000000000000000200000000000001000000000001000100000000000001000000000000000002000000000000000000000000000000000000000000000001000000000000000000000000000000000001010000000000000100000000000000000000000000000000000000000000000000000000010100000002000000000100000000000000000000000000000200000002000000000000000000000200000000000000000000000000000000000000000000000002000200000000000000000000000000000000000000010000000200000000000000000000000000000000000000000002000000000000000000000000000000000000020000000000000200000000000000000000020000000000000000000200020000000000000000000000000000000000000000000000000000000000000000020000000000000200000000000000000000020000000100000000000000000000000000000100000000000002000002000001000000010002000000010000020000000100000000000000000000000000000100000000000100010000000200000000000000000001000000000001000000020000000200010000000000000001000000000000000000000001000001000000000000000000000000010000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000002000000000000000000020000020000000000020000000200000000000000000001000000000100000000000000000000000000000000000000000000000001000000000000000000000000000000000000000002000000010000000000000000000000000000000002000002000101000000000000000100000000000000020000000100000000010000020000000000000000000000000000000000000000000200020000010002000100000000000100000000000000000000000000000000000002020002000000000000010000020200010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000201000000000000000000000000000002000002000002000000000000000000000000000000000000000200000000000002000000000002000000000000000000000000000000000000000000000000000000000000000200000000000000000000000100000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000200000000000002000000000000000200010100000000020000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000020000020000000000000000000000000000000000000000000000000000000000000000000000000000020000000001000000000000000000000000020000000000000000000000000000000000000000010100000001000000000001000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001000000000100000000000000000002000000020000000000000000000000000000000000000000000000000100000000000000000000000000000000020000000000000000000000020002000000000000000001000000000000000100000000000001020000000000000001000000000000000000000000000000000002010001000000000001000000000000000000000002000002000200000000020000000000000002000000000000000000000000000000000000000000000000020100000000000000000002000000000000010000000000000000000200000000000000000000000001000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020100000000000000010000000001000000000100000000000000000000000000000000000001000000000000020000000000000002000001000000000000000000000000000000010202000000000000010000000000000000020000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000001000202000100000000020000000000000000000000000000010000000002020000000100000002000000000002000000000000000000010000010200000000000000000000020001000000000000000000000002000000020002000000020000000000000000000000000000000000000000000000000002020000020000000000000000000201000000020002000000000000000000000000000100010000000000000000000000000000000000000000020000000000000000000000000000000000020000000000000000000200000000020000000000000000000000000000010000000000000000000000010001000000020000000000000100000000000002000000000200000000000000010000000000010000000000010000000000000200000000000002000000000000020000020002000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000200000000000000000000000000000000000100000000000000000000000000000000000002000000000000000000010001000000000000000000000000000000000000000000000000000001000000000000000000000000000001000200000000000001000000000200000000000000000000000200000200020002010000000001000000000000000000000000000000000000000000000000010000000000010000000000000000000000000000000000000000000000020100000000000100000000000000000200000000000000000000000002000000000000000000000000010000000000000000000000000000000000000002010200000002000000000200000000000100020000000000000000000000000001000000000000000000000000000000000000000001000000000000000001000000000000000000000200000000000000000000020000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000002000000000000000000000000000000000000010000000201000000020000000000000000000000000001000000000000000000000000000002000000000000000000000000000000000000010000000000000001000001000000000000000001000000000000000000000000000000000000010000000000000000000000000002000000000000000001000000000000000002000000010000000000000000000202000100000001000000000000000000000000000000000000000002000000000000000000000000000000000001000000000000000000000000000000000201000000000000000000000002000000020000000000000000000000000000000000000000000000000001020001000002000000010000000000020000000000000000000002010000000000000000000000000000000000000000000200000000000000000100020100000000000000000000000000000000000200000000000100000000000000000000000002000000000002000000000000000000000000000200000000000000000002020000000000000000000000000002000000020000020000000000000000000000000000000000000200000000000000000002000000000002000000000000000000000000000000000200000000000000010200000000000001000000000000010000000000000000000000000002000000000000020000000000000000000000010000000102000002000000000001000000000000000000000002000000000000000000000000000100000002010000000100000000000000000000000000000000000000000000000001000000000100000000000002000200000000000001000000000000000000000000000001000000000000000000000000010000000000000000000000000001000000020000020000000001000002000000000000000000000000000001000000000000000000000000000000000001000000000000000000000200000000000000000101000001000000000100000000020000000000000000000000000000000100000000000002020000000000000000000100000000000000000000000000000000000100000000000000010000000001000000000000000000000000000000000200000000000000000000000000020000000000000000000000000000000000000000000001000000000100000000000000010000000000000000000000000000020001000000000002000000000000010100000000000000020000000000000000010000000002000000000000000000000000000000000000000200000000000000000000020000000200000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000001000000020000000000000200000000000000000001010200000000010000000000000000000000000000000000000000000000000000000001000000000000000000000100000000000000000000000000000200000000000000000000000000000000000100000000000000000000000100000000000100000000010100000100000000020000000000000001000000010000000100000001010002000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000000010002000000000000000000000000000000000000000000000000000000000100000000000000000000000200000002000001000000000000000000000000000000000000000200000001010001000000000000010200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000010100000000000000020000000000020000020100000202000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000010100000000000002000000000001000000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000010000000000000000020000000000000000000100000000000000000000010000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000002000000010000000001000200000000000002000002000200000001000000000000000000020000000002000200000000000000000200000001000000000000000001000000010000010002000000000000000000000001000000000000020000000002000100010001000000000000000000000000000100000000000100000000000000000000000200000000000000000001000000000000000000000001000000000000000000000000000001000000000001000000000000000000000001010000000100000000000000000000000001000000000000000000000000000100000100000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000200000200000000000000000000000002000000000000000002000000000000000000000000000000000000000001000000000000000000000000000000000000000001000000020000000100000000000200000000000000000000000000000000000000000001000000000000010100000000000000000000000000020000000200000000000000020000000001000000000000000002000000020000000000000000000000000000000000000002010000000000000000000000000002000000000000000001000000000000000000010000000000000100000000000100000000000002000002000100000002000000000002000000000000000001000002000100000000000001000000020000000000000000000000000000000000010000000200000000000002000000000000000000000000000000000000000000000000010000000000000200000000000000000000000000000200000000000100000000020000000002000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000001000000000000000000000000000000000000010000000000000000000000000200000000000000010002000000000000000000000001000000020000000000000000000100000000000000000002000000000000000000000000000000000000000000000200000000010000000000010002000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000010000000000000002000000010000000000000000000100000000000200000000000000000000000000020000000000000000000000000000000000010000000001000000010000000000000000000000000200000000000001000000010000000000000000000002000000000000000000010200020000000000010000000000000000000000000000000000000000000000000002000000000000000002000000000000000000000000000002000000000000000000000000000000000000000000000000000002000000020002020001000000000000000100000000020000000000000000000000000000000000000000000000000000000000000000000000000000010002000000000000000000000000000000000000000000000000000101000000000000000100000000000200000000000000000000000000000200000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000002000002000000000200000001000001000000000000000000010000000000000000000000000002000000000000000000000000000000000002000000020000000000000200000000000100000000010000000000000000000000000001000000000000000000000000020000000200000000000000000001000001020000000000000000000000000001000002000000000000000000000200020000000000000000000000000000000000000000000000020100000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200020000000002000000000000000200000000020000000000000002000000000000000000000000000000000000000200000000000000000000000001000000000000000000000000000000000000000000000000000002000000010002000000000200000100000200000001000002000000000100000000000000000000000000000000000000000100000000020000020000000000000000000000000000000000000200000000000000000000000000020000000100000000000000000000010000000002000000000000000002000000000000000000000000000000000000000000000001000000000000000000000000000001000000000000000200000000000000000000020000000001000000000200000000000000000000000200000002000000000000000000000000000002000000000000000000000000000002000000000000000200000000020100000100000100000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000200000000000000000000000100000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000001000001010200000100000000000100000000000000000000000000000000000000000001000000000200000000000000000000000000000000010000000000000000000000000000000000010000000000000000020000000000000000000000000001000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010000000000000000000000000000000000000100010000000002000000000000000000020000000000000000000000000000000000000000000000000100000000020000000000000000000000000000000000000200000000020000000000000200000000000000010000000000000000000000000000000000000000000000000000000000000000000000010001000002000000000000000000000000000000000001000000000000000000000000000000000000000000000200000000000000000000000000010000000000000001020000000000020000000001000100000000010000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000200010000000000000000010000000000000000000200000000000000000000000000000000000100010000000100010000000000000102000000000000000000020000000000000000000000000000000000000000000000000000000000000100000200000200000002000202020000000000000000000000000001000000000000000000000000000002000200000000010000000000000000000000000000020000010000000000000000000000000200000000000000000000000000020000000000000000000002000000000000000000000000000100000000000000000000000000000000000000000001020000000100000000020000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000010002000000010000000000000000000000000002000000000200000000010000000001000000000000000000020000000000000000000000000000000000000000000200000000020000000000000000000000000200000000000000000000000000000000020001000000000000010200000000000200000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000010000000200000000000000000001000000000000000000000000000001000100000200000000000000000000000000000000000000000000000002000000000000000000000000000000000000000001000000000200000000010000000000000100000000000000010000000000000100000000000000000000000200000000000100000000000000010000000000000000020200000000010000010000010000000000000001000200000000000000020000000000000000000001000000000000000000000000010001000000000000000002000000000000000000000000000000000000000200000000000000000002000000000001000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000010000000000010100000200000000000000000000000001000000000000000000000000000000000200000000000000000000020000000000020002000000000000010000000000000000000100000000000000000000000000000000000000000000000000000000000002000000000001000000000000000001000000000000000000000000000200020000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000020200000001000000000000000000000000000000000002000000000000000000000000000000000000020000000000000002000000020000000200000000000000020000000000000000000000000000000200000002000000000000000000000200000000000000020002000000000000000000000000000000020000000000000000000000000200000000000001000000000000000002000001000000000200000000000000000000000000000000000100000000000000000001000000000000000000000001000000000000000000010000000000000200000000000000000000000000000000000000000000000002000200000000000002000000000000000000010000000000000000000000000001000000000000000200000000000000000000000100000001000000000000000000000000000000000001000000000000000202000000010000000000020001000201000000000000000001000000000000010000000000000000020001000200000000000000000000000000000000000001000000000000000000000001000000000000000000000101000000000000000000000000000100000000000000000002000000000000000000000000000000000000000200000000000000000000000000010000000000000000000002000200000000020000000000000002000000000000000002000000000000000000000000000002000000000000000000000000000000020000000000010200000000000000000000000000000002000000020000000000020000000000000200000000000000000000000000010000020000000000000000000000010001000000000000000000000000000000020200000000000000000000000000000000010000000000000000000200000001000000000000020000000000000002000000000000000000020000000000000000000000000000000000000200000000000000000000000100000000000000000000000000000000000000000000000000000000000001000000010000000000000000000000000200020000020000000000000200010000000000000000000000000000000000000000000000000001000000000200000000010200000000000000000000020002000000000002000200000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000010000000002000000000000000100000000000002000000000000000100000000000101000000000000010000020000000000000000000000000000000100000000000000000200000000010000000001000000000000000000020001000000000000000000000001000000000000000000000000000000000002000000000000020000000000000000020000000200000000000000000000000000000000000000000001000000000000000000000000000000000100000000000001020000000000020200000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000100000000000000000000000000000000000100000000000000000000000000000000010000000001000000000000000001000000020000000000000000000000010000000200000000000001000100000000000200000000000000000000000002000000000000000000000000000001000000000000000000000100000000000000000101000002000000000000000000010000000000000000000000000200000000020000000000000000000000000000000000000000010000000000000000000000000200000000000000000000010000000000000000010000000000000000"> : tensor<192x192xi8> diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_auto_parallelization.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_auto_parallelization.cc index dc83c371c..f7ab429e6 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_auto_parallelization.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_auto_parallelization.cc @@ -11,7 +11,7 @@ TEST(ParallelizeAndRunFHE, add_eint_tree) { checkedJit(lambda, R"XXX( -func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>, %arg2: !FHE.eint<7>, %arg3: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>, %arg2: !FHE.eint<7>, %arg3: !FHE.eint<7>) -> !FHE.eint<7> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<7>, !FHE.eint<7>) -> (!FHE.eint<7>) %2 = "FHE.add_eint"(%arg0, %arg2): (!FHE.eint<7>, !FHE.eint<7>) -> (!FHE.eint<7>) %3 = "FHE.add_eint"(%arg0, %arg3): (!FHE.eint<7>, !FHE.eint<7>) -> (!FHE.eint<7>) diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_clear_tensor.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_clear_tensor.cc index 60f036c93..7ebf41ccb 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_clear_tensor.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_clear_tensor.cc @@ -7,7 +7,7 @@ TEST(End2EndJit_ClearTensor_1D, DISABLED_identity) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi64>) -> tensor<10xi64> { +func.func @main(%t: tensor<10xi64>) -> tensor<10xi64> { return %t : tensor<10xi64> } )XXX", @@ -38,7 +38,7 @@ func @main(%t: tensor<10xi64>) -> tensor<10xi64> { TEST(End2EndJit_ClearTensor_1D, extract_64) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi64>, %i: index) -> i64{ +func.func @main(%t: tensor<10xi64>, %i: index) -> i64{ %c = tensor.extract %t[%i] : tensor<10xi64> return %c : i64 } @@ -63,7 +63,7 @@ func @main(%t: tensor<10xi64>, %i: index) -> i64{ TEST(End2EndJit_ClearTensor_1D, extract_32) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi32>, %i: index) -> i32{ +func.func @main(%t: tensor<10xi32>, %i: index) -> i32{ %c = tensor.extract %t[%i] : tensor<10xi32> return %c : i32 } @@ -81,7 +81,7 @@ func @main(%t: tensor<10xi32>, %i: index) -> i32{ TEST(End2EndJit_ClearTensor_1D, extract_16) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi16>, %i: index) -> i16{ +func.func @main(%t: tensor<10xi16>, %i: index) -> i16{ %c = tensor.extract %t[%i] : tensor<10xi16> return %c : i16 } @@ -99,7 +99,7 @@ func @main(%t: tensor<10xi16>, %i: index) -> i16{ TEST(End2EndJit_ClearTensor_1D, extract_8) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi8>, %i: index) -> i8{ +func.func @main(%t: tensor<10xi8>, %i: index) -> i8{ %c = tensor.extract %t[%i] : tensor<10xi8> return %c : i8 } @@ -116,7 +116,7 @@ func @main(%t: tensor<10xi8>, %i: index) -> i8{ TEST(End2EndJit_ClearTensor_1D, extract_5) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi5>, %i: index) -> i5{ +func.func @main(%t: tensor<10xi5>, %i: index) -> i5{ %c = tensor.extract %t[%i] : tensor<10xi5> return %c : i5 } @@ -133,7 +133,7 @@ func @main(%t: tensor<10xi5>, %i: index) -> i5{ TEST(End2EndJit_ClearTensor_1D, extract_1) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10xi1>, %i: index) -> i1{ +func.func @main(%t: tensor<10xi1>, %i: index) -> i1{ %c = tensor.extract %t[%i] : tensor<10xi1> return %c : i1 } @@ -186,7 +186,7 @@ const llvm::ArrayRef shape2D(dims, numDim); TEST(End2EndJit_ClearTensor_2D, DISABLED_identity) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<2x10xi64>) -> tensor<2x10xi64> { +func.func @main(%t: tensor<2x10xi64>) -> tensor<2x10xi64> { return %t : tensor<2x10xi64> } )XXX", @@ -211,7 +211,7 @@ func @main(%t: tensor<2x10xi64>) -> tensor<2x10xi64> { TEST(End2EndJit_ClearTensor_2D, extract) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<2x10xi64>, %i: index, %j: index) -> i64 { +func.func @main(%t: tensor<2x10xi64>, %i: index, %j: index) -> i64 { %c = tensor.extract %t[%i, %j] : tensor<2x10xi64> return %c : i64 } @@ -234,7 +234,7 @@ func @main(%t: tensor<2x10xi64>, %i: index, %j: index) -> i64 { TEST(End2EndJit_ClearTensor_2D, extract_slice) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<2x10xi64>) -> tensor<1x5xi64> { +func.func @main(%t: tensor<2x10xi64>) -> tensor<1x5xi64> { %r = tensor.extract_slice %t[1, 5][1, 5][1, 1] : tensor<2x10xi64> to tensor<1x5xi64> return %r : tensor<1x5xi64> } @@ -262,7 +262,7 @@ func @main(%t: tensor<2x10xi64>) -> tensor<1x5xi64> { TEST(End2EndJit_ClearTensor_2D, extract_slice_stride) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<2x10xi64>) -> tensor<1x5xi64> { +func.func @main(%t: tensor<2x10xi64>) -> tensor<1x5xi64> { %r = tensor.extract_slice %t[1, 0][1, 5][1, 2] : tensor<2x10xi64> to tensor<1x5xi64> return %r : tensor<1x5xi64> } @@ -290,7 +290,7 @@ func @main(%t: tensor<2x10xi64>) -> tensor<1x5xi64> { TEST(End2EndJit_ClearTensor_2D, insert_slice) { checkedJit(lambda, R"XXX( -func @main(%t0: tensor<2x10xi64>, %t1: tensor<2x2xi64>) -> tensor<2x10xi64> { +func.func @main(%t0: tensor<2x10xi64>, %t1: tensor<2x2xi64>) -> tensor<2x10xi64> { %r = tensor.insert_slice %t1 into %t0[0, 5][2, 2][1, 1] : tensor<2x2xi64> into tensor<2x10xi64> return %r : tensor<2x10xi64> } @@ -365,7 +365,7 @@ TEST_P(ReturnTensorWithPrecision, return_tensor) { uint64_t precision = GetParam(); std::ostringstream mlirProgram; - mlirProgram << "func @main() -> tensor<5x3x2xi" << precision << "> {\n" + mlirProgram << "func.func @main() -> tensor<5x3x2xi" << precision << "> {\n" << " %res = arith.constant dense<1> : tensor<5x3x2xi" << precision << ">\n" << " return %res : tensor<5x3x2xi" << precision << ">\n" diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_dfr.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_dfr.cc index cfac5e5cd..6104a0d34 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_dfr.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_dfr.cc @@ -9,9 +9,9 @@ const mlir::concretelang::V0FHEConstraint defaultV0Constraints{10, 7}; TEST(CompileAndRunDFR, start_stop) { checkedJit(lambda, R"XXX( -func private @_dfr_stop() -func private @_dfr_start() -func @main() -> i64{ +func.func private @_dfr_stop() +func.func private @_dfr_start() +func.func @main() -> i64{ call @_dfr_start() : () -> () %1 = arith.constant 7 : i64 call @_dfr_stop() : () -> () @@ -28,7 +28,7 @@ TEST(CompileAndRunDFR, 0in1out_task) { llvm.func @_dfr_create_async_task(...) attributes {sym_visibility = "private"} llvm.func @_dfr_stop() llvm.func @_dfr_start() - func @main() -> i64 { + func.func @main() -> i64 { %0 = llvm.mlir.addressof @_dfr_DFT_work_function__main0 : !llvm.ptr)>> %1 = llvm.mlir.constant(0 : i64) : i64 %2 = llvm.mlir.constant(1 : i64) : i64 @@ -66,7 +66,7 @@ TEST(CompileAndRunDFR, 1in1out_task) { llvm.func @_dfr_make_ready_future(...) -> !llvm.ptr attributes {sym_visibility = "private"} llvm.func @_dfr_stop() llvm.func @_dfr_start() - func @main(%arg0: i64) -> i64 { + func.func @main(%arg0: i64) -> i64 { %0 = llvm.mlir.addressof @_dfr_DFT_work_function__main0 : !llvm.ptr, ptr)>> %1 = llvm.mlir.constant(1 : i64) : i64 %2 = llvm.mlir.constant(8 : i64) : i64 @@ -112,7 +112,7 @@ TEST(CompileAndRunDFR, 2in1out_task) { llvm.func @_dfr_make_ready_future(...) -> !llvm.ptr attributes {sym_visibility = "private"} llvm.func @_dfr_stop() llvm.func @_dfr_start() - func @main(%arg0: i64, %arg1: i64) -> i64 { + func.func @main(%arg0: i64, %arg1: i64) -> i64 { %0 = llvm.mlir.addressof @_dfr_DFT_work_function__main0 : !llvm.ptr, ptr, ptr)>> %1 = llvm.mlir.constant(2 : i64) : i64 %2 = llvm.mlir.constant(1 : i64) : i64 @@ -167,7 +167,7 @@ TEST(CompileAndRunDFR, taskgraph) { llvm.func @_dfr_make_ready_future(...) -> !llvm.ptr attributes {sym_visibility = "private"} llvm.func @_dfr_stop() llvm.func @_dfr_start() - func @main(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 { + func.func @main(%arg0: i64, %arg1: i64, %arg2: i64) -> i64 { %0 = llvm.mlir.constant(7 : i64) : i64 %1 = llvm.mlir.addressof @_dfr_DFT_work_function__main0 : !llvm.ptr, ptr, ptr)>> %2 = llvm.mlir.constant(2 : i64) : i64 diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_encrypted_tensor.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_encrypted_tensor.cc index 8401b8f22..aa4a7583f 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_encrypted_tensor.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_encrypted_tensor.cc @@ -2,7 +2,7 @@ TEST(End2EndJit_EncryptedTensor_2D, extract_slice_parametric_2x2) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<8x4x!FHE.eint<6>>, %y: index, %x: index) -> tensor<2x2x!FHE.eint<6>> { +func.func @main(%t: tensor<8x4x!FHE.eint<6>>, %y: index, %x: index) -> tensor<2x2x!FHE.eint<6>> { %r = tensor.extract_slice %t[%y, %x][2, 2][1, 1] : tensor<8x4x!FHE.eint<6>> to tensor<2x2x!FHE.eint<6>> return %r : tensor<2x2x!FHE.eint<6>> } @@ -42,7 +42,7 @@ TEST(End2EndJit_EncryptedTensor_4D, extract_slice_parametric_2x2x2x2) { constexpr int64_t dimSizes[4] = {8, 4, 5, 3}; checkedJit(lambda, R"XXX( -func @main(%t: tensor<8x4x5x3x!FHE.eint<6>>, %d0: index, %d1: index, %d2: index, %d3: index) -> tensor<2x2x2x2x!FHE.eint<6>> { +func.func @main(%t: tensor<8x4x5x3x!FHE.eint<6>>, %d0: index, %d1: index, %d2: index, %d3: index) -> tensor<2x2x2x2x!FHE.eint<6>> { %r = tensor.extract_slice %t[%d0, %d1, %d2, %d3][2, 2, 2, 2][1, 1, 1, 1] : tensor<8x4x5x3x!FHE.eint<6>> to tensor<2x2x2x2x!FHE.eint<6>> return %r : tensor<2x2x2x2x!FHE.eint<6>> } diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_fhelinalg.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_fhelinalg.cc index c683f6e48..35743b18c 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_fhelinalg.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_fhelinalg.cc @@ -15,7 +15,7 @@ TEST(End2EndJit_FHELinalg, add_eint_int_term_to_term) { checkedJit(lambda, R"XXX( // Returns the term to term addition of `%a0` with `%a1` - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -47,7 +47,7 @@ TEST(End2EndJit_FHELinalg, add_eint_int_term_to_term_ret_lambda_argument) { checkedJit(lambda, R"XXX( // Returns the term to term addition of `%a0` with `%a1` - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -90,7 +90,7 @@ TEST(End2EndJit_FHELinalg, checkedJit(lambda, R"XXX( // Returns the term to term addition of `%a0` with `%a1` - func @main(%a0: tensor<4x2x3x!FHE.eint<6>>, %a1: tensor<4x2x3xi7>) -> tensor<4x2x3x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x2x3x!FHE.eint<6>>, %a1: tensor<4x2x3xi7>) -> tensor<4x2x3x!FHE.eint<6>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x2x3x!FHE.eint<6>>, tensor<4x2x3xi7>) -> tensor<4x2x3x!FHE.eint<6>> return %res : tensor<4x2x3x!FHE.eint<6>> } @@ -134,7 +134,7 @@ TEST(End2EndJit_FHELinalg, add_eint_int_term_to_term_broadcast) { checkedJit(lambda, R"XXX( // Returns the term to term addition of `%a0` with `%a1` - func @main(%a0: tensor<4x1x4x!FHE.eint<5>>, %a1: tensor<1x4x4xi6>) -> tensor<4x4x4x!FHE.eint<5>> { + func.func @main(%a0: tensor<4x1x4x!FHE.eint<5>>, %a1: tensor<1x4x4xi6>) -> tensor<4x4x4x!FHE.eint<5>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x1x4x!FHE.eint<5>>, tensor<1x4x4xi6>) -> tensor<4x4x4x!FHE.eint<5>> return %res : tensor<4x4x4x!FHE.eint<5>> } @@ -189,7 +189,7 @@ TEST(End2EndJit_FHELinalg, add_eint_int_matrix_column) { // [7,8,9] [3] [10,11,12] // // The dimension #1 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -235,7 +235,7 @@ TEST(End2EndJit_FHELinalg, add_eint_int_matrix_line) { // [7,8,9] [8,10,12] // // The dimension #2 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -273,7 +273,7 @@ TEST(End2EndJit_FHELinalg, add_eint_int_matrix_line) { TEST(End2EndJit_FHELinalg, add_eint_int_matrix_line_missing_dim) { checkedJit(lambda, R"XXX( // Same behavior than the previous one, but as the dimension #2 of operand #2 is missing. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -316,7 +316,7 @@ TEST(End2EndJit_FHELinalg, add_eint_term_to_term) { checkedJit(lambda, R"XXX( // Returns the term to term addition of `%a0` with `%a1` - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.add_eint"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -350,7 +350,7 @@ TEST(End2EndJit_FHELinalg, add_eint_term_to_term_broadcast) { checkedJit(lambda, R"XXX( // Returns the term to term addition of `%a0` with `%a1` - func @main(%a0: tensor<4x1x4x!FHE.eint<5>>, %a1: + func.func @main(%a0: tensor<4x1x4x!FHE.eint<5>>, %a1: tensor<1x4x4x!FHE.eint<5>>) -> tensor<4x4x4x!FHE.eint<5>> { %res = "FHELinalg.add_eint"(%a0, %a1) : (tensor<4x1x4x!FHE.eint<5>>, tensor<1x4x4x!FHE.eint<5>>) -> @@ -407,7 +407,7 @@ TEST(End2EndJit_FHELinalg, add_eint_matrix_column) { // [7,8,9] [3] [10,11,12] // // The dimension #1 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.add_eint"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> @@ -455,7 +455,7 @@ TEST(End2EndJit_FHELinalg, add_eint_matrix_line) { // [7,8,9] [8,10,12] // // The dimension #2 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.add_eint"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : @@ -496,7 +496,7 @@ TEST(End2EndJit_FHELinalg, add_eint_matrix_line_missing_dim) { checkedJit(lambda, R"XXX( // Same behavior than the previous one, but as the dimension #2 of operand #2 is missing. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.add_eint"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -535,7 +535,7 @@ TEST(End2EndJit_FHELinalg, add_eint_tensor_dim_equals_1) { checkedJit(lambda, R"XXX( // Broadcasting shouldn't happen when some dimensions are equals to 1 - func @main(%arg0: tensor<3x1x2x!FHE.eint<5>>, %arg1: tensor<3x1x2x!FHE.eint<5>>) -> tensor<3x1x2x!FHE.eint<5>> { + func.func @main(%arg0: tensor<3x1x2x!FHE.eint<5>>, %arg1: tensor<3x1x2x!FHE.eint<5>>) -> tensor<3x1x2x!FHE.eint<5>> { %1 = "FHELinalg.add_eint"(%arg0, %arg1) : (tensor<3x1x2x!FHE.eint<5>>, tensor<3x1x2x!FHE.eint<5>>) -> tensor<3x1x2x!FHE.eint<5>> return %1 : tensor<3x1x2x!FHE.eint<5>> } @@ -582,7 +582,7 @@ TEST(End2EndJit_FHELinalg, sub_int_eint_term_to_term) { checkedJit(lambda, R"XXX( // Returns the term to term substraction of `%a0` with `%a1` - func @main(%a0: tensor<4xi5>, %a1: tensor<4x!FHE.eint<4>>) -> tensor<4x!FHE.eint<4>> { + func.func @main(%a0: tensor<4xi5>, %a1: tensor<4x!FHE.eint<4>>) -> tensor<4x!FHE.eint<4>> { %res = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<4xi5>, tensor<4x!FHE.eint<4>>) -> tensor<4x!FHE.eint<4>> return %res : tensor<4x!FHE.eint<4>> } @@ -613,7 +613,7 @@ TEST(End2EndJit_FHELinalg, sub_int_eint_term_to_term_broadcast) { checkedJit(lambda, R"XXX( // Returns the term to term substraction of `%a0` with `%a1`, where dimensions equals to one are stretched. - func @main(%a0: tensor<4x1x4xi8>, %a1: tensor<1x4x4x!FHE.eint<7>>) -> tensor<4x4x4x!FHE.eint<7>> { + func.func @main(%a0: tensor<4x1x4xi8>, %a1: tensor<1x4x4x!FHE.eint<7>>) -> tensor<4x4x4x!FHE.eint<7>> { %res = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<4x1x4xi8>, tensor<1x4x4x!FHE.eint<7>>) -> tensor<4x4x4x!FHE.eint<7>> return %res : tensor<4x4x4x!FHE.eint<7>> } @@ -666,7 +666,7 @@ TEST(End2EndJit_FHELinalg, sub_int_eint_matrix_column) { // [7,8,9] [3] [4,5,6] // // The dimension #1 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3xi5>, %a1: tensor<3x1x!FHE.eint<4>>) -> + func.func @main(%a0: tensor<3x3xi5>, %a1: tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<3x3xi5>, tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : @@ -715,7 +715,7 @@ TEST(End2EndJit_FHELinalg, sub_int_eint_matrix_line) { // [7,8,9] [6,6,6] // // The dimension #2 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3xi5>, %a1: tensor<1x3x!FHE.eint<4>>) -> + func.func @main(%a0: tensor<3x3xi5>, %a1: tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<3x3xi5>, tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : @@ -756,7 +756,7 @@ TEST(End2EndJit_FHELinalg, sub_int_eint_matrix_line_missing_dim) { checkedJit(lambda, R"XXX( // Same behavior than the previous one, but as the dimension #2 of operand #2 is missing. - func @main(%a0: tensor<3x3xi5>, %a1: tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3xi5>, %a1: tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_int_eint"(%a0, %a1) : (tensor<3x3xi5>, tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -798,7 +798,7 @@ TEST(End2EndJit_FHELinalg, sub_int_eint_matrix_line_missing_dim) { TEST(End2EndJit_FHELinalg, sub_eint_int_term_to_term) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<4xi5>, %a1: tensor<4x!FHE.eint<4>>) -> tensor<4x!FHE.eint<4>> { + func.func @main(%a0: tensor<4xi5>, %a1: tensor<4x!FHE.eint<4>>) -> tensor<4x!FHE.eint<4>> { %res = "FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<4x!FHE.eint<4>>, tensor<4xi5>) -> tensor<4x!FHE.eint<4>> return %res : tensor<4x!FHE.eint<4>> } @@ -828,7 +828,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_int_term_to_term) { TEST(End2EndJit_FHELinalg, sub_eint_int_term_to_term_broadcast) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<4x1x4xi8>, %a1: tensor<1x4x4x!FHE.eint<7>>) -> tensor<4x4x4x!FHE.eint<7>> { + func.func @main(%a0: tensor<4x1x4xi8>, %a1: tensor<1x4x4x!FHE.eint<7>>) -> tensor<4x4x4x!FHE.eint<7>> { %res = "FHELinalg.sub_eint_int"(%a1, %a0) : (tensor<1x4x4x!FHE.eint<7>>, tensor<4x1x4xi8>) -> tensor<4x4x4x!FHE.eint<7>> return %res : tensor<4x4x4x!FHE.eint<7>> } @@ -874,7 +874,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_int_term_to_term_broadcast) { TEST(End2EndJit_FHELinalg, sub_eint_int_matrix_column) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1xi5>) -> + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> @@ -915,7 +915,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_int_matrix_column) { TEST(End2EndJit_FHELinalg, sub_eint_int_matrix_line) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3xi5>) -> + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> @@ -954,7 +954,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_int_matrix_line) { TEST(End2EndJit_FHELinalg, sub_eint_int_matrix_line_missing_dim) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -996,7 +996,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_int_matrix_line_missing_dim) { TEST(End2EndJit_FHELinalg, sub_eint_term_to_term) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -1029,7 +1029,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_term_to_term) { TEST(End2EndJit_FHELinalg, sub_eint_term_to_term_broadcast) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<4x1x4x!FHE.eint<5>>, %a1: tensor<1x4x4x!FHE.eint<5>>) -> tensor<4x4x4x!FHE.eint<5>> { + func.func @main(%a0: tensor<4x1x4x!FHE.eint<5>>, %a1: tensor<1x4x4x!FHE.eint<5>>) -> tensor<4x4x4x!FHE.eint<5>> { %res = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<4x1x4x!FHE.eint<5>>, tensor<1x4x4x!FHE.eint<5>>) -> tensor<4x4x4x!FHE.eint<5>> return %res : tensor<4x4x4x!FHE.eint<5>> } @@ -1077,7 +1077,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_term_to_term_broadcast) { TEST(End2EndJit_FHELinalg, sub_eint_matrix_column) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x1x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -1117,7 +1117,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_matrix_column) { TEST(End2EndJit_FHELinalg, sub_eint_matrix_line) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<1x3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -1155,7 +1155,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_matrix_line) { TEST(End2EndJit_FHELinalg, sub_eint_matrix_line_missing_dim) { checkedJit(lambda, R"XXX( - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.sub_eint"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x!FHE.eint<4>>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -1193,7 +1193,7 @@ TEST(End2EndJit_FHELinalg, sub_eint_matrix_line_missing_dim) { TEST(End2EndJit_FHELinalg, sub_eint_tensor_dim_equals_1) { checkedJit(lambda, R"XXX( - func @main(%arg0: tensor<3x1x2x!FHE.eint<5>>, %arg1: tensor<3x1x2x!FHE.eint<5>>) -> tensor<3x1x2x!FHE.eint<5>> { + func.func @main(%arg0: tensor<3x1x2x!FHE.eint<5>>, %arg1: tensor<3x1x2x!FHE.eint<5>>) -> tensor<3x1x2x!FHE.eint<5>> { %1 = "FHELinalg.sub_eint"(%arg0, %arg1) : (tensor<3x1x2x!FHE.eint<5>>, tensor<3x1x2x!FHE.eint<5>>) -> tensor<3x1x2x!FHE.eint<5>> return %1 : tensor<3x1x2x!FHE.eint<5>> } @@ -1240,7 +1240,7 @@ TEST(End2EndJit_FHELinalg, mul_eint_int_term_to_term) { checkedJit(lambda, R"XXX( // Returns the term to term multiplication of `%a0` with `%a1` - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -1271,7 +1271,7 @@ TEST(End2EndJit_FHELinalg, mul_eint_int_term_to_term_broadcast) { checkedJit(lambda, R"XXX( // Returns the term to term multiplication of `%a0` with `%a1`, where dimensions equals to one are stretched. - func @main(%a0: tensor<4x1x4x!FHE.eint<6>>, %a1: tensor<1x4x4xi7>) -> tensor<4x4x4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x1x4x!FHE.eint<6>>, %a1: tensor<1x4x4xi7>) -> tensor<4x4x4x!FHE.eint<6>> { %res = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<4x1x4x!FHE.eint<6>>, tensor<1x4x4xi7>) -> tensor<4x4x4x!FHE.eint<6>> return %res : tensor<4x4x4x!FHE.eint<6>> } @@ -1325,7 +1325,7 @@ TEST(End2EndJit_FHELinalg, mul_eint_int_matrix_column) { // [7,8,9] [3] [21,24,27] // // The dimension #1 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3x1xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -1372,7 +1372,7 @@ TEST(End2EndJit_FHELinalg, mul_eint_int_matrix_line) { // [7,8,9] [8,10,12] // // The dimension #2 of operand #2 is stretched as it is equals to 1. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<1x3xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -1411,7 +1411,7 @@ TEST(End2EndJit_FHELinalg, mul_eint_int_matrix_line_missing_dim) { checkedJit(lambda, R"XXX( // Same behavior than the previous one, but as the dimension #2 of operand #2 is missing. - func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> { + func.func @main(%a0: tensor<3x3x!FHE.eint<4>>, %a1: tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> { %res = "FHELinalg.mul_eint_int"(%a0, %a1) : (tensor<3x3x!FHE.eint<4>>, tensor<3xi5>) -> tensor<3x3x!FHE.eint<4>> return %res : tensor<3x3x!FHE.eint<4>> } @@ -1458,7 +1458,7 @@ TEST(End2EndJit_FHELinalg, apply_lookup_table) { // [0,1,2] [1,3,5] // [3,0,1] lut [1,3,5,7] = [7,1,3] // [2,3,0] [5,7,1] - func @main(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<3>> { + func.func @main(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<3>> { %lut = arith.constant dense<[1,3,5,7]> : tensor<4xi64> %res = "FHELinalg.apply_lookup_table"(%t, %lut) : (tensor<3x3x!FHE.eint<2>>, tensor<4xi64>) -> tensor<3x3x!FHE.eint<3>> return %res : tensor<3x3x!FHE.eint<3>> @@ -1502,7 +1502,7 @@ TEST(End2EndJit_FHELinalg, apply_multi_lookup_table) { checkedJit(lambda, R"XXX( // Returns the lookup of 3x3 matrix of encrypted indices of width 2 on a 3x3 matrix of tables of size 4=2² of clear integers. - func @main(%arg0: tensor<3x3x!FHE.eint<2>>, %arg1: tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<2>> { + func.func @main(%arg0: tensor<3x3x!FHE.eint<2>>, %arg1: tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<2>> { %1 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<3x3x!FHE.eint<2>>, tensor<3x3x4xi64>) -> tensor<3x3x!FHE.eint<2>> return %1: tensor<3x3x!FHE.eint<2>> } @@ -1551,7 +1551,7 @@ TEST(End2EndJit_FHELinalg, apply_multi_lookup_table_with_boradcast) { checkedJit(lambda, R"XXX( // Returns the lookup of 3x3 matrix of encrypted indices of width 2 on a vector of 3 tables of size 4=2² of clear integers. - func @main(%arg0: tensor<3x3x!FHE.eint<2>>, %arg1: tensor<3x4xi64>) -> tensor<3x3x!FHE.eint<2>> { + func.func @main(%arg0: tensor<3x3x!FHE.eint<2>>, %arg1: tensor<3x4xi64>) -> tensor<3x3x!FHE.eint<2>> { %1 = "FHELinalg.apply_multi_lookup_table"(%arg0, %arg1): (tensor<3x3x!FHE.eint<2>>, tensor<3x4xi64>) -> tensor<3x3x!FHE.eint<2>> return %1: tensor<3x3x!FHE.eint<2>> } @@ -1603,7 +1603,7 @@ TEST(End2EndJit_FHELinalg, apply_mapped_lookup_table_sequential) { checkedJit(lambda, R"XXX( // Returns the lookup of 3x3 matrix of encrypted indices of width 2 of a 3x3 matrix of tables of size 4=2² of clear integers. - func @main(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<9x4xi64>, %map: tensor<3x3xindex>) -> tensor<3x3x!FHE.eint<2>> { + func.func @main(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<9x4xi64>, %map: tensor<3x3xindex>) -> tensor<3x3x!FHE.eint<2>> { %1 = "FHELinalg.apply_mapped_lookup_table"(%t, %luts, %map) : (tensor<3x3x!FHE.eint<2>>, tensor<9x4xi64>, tensor<3x3xindex>) -> tensor<3x3x!FHE.eint<2>> return %1: tensor<3x3x!FHE.eint<2>> @@ -1651,7 +1651,7 @@ TEST(End2EndJit_FHELinalg, apply_mapped_lookup_table_same_lut) { checkedJit(lambda, R"XXX( // Returns the lookup of 3x3 matrix of encrypted indices of width 2 of a 3x3 matrix of tables of size 4=2² of clear integers. - func @main(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<9x4xi64>, %map: tensor<3x3xindex>) -> tensor<3x3x!FHE.eint<2>> { + func.func @main(%t: tensor<3x3x!FHE.eint<2>>, %luts: tensor<9x4xi64>, %map: tensor<3x3xindex>) -> tensor<3x3x!FHE.eint<2>> { %1 = "FHELinalg.apply_mapped_lookup_table"(%t, %luts, %map) : (tensor<3x3x!FHE.eint<2>>, tensor<9x4xi64>, tensor<3x3xindex>) -> tensor<3x3x!FHE.eint<2>> return %1: tensor<3x3x!FHE.eint<2>> @@ -1701,7 +1701,7 @@ TEST(End2EndJit_FHELinalg, apply_mapped_lookup_table_same_lut) { TEST(CompileAndRunTensorEncrypted, dot_eint_int_7) { checkedJit(lambda, R"XXX( -func @main(%arg0: tensor<4x!FHE.eint<7>>, +func.func @main(%arg0: tensor<4x!FHE.eint<7>>, %arg1: tensor<4xi8>) -> !FHE.eint<7> { %ret = "FHELinalg.dot_eint_int"(%arg0, %arg1) : @@ -1730,7 +1730,7 @@ TEST(End2EndJit_FHELinalg, neg_eint) { // ([0,1,2]) [0,7,6] // negate ([3,4,5]) = [5,4,3] // ([6,7,0]) [2,1,0] - func @main(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<2>> { + func.func @main(%t: tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<2>> { %res = "FHELinalg.neg_eint"(%t) : (tensor<3x3x!FHE.eint<2>>) -> tensor<3x3x!FHE.eint<2>> return %res : tensor<3x3x!FHE.eint<2>> } @@ -1774,7 +1774,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_2d_2d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { %y = arith.constant dense< [ @@ -1832,7 +1832,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_1d_2d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x!FHE.eint<7>>) -> tensor<2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>) -> tensor<2x!FHE.eint<7>> { %y = arith.constant dense< [ @@ -1877,7 +1877,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_1d_3d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x!FHE.eint<7>>) -> tensor<4x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>) -> tensor<4x2x!FHE.eint<7>> { %y = arith.constant dense< [ @@ -1948,7 +1948,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_2d_1d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { %y = arith.constant dense< [1, 2, 3, 4] @@ -1997,7 +1997,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_3d_1d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x!FHE.eint<7>> { %y = arith.constant dense< [1, 2, 3, 4] @@ -2056,7 +2056,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_3d_3d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x2x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x4x!FHE.eint<7>>) -> tensor<2x3x2x!FHE.eint<7>> { %y = arith.constant dense< [ @@ -2139,7 +2139,7 @@ TEST(End2EndJit_FHELinalg, matmul_eint_int_4d_3d) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x1x3x4x!FHE.eint<7>>) -> tensor<2x5x3x2x!FHE.eint<7>> { +func.func @main(%x: tensor<2x1x3x4x!FHE.eint<7>>) -> tensor<2x5x3x2x!FHE.eint<7>> { %y = arith.constant dense< [ @@ -2301,7 +2301,7 @@ TEST(End2EndJit_FHELinalg, matmul_int_eint) { // [1,2] [ 5, 8,11] // [3,4] = [11,18,25] // [5,6] [17,28,39] - func @main(%a: tensor<3x2xi7>, %b: tensor<2x3x!FHE.eint<6>>) -> tensor<3x3x!FHE.eint<6>> { + func.func @main(%a: tensor<3x2xi7>, %b: tensor<2x3x!FHE.eint<6>>) -> tensor<3x3x!FHE.eint<6>> { %0 = "FHELinalg.matmul_int_eint"(%a, %b) : (tensor<3x2xi7>, tensor<2x3x!FHE.eint<6>>) -> tensor<3x3x!FHE.eint<6>> return %0 : tensor<3x3x!FHE.eint<6>> } @@ -2350,7 +2350,7 @@ TEST(End2EndJit_FHELinalg, matmul_int_eint) { TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel22) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { %0 = "FHELinalg.conv2d"(%input, %weight){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> } : (tensor<1x1x4x4x!FHE.eint<6>>, tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> @@ -2397,7 +2397,7 @@ TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel22) { TEST(End2EndJit_FHELinalg, conv2d_simple_input44_const_kernel22) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>) -> tensor<1x1x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>) -> tensor<1x1x2x2x!FHE.eint<6>> { %weight = arith.constant dense<[[[[1, 2], [2, 1]]]]> : tensor<1x1x2x2xi7> %0 = "FHELinalg.conv2d"(%input, %weight){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> @@ -2438,7 +2438,7 @@ TEST(End2EndJit_FHELinalg, conv2d_simple_input44_const_kernel22) { TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel22_const_bias) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { %bias = arith.constant dense<[1]> : tensor<1xi7> %0 = "FHELinalg.conv2d"(%input, %weight, %bias){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> @@ -2486,7 +2486,7 @@ TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel22_const_bias) { TEST(End2EndJit_FHELinalg, conv2d_batched_input44_kernel22) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<3x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<3x1x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<3x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<3x1x2x2x!FHE.eint<6>> { %0 = "FHELinalg.conv2d"(%input, %weight){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> } : (tensor<3x1x4x4x!FHE.eint<6>>, tensor<1x1x2x2xi7>) -> tensor<3x1x2x2x!FHE.eint<6>> @@ -2556,7 +2556,7 @@ TEST(End2EndJit_FHELinalg, conv2d_batched_input44_kernel22) { TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel2122) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<2x1x2x2xi7>) -> tensor<1x2x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<2x1x2x2xi7>) -> tensor<1x2x2x2x!FHE.eint<6>> { %0 = "FHELinalg.conv2d"(%input, %weight){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> } : (tensor<1x1x4x4x!FHE.eint<6>>, tensor<2x1x2x2xi7>) -> tensor<1x2x2x2x!FHE.eint<6>> @@ -2616,7 +2616,7 @@ TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel2122) { TEST(End2EndJit_FHELinalg, conv2d_simple_input1244_kernel1222) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<1x2x4x4x!FHE.eint<6>>, %weight: tensor<1x2x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<1x2x4x4x!FHE.eint<6>>, %weight: tensor<1x2x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { %0 = "FHELinalg.conv2d"(%input, %weight){ strides = dense<[2,2]> : tensor<2xi64>, dilations = dense<[1,1]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> } : (tensor<1x2x4x4x!FHE.eint<6>>, tensor<1x2x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> @@ -2675,7 +2675,7 @@ TEST(End2EndJit_FHELinalg, conv2d_simple_input1244_kernel1222) { TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel22_dilation2) { checkedJit(lambda, R"XXX( - func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { + func.func @main(%input: tensor<1x1x4x4x!FHE.eint<6>>, %weight: tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> { %0 = "FHELinalg.conv2d"(%input, %weight){ strides = dense<[1,1]> : tensor<2xi64>, dilations = dense<[2,2]> : tensor<2xi64>, padding = dense<[0,0,0,0]> : tensor<4xi64> } : (tensor<1x1x4x4x!FHE.eint<6>>, tensor<1x1x2x2xi7>) -> tensor<1x1x2x2x!FHE.eint<6>> @@ -2726,7 +2726,7 @@ TEST(End2EndJit_FHELinalg, conv2d_simple_input44_kernel22_dilation2) { TEST(End2EndJit_Linalg, tensor_collapse_shape) { checkedJit(lambda, R"XXX( -func @main(%a: tensor<2x2x4x!FHE.eint<6>>) -> tensor<2x8x!FHE.eint<6>> { +func.func @main(%a: tensor<2x2x4x!FHE.eint<6>>) -> tensor<2x8x!FHE.eint<6>> { %0 = tensor.collapse_shape %a [[0],[1,2]] : tensor<2x2x4x!FHE.eint<6>> into tensor<2x8x!FHE.eint<6>> return %0 : tensor<2x8x!FHE.eint<6>> } @@ -2776,7 +2776,7 @@ func @main(%a: tensor<2x2x4x!FHE.eint<6>>) -> tensor<2x8x!FHE.eint<6>> { TEST(End2EndJit_Linalg, tensor_expand_shape) { checkedJit(lambda, R"XXX( -func @main(%a: tensor<2x8x!FHE.eint<6>>) -> tensor<2x2x4x!FHE.eint<6>> { +func.func @main(%a: tensor<2x8x!FHE.eint<6>>) -> tensor<2x2x4x!FHE.eint<6>> { %0 = tensor.expand_shape %a [[0],[1,2]] : tensor<2x8x!FHE.eint<6>> into tensor<2x2x4x!FHE.eint<6>> return %0 : tensor<2x2x4x!FHE.eint<6>> } @@ -2832,7 +2832,7 @@ TEST(End2EndJit_FHELinalg, sum_empty) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) : (tensor<0x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -2856,7 +2856,7 @@ TEST(End2EndJit_FHELinalg, sum_1D_no_axes) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -2881,7 +2881,7 @@ TEST(End2EndJit_FHELinalg, sum_1D_axes_0) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) { axes = [0] } : (tensor<4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -2906,7 +2906,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_no_axes) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -2935,7 +2935,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_axes_0) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0] } : (tensor<3x4x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> } @@ -2976,7 +2976,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_axes_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [1] } : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> return %0 : tensor<3x!FHE.eint<7>> } @@ -3017,7 +3017,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_axes_0_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) { axes = [0, 1] } : (tensor<3x4x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -3046,7 +3046,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_no_axes) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -3090,7 +3090,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_0) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x2x!FHE.eint<7>> return %0 : tensor<4x2x!FHE.eint<7>> } @@ -3155,7 +3155,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [1] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> return %0 : tensor<3x2x!FHE.eint<7>> } @@ -3219,7 +3219,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [2] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x4x!FHE.eint<7>> return %0 : tensor<3x4x!FHE.eint<7>> } @@ -3283,7 +3283,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_0_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0, 1] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<2x!FHE.eint<7>> return %0 : tensor<2x!FHE.eint<7>> } @@ -3339,7 +3339,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_1_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [1, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> return %0 : tensor<3x!FHE.eint<7>> } @@ -3395,7 +3395,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_0_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<4x!FHE.eint<7>> return %0 : tensor<4x!FHE.eint<7>> } @@ -3451,7 +3451,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_axes_0_1_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> { %0 = "FHELinalg.sum"(%x) { axes = [0, 1, 2] } : (tensor<3x4x2x!FHE.eint<7>>) -> !FHE.eint<7> return %0 : !FHE.eint<7> } @@ -3495,7 +3495,7 @@ TEST(End2EndJit_FHELinalg, sum_keep_dims_empty) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<0x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%x: tensor<0x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { keep_dims = true } : (tensor<0x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } @@ -3531,7 +3531,7 @@ TEST(End2EndJit_FHELinalg, sum_1D_keep_dims_no_axes) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } @@ -3568,7 +3568,7 @@ TEST(End2EndJit_FHELinalg, sum_1D_keep_dims_axes_0) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%x: tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0], keep_dims = true } : (tensor<4x!FHE.eint<7>>) -> tensor<1x!FHE.eint<7>> return %0 : tensor<1x!FHE.eint<7>> } @@ -3605,7 +3605,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_keep_dims_no_axes) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> return %0 : tensor<1x1x!FHE.eint<7>> } @@ -3650,7 +3650,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_keep_dims_axes_0) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x4x!FHE.eint<7>> return %0 : tensor<1x4x!FHE.eint<7>> } @@ -3697,7 +3697,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_keep_dims_axes_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [1], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<3x1x!FHE.eint<7>> return %0 : tensor<3x1x!FHE.eint<7>> } @@ -3746,7 +3746,7 @@ TEST(End2EndJit_FHELinalg, sum_2D_keep_dims_axes_0_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0, 1], keep_dims = true } : (tensor<3x4x!FHE.eint<7>>) -> tensor<1x1x!FHE.eint<7>> return %0 : tensor<1x1x!FHE.eint<7>> } @@ -3791,7 +3791,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_no_axes) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> return %0 : tensor<1x1x1x!FHE.eint<7>> } @@ -3854,7 +3854,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_0) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x2x!FHE.eint<7>> return %0 : tensor<1x4x2x!FHE.eint<7>> } @@ -3922,7 +3922,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [1], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x2x!FHE.eint<7>> return %0 : tensor<3x1x2x!FHE.eint<7>> } @@ -3989,7 +3989,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x4x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x4x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x4x1x!FHE.eint<7>> return %0 : tensor<3x4x1x!FHE.eint<7>> } @@ -4056,7 +4056,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_0_1) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x2x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x2x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0, 1], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x2x!FHE.eint<7>> return %0 : tensor<1x1x2x!FHE.eint<7>> } @@ -4119,7 +4119,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_1_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [1, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<3x1x1x!FHE.eint<7>> return %0 : tensor<3x1x1x!FHE.eint<7>> } @@ -4182,7 +4182,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_0_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x4x1x!FHE.eint<7>> return %0 : tensor<1x4x1x!FHE.eint<7>> } @@ -4245,7 +4245,7 @@ TEST(End2EndJit_FHELinalg, sum_3D_keep_dims_axes_0_1_2) { checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { +func.func @main(%x: tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> { %0 = "FHELinalg.sum"(%x) { axes = [0, 1, 2], keep_dims = true } : (tensor<3x4x2x!FHE.eint<7>>) -> tensor<1x1x1x!FHE.eint<7>> return %0 : tensor<1x1x1x!FHE.eint<7>> } @@ -4307,7 +4307,7 @@ TEST(End2EndJit_FHELinalg, concat_1D_axis_0) { namespace concretelang = mlir::concretelang; checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { +func.func @main(%x: tensor<3x!FHE.eint<7>>, %y: tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<3x!FHE.eint<7>>, tensor<4x!FHE.eint<7>>) -> tensor<7x!FHE.eint<7>> return %0 : tensor<7x!FHE.eint<7>> } @@ -4349,7 +4349,7 @@ TEST(End2EndJit_FHELinalg, concat_2D_axis_0) { namespace concretelang = mlir::concretelang; checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x3x!FHE.eint<7>>, %y: tensor<3x3x!FHE.eint<7>>) -> tensor<5x3x!FHE.eint<7>> { +func.func @main(%x: tensor<2x3x!FHE.eint<7>>, %y: tensor<3x3x!FHE.eint<7>>) -> tensor<5x3x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<2x3x!FHE.eint<7>>, tensor<3x3x!FHE.eint<7>>) -> tensor<5x3x!FHE.eint<7>> return %0 : tensor<5x3x!FHE.eint<7>> } @@ -4404,7 +4404,7 @@ TEST(End2EndJit_FHELinalg, concat_2D_axis_1) { namespace concretelang = mlir::concretelang; checkedJit(lambda, R"XXX( -func @main(%x: tensor<3x2x!FHE.eint<7>>, %y: tensor<3x3x!FHE.eint<7>>) -> tensor<3x5x!FHE.eint<7>> { +func.func @main(%x: tensor<3x2x!FHE.eint<7>>, %y: tensor<3x3x!FHE.eint<7>>) -> tensor<3x5x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<3x2x!FHE.eint<7>>, tensor<3x3x!FHE.eint<7>>) -> tensor<3x5x!FHE.eint<7>> return %0 : tensor<3x5x!FHE.eint<7>> } @@ -4462,7 +4462,7 @@ TEST(End2EndJit_FHELinalg, concat_3D_axis_0) { namespace concretelang = mlir::concretelang; checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x4x3x!FHE.eint<7>>, %y: tensor<2x4x3x!FHE.eint<7>>) -> tensor<4x4x3x!FHE.eint<7>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<7>>, %y: tensor<2x4x3x!FHE.eint<7>>) -> tensor<4x4x3x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 0 } : (tensor<2x4x3x!FHE.eint<7>>, tensor<2x4x3x!FHE.eint<7>>) -> tensor<4x4x3x!FHE.eint<7>> return %0 : tensor<4x4x3x!FHE.eint<7>> } @@ -4562,7 +4562,7 @@ TEST(End2EndJit_FHELinalg, concat_3D_axis_1) { namespace concretelang = mlir::concretelang; checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x4x3x!FHE.eint<7>>, %y: tensor<2x4x3x!FHE.eint<7>>) -> tensor<2x8x3x!FHE.eint<7>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<7>>, %y: tensor<2x4x3x!FHE.eint<7>>) -> tensor<2x8x3x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 1 } : (tensor<2x4x3x!FHE.eint<7>>, tensor<2x4x3x!FHE.eint<7>>) -> tensor<2x8x3x!FHE.eint<7>> return %0 : tensor<2x8x3x!FHE.eint<7>> } @@ -4658,7 +4658,7 @@ TEST(End2EndJit_FHELinalg, concat_3D_axis_2) { namespace concretelang = mlir::concretelang; checkedJit(lambda, R"XXX( -func @main(%x: tensor<2x4x3x!FHE.eint<7>>, %y: tensor<2x4x3x!FHE.eint<7>>) -> tensor<2x4x6x!FHE.eint<7>> { +func.func @main(%x: tensor<2x4x3x!FHE.eint<7>>, %y: tensor<2x4x3x!FHE.eint<7>>) -> tensor<2x4x6x!FHE.eint<7>> { %0 = "FHELinalg.concat"(%x, %y) { axis = 2 } : (tensor<2x4x3x!FHE.eint<7>>, tensor<2x4x3x!FHE.eint<7>>) -> tensor<2x4x6x!FHE.eint<7>> return %0 : tensor<2x4x6x!FHE.eint<7>> } @@ -4750,7 +4750,8 @@ TEST_P(TiledMatMulParametric, tiled_matmul_eint_int) { std::ostringstream mlirProgram; mlirProgram - << "func @main(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) ->\n" + << "func.func @main(%a: tensor<8x4x!FHE.eint<6>>, %b: tensor<4x2xi7>) " + "->\n" << " tensor<8x2x!FHE.eint<6>> {\n" << " %0 = \"FHELinalg.matmul_eint_int\"(%a, %b) { \"tile-sizes\" = " << "[" << tiling[0] << ", " << tiling[1] << ", " << tiling[2] << "]" diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_lambda.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_lambda.cc index 23e8c44b6..e463539d6 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_lambda.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_lambda.cc @@ -4,7 +4,7 @@ TEST(Lambda_check_param, int_to_void_missing_param) { checkedJit(lambda, R"XXX( - func @main(%arg0: !FHE.eint<1>) { + func.func @main(%arg0: !FHE.eint<1>) { return } )XXX"); @@ -14,7 +14,7 @@ TEST(Lambda_check_param, int_to_void_missing_param) { TEST(Lambda_check_param, DISABLED_int_to_void_good) { // DISABLED Note: it segfaults checkedJit(lambda, R"XXX( - func @main(%arg0: !FHE.eint<1>) { + func.func @main(%arg0: !FHE.eint<1>) { return } )XXX"); @@ -23,7 +23,7 @@ TEST(Lambda_check_param, DISABLED_int_to_void_good) { TEST(Lambda_check_param, int_to_void_superfluous_param) { checkedJit(lambda, R"XXX( - func @main(%arg0: !FHE.eint<1>) { + func.func @main(%arg0: !FHE.eint<1>) { return } )XXX"); @@ -32,7 +32,7 @@ TEST(Lambda_check_param, int_to_void_superfluous_param) { TEST(Lambda_check_param, scalar_parameters_number) { checkedJit(lambda, R"XXX( - func @main( + func.func @main( %arg0: !FHE.eint<1>, %arg1: !FHE.eint<1>, %arg2: !FHE.eint<1>) -> !FHE.eint<1> { @@ -48,7 +48,7 @@ TEST(Lambda_check_param, scalar_parameters_number) { TEST(Lambda_check_param, scalar_tensor_to_scalar_missing_param) { checkedJit(lambda, R"XXX( - func @main( + func.func @main( %arg0: !FHE.eint<1>, %arg1: tensor<2x!FHE.eint<1>>) -> !FHE.eint<1> { return %arg0: !FHE.eint<1> @@ -59,7 +59,7 @@ TEST(Lambda_check_param, scalar_tensor_to_scalar_missing_param) { TEST(Lambda_check_param, scalar_tensor_to_scalar) { checkedJit(lambda, R"XXX( - func @main( + func.func @main( %arg0: !FHE.eint<1>, %arg1: tensor<2x!FHE.eint<1>>) -> !FHE.eint<1> { return %arg0: !FHE.eint<1> @@ -71,7 +71,7 @@ TEST(Lambda_check_param, scalar_tensor_to_scalar) { TEST(Lambda_check_param, scalar_tensor_to_scalar_superfluous_param) { checkedJit(lambda, R"XXX( - func @main( + func.func @main( %arg0: !FHE.eint<1>, %arg1: tensor<2x!FHE.eint<1>>) -> !FHE.eint<1> { return %arg0: !FHE.eint<1> @@ -84,7 +84,7 @@ TEST(Lambda_check_param, scalar_tensor_to_scalar_superfluous_param) { TEST(Lambda_check_param, scalar_tensor_to_tensor_good_number_param) { checkedJit(lambda, R"XXX( - func @main( + func.func @main( %arg0: !FHE.eint<1>, %arg1: tensor<2x!FHE.eint<1>>) -> tensor<2x!FHE.eint<1>> { return %arg1: tensor<2x!FHE.eint<1>> @@ -98,7 +98,7 @@ TEST(Lambda_check_param, scalar_tensor_to_tensor_good_number_param) { TEST(Lambda_check_param, DISABLED_check_parameters_scalar_too_big) { // DISABLED Note: loss of precision without any warning or error. checkedJit(lambda, R"XXX( - func @main(%arg0: !FHE.eint<1>) -> !FHE.eint<1> + func.func @main(%arg0: !FHE.eint<1>) -> !FHE.eint<1> { return %arg0: !FHE.eint<1> } diff --git a/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc b/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc index 45cb6162d..ffaa21622 100644 --- a/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc +++ b/compiler/tests/end_to_end_tests/end_to_end_jit_test.cc @@ -7,7 +7,7 @@ TEST(CompileAndRunClear, add_u64) { checkedJit(lambda, R"XXX( -func @main(%arg0: i64, %arg1: i64) -> i64 { +func.func @main(%arg0: i64, %arg1: i64) -> i64 { %1 = arith.addi %arg0, %arg1 : i64 return %1: i64 } @@ -21,7 +21,7 @@ func @main(%arg0: i64, %arg1: i64) -> i64 { TEST(CompileAndRunTensorEncrypted, extract_5) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10x!FHE.eint<5>>, %i: index) -> !FHE.eint<5>{ +func.func @main(%t: tensor<10x!FHE.eint<5>>, %i: index) -> !FHE.eint<5>{ %c = tensor.extract %t[%i] : tensor<10x!FHE.eint<5>> return %c : !FHE.eint<5> } @@ -35,7 +35,7 @@ func @main(%t: tensor<10x!FHE.eint<5>>, %i: index) -> !FHE.eint<5>{ TEST(CompileAndRunTensorEncrypted, extract_twice_and_add_5) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10x!FHE.eint<5>>, %i: index, %j: index) -> +func.func @main(%t: tensor<10x!FHE.eint<5>>, %i: index, %j: index) -> !FHE.eint<5>{ %ti = tensor.extract %t[%i] : tensor<10x!FHE.eint<5>> %tj = tensor.extract %t[%j] : tensor<10x!FHE.eint<5>> @@ -54,7 +54,7 @@ func @main(%t: tensor<10x!FHE.eint<5>>, %i: index, %j: index) -> TEST(CompileAndRunTensorEncrypted, dim_5) { checkedJit(lambda, R"XXX( -func @main(%t: tensor<10x!FHE.eint<5>>) -> index{ +func.func @main(%t: tensor<10x!FHE.eint<5>>) -> index{ %c0 = arith.constant 0 : index %c = tensor.dim %t, %c0 : tensor<10x!FHE.eint<5>> return %c : index @@ -67,7 +67,7 @@ func @main(%t: tensor<10x!FHE.eint<5>>) -> index{ TEST(CompileAndRunTensorEncrypted, from_elements_5) { checkedJit(lambda, R"XXX( -func @main(%0: !FHE.eint<5>) -> tensor<1x!FHE.eint<5>> { +func.func @main(%0: !FHE.eint<5>) -> tensor<1x!FHE.eint<5>> { %t = tensor.from_elements %0 : tensor<1x!FHE.eint<5>> return %t: tensor<1x!FHE.eint<5>> } @@ -83,7 +83,7 @@ func @main(%0: !FHE.eint<5>) -> tensor<1x!FHE.eint<5>> { TEST(CompileAndRunTensorEncrypted, from_elements_multiple_values) { checkedJit(lambda, R"XXX( -func @main(%0: !FHE.eint<5>, %1: !FHE.eint<5>, %2: !FHE.eint<5>) -> tensor<3x!FHE.eint<5>> { +func.func @main(%0: !FHE.eint<5>, %1: !FHE.eint<5>, %2: !FHE.eint<5>) -> tensor<3x!FHE.eint<5>> { %t = tensor.from_elements %0, %1, %2 : tensor<3x!FHE.eint<5>> return %t: tensor<3x!FHE.eint<5>> } @@ -101,7 +101,7 @@ func @main(%0: !FHE.eint<5>, %1: !FHE.eint<5>, %2: !FHE.eint<5>) -> tensor<3x!FH TEST(CompileAndRunTensorEncrypted, from_elements_many_values) { checkedJit(lambda, R"XXX( -func @main(%0: !FHE.eint<5>, +func.func @main(%0: !FHE.eint<5>, %1: !FHE.eint<5>, %2: !FHE.eint<5>, %3: !FHE.eint<5>, @@ -254,7 +254,7 @@ func @main(%0: !FHE.eint<5>, // `LambdaArgument` instances as arguments and as a result type TEST(CompileAndRunTensorEncrypted, from_elements_5_lambda_argument_res) { checkedJit(lambda, R"XXX( -func @main(%0: !FHE.eint<5>) -> tensor<1x!FHE.eint<5>> { +func.func @main(%0: !FHE.eint<5>) -> tensor<1x!FHE.eint<5>> { %t = tensor.from_elements %0 : tensor<1x!FHE.eint<5>> return %t: tensor<1x!FHE.eint<5>> } @@ -285,7 +285,7 @@ func @main(%0: !FHE.eint<5>) -> tensor<1x!FHE.eint<5>> { TEST(CompileAndRunTensorEncrypted, in_out_tensor_with_op_5) { checkedJit(lambda, R"XXX( -func @main(%in: tensor<2x!FHE.eint<5>>) -> tensor<3x!FHE.eint<5>> { +func.func @main(%in: tensor<2x!FHE.eint<5>>) -> tensor<3x!FHE.eint<5>> { %c_0 = arith.constant 0 : index %c_1 = arith.constant 1 : index %a = tensor.extract %in[%c_0] : tensor<2x!FHE.eint<5>> @@ -318,7 +318,7 @@ TEST(CompileAndRunTensorEncrypted, DISABLED_linalg_generic) { checkedJit(lambda, R"XXX( #map0 = affine_map<(d0) -> (d0)> #map1 = affine_map<(d0) -> (0)> -func @main(%arg0: tensor<2x!FHE.eint<7>>, %arg1: tensor<2xi8>, %acc: +func.func @main(%arg0: tensor<2x!FHE.eint<7>>, %arg1: tensor<2xi8>, %acc: !FHE.eint<7>) -> !FHE.eint<7> { %tacc = tensor.from_elements %acc : tensor<1x!FHE.eint<7>> %2 = linalg.generic {indexing_maps = [#map0, #map0, #map1], iterator_types diff --git a/compiler/tests/python/test_client_server.py b/compiler/tests/python/test_client_server.py index 1e81b6fb0..11c671455 100644 --- a/compiler/tests/python/test_client_server.py +++ b/compiler/tests/python/test_client_server.py @@ -18,7 +18,7 @@ from concrete.compiler import ( pytest.param( """ -func @main(%arg0: !FHE.eint<5>, %arg1: i6) -> !FHE.eint<5> { +func.func @main(%arg0: !FHE.eint<5>, %arg1: i6) -> !FHE.eint<5> { %1 = "FHE.add_eint_int"(%arg0, %arg1): (!FHE.eint<5>, i6) -> (!FHE.eint<5>) return %1: !FHE.eint<5> } @@ -32,7 +32,7 @@ func @main(%arg0: !FHE.eint<5>, %arg1: i6) -> !FHE.eint<5> { pytest.param( """ -func @main(%arg0: !FHE.eint<5>, %arg1: !FHE.eint<5>) -> !FHE.eint<5> { +func.func @main(%arg0: !FHE.eint<5>, %arg1: !FHE.eint<5>) -> !FHE.eint<5> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<5>, !FHE.eint<5>) -> (!FHE.eint<5>) return %1: !FHE.eint<5> } @@ -45,7 +45,7 @@ func @main(%arg0: !FHE.eint<5>, %arg1: !FHE.eint<5>) -> !FHE.eint<5> { pytest.param( """ -func @main(%arg0: tensor<4x!FHE.eint<5>>, %arg1: tensor<4xi6>) -> !FHE.eint<5> { +func.func @main(%arg0: tensor<4x!FHE.eint<5>>, %arg1: tensor<4xi6>) -> !FHE.eint<5> { %ret = "FHELinalg.dot_eint_int"(%arg0, %arg1) : (tensor<4x!FHE.eint<5>>, tensor<4xi6>) -> !FHE.eint<5> return %ret : !FHE.eint<5> } @@ -62,7 +62,7 @@ func @main(%arg0: tensor<4x!FHE.eint<5>>, %arg1: tensor<4xi6>) -> !FHE.eint<5> { pytest.param( """ -func @main(%a0: tensor<4x!FHE.eint<5>>, %a1: tensor<4x!FHE.eint<5>>) -> tensor<4x!FHE.eint<5>> { +func.func @main(%a0: tensor<4x!FHE.eint<5>>, %a1: tensor<4x!FHE.eint<5>>) -> tensor<4x!FHE.eint<5>> { %res = "FHELinalg.add_eint"(%a0, %a1) : (tensor<4x!FHE.eint<5>>, tensor<4x!FHE.eint<5>>) -> tensor<4x!FHE.eint<5>> return %res : tensor<4x!FHE.eint<5>> } diff --git a/compiler/tests/python/test_compilation.py b/compiler/tests/python/test_compilation.py index 833afcdf4..47047ce8b 100644 --- a/compiler/tests/python/test_compilation.py +++ b/compiler/tests/python/test_compilation.py @@ -59,7 +59,7 @@ def compile_run_assert( end_to_end_fixture = [ pytest.param( """ - func @main(%arg0: !FHE.eint<7>, %arg1: i8) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>, %arg1: i8) -> !FHE.eint<7> { %1 = "FHE.add_eint_int"(%arg0, %arg1): (!FHE.eint<7>, i8) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -70,7 +70,7 @@ end_to_end_fixture = [ ), pytest.param( """ - func @main(%arg0: !FHE.eint<7>, %arg1: i8) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>, %arg1: i8) -> !FHE.eint<7> { %1 = "FHE.add_eint_int"(%arg0, %arg1): (!FHE.eint<7>, i8) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -81,7 +81,7 @@ end_to_end_fixture = [ ), pytest.param( """ - func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]> : tensor<128xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<7>, tensor<128xi64>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> @@ -93,7 +93,7 @@ end_to_end_fixture = [ ), pytest.param( """ - func @main(%arg0: tensor<4x!FHE.eint<7>>, %arg1: tensor<4xi8>) -> !FHE.eint<7> + func.func @main(%arg0: tensor<4x!FHE.eint<7>>, %arg1: tensor<4xi8>) -> !FHE.eint<7> { %ret = "FHELinalg.dot_eint_int"(%arg0, %arg1) : (tensor<4x!FHE.eint<7>>, tensor<4xi8>) -> !FHE.eint<7> @@ -109,7 +109,7 @@ end_to_end_fixture = [ ), pytest.param( """ - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -126,7 +126,7 @@ end_to_end_fixture = [ end_to_end_parallel_fixture = [ pytest.param( """ - func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x4x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { + func.func @main(%x: tensor<3x4x!FHE.eint<7>>, %y: tensor<3x4x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { %c = arith.constant dense<[[1, 2], [3, 4], [5, 0], [1, 2]]> : tensor<4x2xi8> %0 = "FHELinalg.matmul_eint_int"(%x, %c): (tensor<3x4x!FHE.eint<7>>, tensor<4x2xi8>) -> tensor<3x2x!FHE.eint<7>> %1 = "FHELinalg.matmul_eint_int"(%y, %c): (tensor<3x4x!FHE.eint<7>>, tensor<4x2xi8>) -> tensor<3x2x!FHE.eint<7>> @@ -143,7 +143,7 @@ end_to_end_parallel_fixture = [ ), pytest.param( """ - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>, %a2: tensor<4x!FHE.eint<6>>, %a3: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>, %a2: tensor<4x!FHE.eint<6>>, %a3: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> %2 = "FHELinalg.add_eint_int"(%a2, %a3) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> %res = "FHELinalg.add_eint"(%1, %2) : (tensor<4x!FHE.eint<6>>, tensor<4x!FHE.eint<6>>) -> tensor<4x!FHE.eint<6>> @@ -191,7 +191,7 @@ def test_lib_compile_reload_and_run(mlir_input, args, expected_result, keyset_ca def test_lib_compilation_artifacts(): mlir_str = """ - func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { + func.func @main(%a0: tensor<4x!FHE.eint<6>>, %a1: tensor<4xi7>) -> tensor<4x!FHE.eint<6>> { %res = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<6>>, tensor<4xi7>) -> tensor<4x!FHE.eint<6>> return %res : tensor<4x!FHE.eint<6>> } @@ -208,7 +208,7 @@ def test_lib_compilation_artifacts(): def test_lib_compile_and_run_p_error(keyset_cache): mlir_input = """ - func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]> : tensor<128xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<7>, tensor<128xi64>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> @@ -269,7 +269,7 @@ def test_compile_dataflow_and_fail_run( [ pytest.param( """ - func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { + func.func @main(%x: tensor<3x4x!FHE.eint<7>>) -> tensor<3x2x!FHE.eint<7>> { %y = arith.constant dense<[[1, 2], [3, 4], [5, 0], [1, 2]]> : tensor<4x2xi8> %0 = "FHELinalg.matmul_eint_int"(%x, %y): (tensor<3x4x!FHE.eint<7>>, tensor<4x2xi8>) -> tensor<3x2x!FHE.eint<7>> return %0 : tensor<3x2x!FHE.eint<7>> @@ -304,7 +304,7 @@ def test_compile_and_run_loop_parallelize( [ pytest.param( """ - func @main(%arg0: !FHE.eint<7>, %arg1: i8) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>, %arg1: i8) -> !FHE.eint<7> { %1 = "FHE.add_eint_int"(%arg0, %arg1): (!FHE.eint<7>, i8) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -336,7 +336,7 @@ def test_compile_and_run_invalid_arg_number( [ pytest.param( """ - func @test(%arg0: tensor<4x!FHE.eint<7>>, %arg1: tensor<4xi8>) -> !FHE.eint<7> + func.func @test(%arg0: tensor<4x!FHE.eint<7>>, %arg1: tensor<4xi8>) -> !FHE.eint<7> { %ret = "FHELinalg.dot_eint_int"(%arg0, %arg1) : (tensor<4x!FHE.eint<7>>, tensor<4xi8>) -> !FHE.eint<7> diff --git a/compiler/tests/python/test_round_trip.py b/compiler/tests/python/test_round_trip.py index d9e534006..e0e52697d 100644 --- a/compiler/tests/python/test_round_trip.py +++ b/compiler/tests/python/test_round_trip.py @@ -5,7 +5,7 @@ from concrete import compiler VALID_INPUTS = [ pytest.param( """ - func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { + func.func @add_eint_int(%arg0: !FHE.eint<2>) -> !FHE.eint<2> { %0 = arith.constant 1 : i3 %1 = "FHE.add_eint_int"(%arg0, %0): (!FHE.eint<2>, i3) -> (!FHE.eint<2>) return %1: !FHE.eint<2> @@ -15,7 +15,7 @@ VALID_INPUTS = [ ), pytest.param( """ - func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> { + func.func @apply_lookup_table(%arg0: !FHE.eint<2>, %arg1: tensor<4xi64>) -> !FHE.eint<2> { %1 = "FHE.apply_lookup_table"(%arg0, %arg1): (!FHE.eint<2>, tensor<4xi64>) -> (!FHE.eint<2>) return %1: !FHE.eint<2> } @@ -24,7 +24,7 @@ VALID_INPUTS = [ ), pytest.param( """ - func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, + func.func @dot_eint_int(%arg0: tensor<2x!FHE.eint<2>>, %arg1: tensor<2xi3>) -> !FHE.eint<2> { %1 = "FHELinalg.dot_eint_int"(%arg0, %arg1) : @@ -36,7 +36,7 @@ VALID_INPUTS = [ ), pytest.param( """ - func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { + func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { %tlu = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]> : tensor<128xi64> %1 = "FHE.apply_lookup_table"(%arg0, %tlu): (!FHE.eint<7>, tensor<128xi64>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> @@ -46,7 +46,7 @@ VALID_INPUTS = [ ), pytest.param( """ - func @main(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { + func.func @main(%a0: tensor<4x!FHE.eint<2>>, %a1: tensor<4xi3>) -> tensor<4x!FHE.eint<2>> { %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<4x!FHE.eint<2>>, tensor<4xi3>) -> tensor<4x!FHE.eint<2>> return %1: tensor<4x!FHE.eint<2>> } @@ -59,7 +59,7 @@ INVALID_INPUTS = [ pytest.param("nothing really mlir", id="english sentence"), pytest.param( """ - func @test(%arg0: !FHE.eint<0>) { + func.func @test(%arg0: !FHE.eint<0>) { return } """, @@ -67,7 +67,7 @@ INVALID_INPUTS = [ ), pytest.param( """ - func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> { + func.func @main(%a0: tensor<2x2x3x4x!FHE.eint<2>>, %a1: tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> { // expected-error @+1 {{'FHELinalg.add_eint_int' op has the dimension #2 of the operand #1 incompatible with other operands, got 2 expect 1 or 3}} %1 = "FHELinalg.add_eint_int"(%a0, %a1) : (tensor<2x2x3x4x!FHE.eint<2>>, tensor<2x2x2x4xi3>) -> tensor<2x2x3x4x!FHE.eint<2>> return %1 : tensor<2x2x3x4x!FHE.eint<2>> diff --git a/compiler/tests/stress_tests/README.md b/compiler/tests/stress_tests/README.md index 42d61a5ed..d24cc3258 100644 --- a/compiler/tests/stress_tests/README.md +++ b/compiler/tests/stress_tests/README.md @@ -63,7 +63,7 @@ Files are in json format but can easily be grepped (multi-lines). } # A failed replication when the result is wrong both directly and after truncation ... ], - "code": "\nfunc @main(...) { ... }", + "code": "\nfunc.func @main(...) { ... }", "success_rate": 99.0, "overflow_rate": 100.0 } diff --git a/compiler/tests/stress_tests/test_stress.py b/compiler/tests/stress_tests/test_stress.py index de6f36232..52259dd00 100644 --- a/compiler/tests/stress_tests/test_stress.py +++ b/compiler/tests/stress_tests/test_stress.py @@ -82,7 +82,7 @@ def basic_multisum_identity(bitwidth, size): return ( f""" -func @main({components('v', size, v_ty)}) -> {v_ty} {{ +func.func @main({components('v', size, v_ty)}) -> {v_ty} {{ %v = tensor.from_elements {components('v', size)} : {tv_ty} // Declare {size} %wX components diff --git a/compiler/tests/test_compiler_file_output/return_0.ir b/compiler/tests/test_compiler_file_output/return_0.ir index 32af38a16..292da793d 100644 --- a/compiler/tests/test_compiler_file_output/return_0.ir +++ b/compiler/tests/test_compiler_file_output/return_0.ir @@ -1,5 +1,5 @@ module { - func @test_0() -> i8 { + func.func @test_0() -> i8 { %c0_i8 = arith.constant 0 : i8 return %c0_i8 : i8 } diff --git a/compiler/tests/test_compiler_file_output/return_13.ir b/compiler/tests/test_compiler_file_output/return_13.ir index f3c9efbd5..26dee341d 100644 --- a/compiler/tests/test_compiler_file_output/return_13.ir +++ b/compiler/tests/test_compiler_file_output/return_13.ir @@ -1,5 +1,5 @@ module { - func @test_13() -> i8 { + func.func @test_13() -> i8 { %c13_i8 = arith.constant 13 : i8 return %c13_i8 : i8 } diff --git a/compiler/tests/unit_tests/concretelang/TestLib/testlib_unit_test.cpp b/compiler/tests/unit_tests/concretelang/TestLib/testlib_unit_test.cpp index 267cc74af..81afca2e0 100644 --- a/compiler/tests/unit_tests/concretelang/TestLib/testlib_unit_test.cpp +++ b/compiler/tests/unit_tests/concretelang/TestLib/testlib_unit_test.cpp @@ -67,7 +67,7 @@ template Lambda load(std::string outputLib) { TEST(CompiledModule, call_1s_1s_client_view) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { return %arg0: !FHE.eint<7> } )"; @@ -96,7 +96,7 @@ func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { TEST(CompiledModule, call_1s_1s) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { return %arg0: !FHE.eint<7> } )"; @@ -111,7 +111,7 @@ func @main(%arg0: !FHE.eint<7>) -> !FHE.eint<7> { TEST(CompiledModule, call_2s_1s_choose) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { return %arg0: !FHE.eint<7> } )"; @@ -132,7 +132,7 @@ func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { TEST(CompiledModule, call_2s_1s) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<7>, !FHE.eint<7>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -153,7 +153,7 @@ func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { TEST(CompiledModule, call_1s_1s_bad_call) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { +func.func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { %1 = "FHE.add_eint"(%arg0, %arg1): (!FHE.eint<7>, !FHE.eint<7>) -> (!FHE.eint<7>) return %1: !FHE.eint<7> } @@ -167,7 +167,7 @@ func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> !FHE.eint<7> { TEST(CompiledModule, call_1s_1t) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { +func.func @main(%arg0: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { %1 = tensor.from_elements %arg0 : tensor<1x!FHE.eint<7>> return %1: tensor<1x!FHE.eint<7>> } @@ -185,7 +185,7 @@ func @main(%arg0: !FHE.eint<7>) -> tensor<1x!FHE.eint<7>> { TEST(CompiledModule, call_2s_1t) { std::string source = R"( -func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> tensor<2x!FHE.eint<7>> { +func.func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> tensor<2x!FHE.eint<7>> { %1 = tensor.from_elements %arg0, %arg1 : tensor<2x!FHE.eint<7>> return %1: tensor<2x!FHE.eint<7>> } @@ -205,7 +205,7 @@ func @main(%arg0: !FHE.eint<7>, %arg1: !FHE.eint<7>) -> tensor<2x!FHE.eint<7>> { TEST(CompiledModule, call_1t_1s) { std::string source = R"( -func @main(%arg0: tensor<1x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<1x!FHE.eint<7>>) -> !FHE.eint<7> { %c0 = arith.constant 0 : index %1 = tensor.extract %arg0[%c0] : tensor<1x!FHE.eint<7>> return %1: !FHE.eint<7> @@ -223,7 +223,7 @@ func @main(%arg0: tensor<1x!FHE.eint<7>>) -> !FHE.eint<7> { TEST(CompiledModule, call_1t_1t) { std::string source = R"( -func @main(%arg0: tensor<3x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { +func.func @main(%arg0: tensor<3x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { return %arg0: tensor<3x!FHE.eint<7>> } )"; @@ -241,7 +241,7 @@ func @main(%arg0: tensor<3x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> { TEST(CompiledModule, call_2t_1s) { std::string source = R"( -func @main(%arg0: tensor<3x!FHE.eint<7>>, %arg1: tensor<3x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @main(%arg0: tensor<3x!FHE.eint<7>>, %arg1: tensor<3x!FHE.eint<7>>) -> !FHE.eint<7> { %1 = "FHELinalg.add_eint"(%arg0, %arg1) : (tensor<3x!FHE.eint<7>>, tensor<3x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> %c1 = arith.constant 1 : i8 %2 = tensor.from_elements %c1, %c1, %c1 : tensor<3xi8> @@ -264,7 +264,7 @@ func @main(%arg0: tensor<3x!FHE.eint<7>>, %arg1: tensor<3x!FHE.eint<7>>) -> !FHE TEST(CompiledModule, call_1tr2_1tr2) { std::string source = R"( -func @main(%arg0: tensor<2x3x!FHE.eint<7>>) -> tensor<2x3x!FHE.eint<7>> { +func.func @main(%arg0: tensor<2x3x!FHE.eint<7>>) -> tensor<2x3x!FHE.eint<7>> { return %arg0: tensor<2x3x!FHE.eint<7>> } )"; @@ -285,7 +285,7 @@ func @main(%arg0: tensor<2x3x!FHE.eint<7>>) -> tensor<2x3x!FHE.eint<7>> { TEST(CompiledModule, call_1tr3_1tr3) { std::string source = R"( -func @main(%arg0: tensor<2x3x1x!FHE.eint<7>>) -> tensor<2x3x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<2x3x1x!FHE.eint<7>>) -> tensor<2x3x1x!FHE.eint<7>> { return %arg0: tensor<2x3x1x!FHE.eint<7>> } )"; @@ -308,7 +308,7 @@ func @main(%arg0: tensor<2x3x1x!FHE.eint<7>>) -> tensor<2x3x1x!FHE.eint<7>> { TEST(CompiledModule, call_2tr3_1tr3) { std::string source = R"( -func @main(%arg0: tensor<2x3x1x!FHE.eint<7>>, %arg1: tensor<2x3x1x!FHE.eint<7>>) -> tensor<2x3x1x!FHE.eint<7>> { +func.func @main(%arg0: tensor<2x3x1x!FHE.eint<7>>, %arg1: tensor<2x3x1x!FHE.eint<7>>) -> tensor<2x3x1x!FHE.eint<7>> { %1 = "FHELinalg.add_eint"(%arg0, %arg1): (tensor<2x3x1x!FHE.eint<7>>, tensor<2x3x1x!FHE.eint<7>>) -> tensor<2x3x1x!FHE.eint<7>> return %1: tensor<2x3x1x!FHE.eint<7>> } @@ -340,7 +340,7 @@ static std::string fileContent(std::string path) { TEST(CompiledModule, call_2t_1s_with_header) { std::string source = R"( -func @extract(%arg0: tensor<3x!FHE.eint<7>>, %arg1: tensor<3x!FHE.eint<7>>) -> !FHE.eint<7> { +func.func @extract(%arg0: tensor<3x!FHE.eint<7>>, %arg1: tensor<3x!FHE.eint<7>>) -> !FHE.eint<7> { %1 = "FHELinalg.add_eint"(%arg0, %arg1) : (tensor<3x!FHE.eint<7>>, tensor<3x!FHE.eint<7>>) -> tensor<3x!FHE.eint<7>> %c1 = arith.constant 1 : i8 %2 = tensor.from_elements %c1, %c1, %c1 : tensor<3xi8> @@ -377,7 +377,7 @@ func @extract(%arg0: tensor<3x!FHE.eint<7>>, %arg1: tensor<3x!FHE.eint<7>>) -> ! TEST(DISABLED_CompiledModule, call_2s_1s_lookup_table) { std::string source = R"( -func @main(%arg0: !FHE.eint<6>, %arg1: !FHE.eint<3>) -> !FHE.eint<6> { +func.func @main(%arg0: !FHE.eint<6>, %arg1: !FHE.eint<3>) -> !FHE.eint<6> { %tlu_7 = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]> : tensor<64xi64> %tlu_3 = arith.constant dense<[0, 1, 2, 3, 4, 5, 6, 7]> : tensor<8xi64> %a = "FHE.apply_lookup_table"(%arg0, %tlu_7): (!FHE.eint<6>, tensor<64xi64>) -> (!FHE.eint<6>) diff --git a/llvm-project b/llvm-project index 1b15657f6..2d3b5205f 160000 --- a/llvm-project +++ b/llvm-project @@ -1 +1 @@ -Subproject commit 1b15657f69183c95e9b15be7374b0f247191e28e +Subproject commit 2d3b5205fadcc78727ecec9be9c90953a74d6126