From acbb5bf17a569c55b22d7e2aefb7dff18354cfb2 Mon Sep 17 00:00:00 2001 From: Quentin Bourgerie Date: Thu, 16 Jun 2022 09:52:23 +0200 Subject: [PATCH] cleanup(compiler): Remove custom print and parse TFHE types --- .../Dialect/TFHE/IR/TFHEDialect.td | 5 ----- compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp | 19 ------------------- compiler/lib/Dialect/TFHE/IR/TFHETypes.cpp | 3 +-- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td b/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td index 9f467bddb..83e92c4f1 100644 --- a/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td +++ b/compiler/include/concretelang/Dialect/TFHE/IR/TFHEDialect.td @@ -18,11 +18,6 @@ def TFHE_Dialect : Dialect { A dialect for representation of high level operation on fully homomorphic ciphertext. }]; let cppNamespace = "::mlir::concretelang::TFHE"; - let useDefaultTypePrinterParser = 0; - let extraClassDeclaration = [{ - ::mlir::Type parseType(::mlir::DialectAsmParser &parser) const override; - void printType(::mlir::Type type, ::mlir::DialectAsmPrinter &printer) const override; - }]; } #endif diff --git a/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp b/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp index bf57ce0c6..73c8f99c9 100644 --- a/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp +++ b/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp @@ -28,25 +28,6 @@ void TFHEDialect::initialize() { >(); } -::mlir::Type TFHEDialect::parseType(::mlir::DialectAsmParser &parser) const { - if (parser.parseOptionalKeyword("glwe").succeeded()) - return GLWECipherTextType::parse(parser); - parser.emitError(parser.getCurrentLocation(), "Unknown TFHE type"); - return ::mlir::Type(); -} - -void TFHEDialect::printType(::mlir::Type type, - ::mlir::DialectAsmPrinter &printer) const { - mlir::concretelang::TFHE::GLWECipherTextType glwe = - type.dyn_cast_or_null(); - if (glwe != nullptr) { - glwe.print(printer); - return; - } - // TODO - What should be done here? - printer << "unknwontype"; -} - /// Verify that GLWE parameter are consistant /// - The bits parameter is 64 (we support only this for v0) ::mlir::LogicalResult GLWECipherTextType::verify( diff --git a/compiler/lib/Dialect/TFHE/IR/TFHETypes.cpp b/compiler/lib/Dialect/TFHE/IR/TFHETypes.cpp index 5e24dbb68..338e00df8 100644 --- a/compiler/lib/Dialect/TFHE/IR/TFHETypes.cpp +++ b/compiler/lib/Dialect/TFHE/IR/TFHETypes.cpp @@ -10,8 +10,7 @@ namespace concretelang { namespace TFHE { void GLWECipherTextType::print(mlir::AsmPrinter &p) const { - p << "glwe" - << "<{"; + p << "<{"; if (getDimension() == -1) p << "_"; else