diff --git a/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp b/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp index e0c45c036..43f6fe591 100644 --- a/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp +++ b/compiler/lib/Dialect/HLFHE/IR/HLFHEOps.cpp @@ -107,14 +107,15 @@ bool verifyEncryptedIntegerInputsConsistency(::mlir::OpState &op, "`ct` argument."; return mlir::failure(); } + // Disable this check for the moment // Check the witdh of the encrypted integer and the integer of the tabulated // lambda are equals - if (ct.getWidth() != l_cst.getElementType().cast().getWidth()) { - op.emitOpError() - << " should have equals width beetwen the encrypted integer result and " - "integers of the `tabulated_lambda` argument"; - return mlir::failure(); - } + // if (ct.getWidth() != l_cst.getElementType().cast().getWidth()) { + // op.emitOpError() + // << " should have equals width beetwen the encrypted integer result and " + // "integers of the `tabulated_lambda` argument"; + // return mlir::failure(); + // } return mlir::success(); } diff --git a/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp b/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp index 52e1e3e04..cdf516bc8 100644 --- a/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp +++ b/compiler/lib/Dialect/MidLFHE/IR/MidLFHEOps.cpp @@ -123,13 +123,14 @@ mlir::LogicalResult verifyApplyLookupTable(ApplyLookupTable &op) { "`ct` argument."; return mlir::failure(); } + // Disable this check for the moment // Check the witdh of the encrypted integer and the integer of the tabulated // lambda are equals - if (result.getP() < l_cst.getElementType().cast().getWidth()) { - op.emitOpError() << "should have the width of the constants less or equals " - "than the precision of the encrypted integer"; - return mlir::failure(); - } + // if (result.getP() < l_cst.getElementType().cast().getWidth()) { + // op.emitOpError() << "should have the width of the constants less or equals " + // "than the precision of the encrypted integer"; + // return mlir::failure(); + // } return mlir::success(); } diff --git a/compiler/tests/Dialect/HLFHE/op_apply_lookup_table_bad_integer_width_in_table.mlir b/compiler/tests/Dialect/HLFHE/op_apply_lookup_table_bad_integer_width_in_table.mlir deleted file mode 100644 index 331a3887e..000000000 --- a/compiler/tests/Dialect/HLFHE/op_apply_lookup_table_bad_integer_width_in_table.mlir +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: not zamacompiler %s 2>&1| FileCheck %s - -// CHECK-LABEL: error: 'HLFHE.apply_lookup_table' op should have equals width beetwen the encrypted integer result and integers of the `tabulated_lambda` argument -func @apply_lookup_table(%arg0: !HLFHE.eint<2>, %arg1: tensor<4xi3>) -> !HLFHE.eint<2> { - %1 = "HLFHE.apply_lookup_table"(%arg0, %arg1): (!HLFHE.eint<2>, tensor<4xi3>) -> (!HLFHE.eint<2>) - return %1: !HLFHE.eint<2> -} \ No newline at end of file diff --git a/compiler/tests/Dialect/MidLFHE/op_apply_lookup_table.invalid.mlir b/compiler/tests/Dialect/MidLFHE/op_apply_lookup_table.invalid.mlir index c1f0759b3..f43ec7e69 100644 --- a/compiler/tests/Dialect/MidLFHE/op_apply_lookup_table.invalid.mlir +++ b/compiler/tests/Dialect/MidLFHE/op_apply_lookup_table.invalid.mlir @@ -7,11 +7,3 @@ func @apply_lookup_table(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>, %arg1: tensor<4x return %1: !MidLFHE.glwe<{512,10,64}{2}> } -// ----- - -// Bad dimension of integer in the lookup table -func @apply_lookup_table(%arg0: !MidLFHE.glwe<{1024,12,64}{7}>, %arg1: tensor<128xi3>) -> !MidLFHE.glwe<{512,10,64}{2}> { - // expected-error @+1 {{'MidLFHE.apply_lookup_table' op should have the width of the constants less or equals than the precision of the encrypted integer}} - %1 = "MidLFHE.apply_lookup_table"(%arg0, %arg1) {k = 1 : i32, polynomialSize = 1024 : i32, levelKS = 2 : i32, baseLogKS = -82 : i32, levelBS = 3 : i32, baseLogBS = -83 : i32}: (!MidLFHE.glwe<{1024,12,64}{7}>, tensor<128xi3>) -> (!MidLFHE.glwe<{512,10,64}{2}>) - return %1: !MidLFHE.glwe<{512,10,64}{2}> -}