mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
Use `OpConversionPattern` instead of `OpRewritePattern` for operation conversion during dialect conversion. This makes explicit and in-place type conversions unnecessary, since `OpConversionPattern` already properly converts operand types and provides them to the rewrite rule through an operation adaptor. The main contributions of this commit are the two class templates `TypeConvertingReinstantiationPattern` and `GenericOneToOneOpConversionPattern`. The former allows for the definition of a simple replacement rule that re-instantiates an operation after the types of its operands have been converted. This is especially useful for type-polymorphic operations during dialect conversion. The latter allows for the definition of patterns, where one operation needs to be replaced with a different operation after conversion of its operands. The default implementations for the class templates provide conversions rules for operations that have a generic builder method that takes the desired return type(s), the operands and (optionally) a set of attributes. How attributes are discarded during a conversion (either by omitting the builder argument or by passing an empty set of attributes) can be defined through specialization of `ReinstantiationAttributeDismissalStrategy`. Custom replacement rules that deviate from the scheme above should be implemented by specializing `TypeConvertingReinstantiationPattern::matchAndRewrite()` and `GenericOneToOneOpConversionPattern::matchAndRewrite()`.
22 lines
566 B
CMake
22 lines
566 B
CMake
add_subdirectory(FHEToTFHEScalar)
|
|
add_subdirectory(FHEToTFHECrt)
|
|
add_subdirectory(TFHEGlobalParametrization)
|
|
add_subdirectory(TFHEToConcrete)
|
|
add_subdirectory(FHETensorOpsToLinalg)
|
|
add_subdirectory(ConcreteToBConcrete)
|
|
add_subdirectory(BConcreteToCAPI)
|
|
add_subdirectory(SDFGToStreamEmulator)
|
|
add_subdirectory(MLIRLowerableDialectsToLLVM)
|
|
add_subdirectory(LinalgExtras)
|
|
add_subdirectory(ExtractSDFGOps)
|
|
add_subdirectory(Utils)
|
|
|
|
add_mlir_library(
|
|
ConcretelangConversion
|
|
Tools.cpp
|
|
Utils/Dialects/SCF.cpp
|
|
Utils/Dialects/Tensor.cpp
|
|
LINK_LIBS
|
|
PUBLIC
|
|
MLIRIR)
|