From ce776c0eba6c2181c8af7f88a060604cdca8c243 Mon Sep 17 00:00:00 2001 From: Quentin Bourgerie Date: Mon, 23 Aug 2021 18:10:12 +0200 Subject: [PATCH] fix(compiler/lowlfhe): lwe_ciphertext as memref element type --- .../zamalang/Dialect/LowLFHE/IR/CMakeLists.txt | 12 +++++++++--- .../zamalang/Dialect/LowLFHE/IR/LowLFHETypes.td | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/compiler/include/zamalang/Dialect/LowLFHE/IR/CMakeLists.txt b/compiler/include/zamalang/Dialect/LowLFHE/IR/CMakeLists.txt index 3a70de742..ed6038c8a 100644 --- a/compiler/include/zamalang/Dialect/LowLFHE/IR/CMakeLists.txt +++ b/compiler/include/zamalang/Dialect/LowLFHE/IR/CMakeLists.txt @@ -1,3 +1,9 @@ -add_mlir_dialect(LowLFHEOps LowLFHE) -#add_mlir_doc(MidLFHEDialect -gen-dialect-doc MidLFHEDialect zamalang/) -#add_mlir_doc(MidLFHEOps -gen-op-doc MidLFHEOps zamalang/) +set(LLVM_TARGET_DEFINITIONS LowLFHEOps.td) +mlir_tablegen(LowLFHEOps.h.inc -gen-op-decls) +mlir_tablegen(LowLFHEOps.cpp.inc -gen-op-defs) +mlir_tablegen(LowLFHEOpsTypes.h.inc -gen-typedef-decls -typedefs-dialect=LowLFHE) +mlir_tablegen(LowLFHEOpsTypes.cpp.inc -gen-typedef-defs -typedefs-dialect=LowLFHE) +mlir_tablegen(LowLFHEOpsDialect.h.inc -gen-dialect-decls -dialect=LowLFHE) +mlir_tablegen(LowLFHEOpsDialect.cpp.inc -gen-dialect-defs -dialect=LowLFHE) +add_public_tablegen_target(MLIRLowLFHEOpsIncGen) +add_dependencies(mlir-headers MLIRLowLFHEOpsIncGen) \ No newline at end of file diff --git a/compiler/include/zamalang/Dialect/LowLFHE/IR/LowLFHETypes.td b/compiler/include/zamalang/Dialect/LowLFHE/IR/LowLFHETypes.td index 6748242c5..1c84f3427 100644 --- a/compiler/include/zamalang/Dialect/LowLFHE/IR/LowLFHETypes.td +++ b/compiler/include/zamalang/Dialect/LowLFHE/IR/LowLFHETypes.td @@ -1,10 +1,11 @@ #ifndef ZAMALANG_DIALECT_LowLFHE_IR_LowLFHE_TYPES #define ZAMALANG_DIALECT_LowLFHE_IR_LowLFHE_TYPES +include "mlir/IR/BuiltinTypes.td" + include "zamalang/Dialect/LowLFHE/IR/LowLFHEDialect.td" -class LowLFHE_Type : TypeDef { } - +class LowLFHE_Type traits = []> : TypeDef { } def EncryptionRandomGeneratorType : LowLFHE_Type<"EncryptionRandomGenerator"> { let mnemonic = "enc_rand_gen"; @@ -113,7 +114,7 @@ def ForeignPlaintextListType : LowLFHE_Type<"ForeignPlaintextList"> { } -def LweCiphertextType : LowLFHE_Type<"LweCiphertext"> { +def LweCiphertextType : LowLFHE_Type<"LweCiphertext", [MemRefElementTypeInterface]> { let mnemonic = "lwe_ciphertext"; let summary = "LWE ciphertext";