fix(compiler): Generate and include autogenerated dialect definitions (#52)

* fix(compiler): Generate and include autogenerated dialect definitions

Since commit 485cc55edfb875628e19bb6d9de4706af2865d3e in llvm-project,
dialects are now required to include a file with autogenerated
definitions. This commit generates the definition files and includes
them in appropriate dialect source files for MidLFHE and HLFHE.

* CI: update docker image ref

Co-authored-by: Andi Drebes <andi.drebes@zama.ai>
Co-authored-by: Ayoub Benaissa <ayoub.benaissa@zama.ai>
This commit is contained in:
Andi Drebes
2021-07-08 16:54:10 +02:00
committed by GitHub
parent 3bfda58eb8
commit cef0e569d4
4 changed files with 8 additions and 3 deletions

View File

@@ -24,6 +24,6 @@ jobs:
- name: Build and test compiler
uses: addnab/docker-run-action@v3
with:
image: qbozama/mlir:b2f48cc
image: qbozama/mlir:cc9283
options: -v ${{ github.workspace }}:/workspace
run: cd /workspace/compiler && mkdir build && cmake -B build . -DLLVM_DIR=$LLVM_PROJECT/build/lib/cmake/llvm -DMLIR_DIR=$LLVM_PROJECT/build/lib/cmake/mlir && make -C build/ zamacompiler && make test
run: cd /workspace/compiler && mkdir build && cmake -B build . -DLLVM_DIR=$LLVM_PROJECT/build/lib/cmake/llvm -DMLIR_DIR=$LLVM_PROJECT/build/lib/cmake/mlir && make -C build/ zamacompiler && make test

View File

@@ -4,6 +4,7 @@ mlir_tablegen(HLFHEOps.cpp.inc -gen-op-defs)
mlir_tablegen(HLFHEOpsTypes.h.inc -gen-typedef-decls -typedefs-dialect=HLFHE)
mlir_tablegen(HLFHEOpsTypes.cpp.inc -gen-typedef-defs -typedefs-dialect=HLFHE)
mlir_tablegen(HLFHEOpsDialect.h.inc -gen-dialect-decls -dialect=HLFHE)
mlir_tablegen(HLFHEOpsDialect.cpp.inc -gen-dialect-defs -dialect=HLFHE)
add_public_tablegen_target(MLIRHLFHEOpsIncGen)
add_dependencies(mlir-headers MLIRHLFHEOpsIncGen)

View File

@@ -5,6 +5,8 @@
#define GET_TYPEDEF_CLASSES
#include "zamalang/Dialect/HLFHE/IR/HLFHEOpsTypes.cpp.inc"
#include "zamalang/Dialect/HLFHE/IR/HLFHEOpsDialect.cpp.inc"
using namespace mlir::zamalang::HLFHE;
void HLFHEDialect::initialize() {
@@ -36,4 +38,4 @@ void HLFHEDialect::printType(::mlir::Type type,
}
// TODO - What should be done here?
printer << "unknwontype";
}
}

View File

@@ -5,6 +5,8 @@
#define GET_TYPEDEF_CLASSES
#include "zamalang/Dialect/MidLFHE/IR/MidLFHEOpsTypes.cpp.inc"
#include "zamalang/Dialect/MidLFHE/IR/MidLFHEOpsDialect.cpp.inc"
using namespace mlir::zamalang::MidLFHE;
void MidLFHEDialect::initialize() {