mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat(compiler): Add new action dump-sdfg
Add a new action `dump-sdfg` to `concretecompiler` that causes the IR to be dumpred right after the extraction of SDFG operations.
This commit is contained in:
@@ -184,6 +184,10 @@ public:
|
||||
/// BConcrete operations
|
||||
BCONCRETE,
|
||||
|
||||
/// Read sources and lower all FHE, TFHE and Concrete operations to
|
||||
/// BConcrete, then extract SDFG operations
|
||||
SDFG,
|
||||
|
||||
/// Read sources and lower all FHE, TFHE and Concrete
|
||||
/// operations to canonical MLIR dialects. Cryptographic operations
|
||||
/// are lowered to invocations of the concrete library.
|
||||
|
||||
@@ -405,6 +405,10 @@ CompilerEngine::compile(llvm::SourceMgr &sm, Target target, OptionalLib lib) {
|
||||
}
|
||||
}
|
||||
|
||||
if (target == Target::SDFG) {
|
||||
return std::move(res);
|
||||
}
|
||||
|
||||
// BConcrete -> Canonical dialects
|
||||
if (mlir::concretelang::pipeline::lowerBConcreteToStd(mlirContext, module,
|
||||
enablePass)
|
||||
|
||||
@@ -50,6 +50,7 @@ enum Action {
|
||||
DUMP_CONCRETE,
|
||||
DUMP_CONCRETEWITHLOOPS,
|
||||
DUMP_BCONCRETE,
|
||||
DUMP_SDFG,
|
||||
DUMP_STD,
|
||||
DUMP_LLVM_DIALECT,
|
||||
DUMP_LLVM_IR,
|
||||
@@ -128,6 +129,8 @@ static llvm::cl::opt<enum Action> action(
|
||||
llvm::cl::values(
|
||||
clEnumValN(Action::DUMP_BCONCRETE, "dump-bconcrete",
|
||||
"Lower to Bufferized Concrete and dump result")),
|
||||
llvm::cl::values(clEnumValN(Action::DUMP_SDFG, "dump-sdfg",
|
||||
"Lower to SDFG operations annd dump result")),
|
||||
llvm::cl::values(clEnumValN(Action::DUMP_STD, "dump-std",
|
||||
"Lower to std and dump result")),
|
||||
llvm::cl::values(clEnumValN(Action::DUMP_LLVM_DIALECT, "dump-llvm-dialect",
|
||||
@@ -489,6 +492,9 @@ mlir::LogicalResult processInputBuffer(
|
||||
case Action::DUMP_BCONCRETE:
|
||||
target = mlir::concretelang::CompilerEngine::Target::BCONCRETE;
|
||||
break;
|
||||
case Action::DUMP_SDFG:
|
||||
target = mlir::concretelang::CompilerEngine::Target::SDFG;
|
||||
break;
|
||||
case Action::DUMP_STD:
|
||||
target = mlir::concretelang::CompilerEngine::Target::STD;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user