mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
feat: optimize concrete mul with constant values
This commit is contained in:
@@ -1 +1,2 @@
|
||||
add_subdirectory(IR)
|
||||
add_subdirectory(Transforms)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
set(LLVM_TARGET_DEFINITIONS Optimization.td)
|
||||
mlir_tablegen(Optimization.h.inc -gen-pass-decls -name Transforms)
|
||||
add_public_tablegen_target(ConcretelangConcreteOptimizationPassIncGen)
|
||||
add_dependencies(mlir-headers ConcretelangConcreteOptimizationPassIncGen)
|
||||
@@ -0,0 +1,21 @@
|
||||
// Part of the Concrete Compiler Project, under the BSD3 License with Zama
|
||||
// Exceptions. See
|
||||
// https://github.com/zama-ai/concrete-compiler-internal/blob/master/LICENSE.txt
|
||||
// for license information.
|
||||
|
||||
#ifndef CONCRETELANG_CONCRETE_OPTIMIZATION_PASS_H
|
||||
#define CONCRETELANG_CONCRETE_OPTIMIZATION_PASS_H
|
||||
|
||||
#include <concretelang/Dialect/Concrete/IR/ConcreteDialect.h>
|
||||
#include <mlir/Pass/Pass.h>
|
||||
|
||||
#define GEN_PASS_CLASSES
|
||||
#include <concretelang/Dialect/Concrete/Transforms/Optimization.h.inc>
|
||||
|
||||
namespace mlir {
|
||||
namespace concretelang {
|
||||
std::unique_ptr<mlir::OperationPass<>> createConcreteOptimizationPass();
|
||||
} // namespace concretelang
|
||||
} // namespace mlir
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef CONCRETELANG_CONCRETE_OPTIMIZATION_PASS
|
||||
#define CONCRETELANG_CONCRETE_OPTIMIZATION_PASS
|
||||
|
||||
include "mlir/Pass/PassBase.td"
|
||||
|
||||
def ConcreteOptimization : Pass<"concrete-optimization"> {
|
||||
let summary = "Optimize Concrete operations";
|
||||
let constructor = "mlir::concretelang::createConcreteOptimizationPass()";
|
||||
let options = [];
|
||||
let dependentDialects = [ "mlir::concretelang::Concrete::ConcreteDialect" ];
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -47,6 +47,10 @@ lowerConcreteToBConcrete(mlir::MLIRContext &context, mlir::ModuleOp &module,
|
||||
std::function<bool(mlir::Pass *)> enablePass,
|
||||
bool parallelizeLoops);
|
||||
|
||||
mlir::LogicalResult
|
||||
optimizeConcrete(mlir::MLIRContext &context, mlir::ModuleOp &module,
|
||||
std::function<bool(mlir::Pass *)> enablePass);
|
||||
|
||||
mlir::LogicalResult
|
||||
lowerBConcreteToStd(mlir::MLIRContext &context, mlir::ModuleOp &module,
|
||||
std::function<bool(mlir::Pass *)> enablePass);
|
||||
|
||||
Reference in New Issue
Block a user