feat(compiler): Add pass converting operations into SDFG processes

This adds a new pass `ExtractSDGOps`, which scans a function for
operations that implement `SDFGConvertibleOpInterface`, replaces them
with SDFG processes and constructs an SDFG graph around the processes.

Initialization and teardown of the SDFG graph are embedded into the
function and take place at the beginning of the function and before
the function's terminator, respectively.

The pass can be invoked using concretecompiler by specifying the new
compilation option `--emit-sdfg-ops` or programmatically on a
`CompilerEngine` using the new compilation option `extractSDFGOps`.
This commit is contained in:
Andi Drebes
2022-11-30 10:35:03 +01:00
committed by Andi Drebes
parent 9ea6c0e8a3
commit 3da32560b7
17 changed files with 429 additions and 4 deletions

View File

@@ -173,6 +173,13 @@ llvm::cl::opt<bool> batchConcreteOps(
"operations out of loop nests as batched operations"),
llvm::cl::init(false));
llvm::cl::opt<bool> emitSDFGOps(
"emit-sdfg-ops",
llvm::cl::desc(
"Extract operations supported by the SDFG dialect for static data flow"
" graphs and emit them."),
llvm::cl::init(false));
llvm::cl::opt<bool> dataflowParallelize(
"parallelize-dataflow",
llvm::cl::desc(
@@ -305,6 +312,7 @@ cmdlineCompilationOptions() {
options.loopParallelize = cmdline::loopParallelize;
options.dataflowParallelize = cmdline::dataflowParallelize;
options.batchConcreteOps = cmdline::batchConcreteOps;
options.emitSDFGOps = cmdline::emitSDFGOps;
options.optimizeConcrete = cmdline::optimizeConcrete;
options.emitGPUOps = cmdline::emitGPUOps;