clean(compiler): Remove unecessary operators for compiler v0 (#54)

This commit is contained in:
Quentin Bourgerie
2021-07-19 11:54:54 +02:00
parent 61382b3cdb
commit 3c326c09d6
3 changed files with 2 additions and 108 deletions

View File

@@ -18,12 +18,6 @@ include "zamalang/Dialect/HLFHE/IR/HLFHETypes.td"
class HLFHE_Op<string mnemonic, list<OpTrait> traits = []> :
Op<HLFHE_Dialect, mnemonic, traits>;
def ApplyUnivariateRegion : Region<
CPred<"::mlir::zamalang::predApplyUnivariateRegion($_self)">,
"apply_univariate region needs one block with one any integer argument">;
def AddEintIntOp : HLFHE_Op<"add_eint_int"> {
let arguments = (ins EncryptedIntegerType:$a, AnyInteger:$b);
let results = (outs EncryptedIntegerType);
@@ -46,18 +40,6 @@ def AddEintOp : HLFHE_Op<"add_eint"> {
];
}
def NegEintOp : HLFHE_Op<"neg_eint"> {
let arguments = (ins EncryptedIntegerType:$a);
let results = (outs EncryptedIntegerType);
let builders = [
OpBuilder<(ins "Value":$a), [{
build($_builder, $_state, a.getType(), a);
}]>
];
}
def MulEintIntOp : HLFHE_Op<"mul_eint_int"> {
let arguments = (ins EncryptedIntegerType:$a, AnyInteger:$b);
let results = (outs EncryptedIntegerType);
@@ -69,40 +51,6 @@ def MulEintIntOp : HLFHE_Op<"mul_eint_int"> {
];
}
def MulEintOp : HLFHE_Op<"mul_eint"> {
let arguments = (ins EncryptedIntegerType:$a, EncryptedIntegerType:$b);
let results = (outs EncryptedIntegerType);
let builders = [
OpBuilder<(ins "Value":$a, "Value":$b), [{
build($_builder, $_state, a.getType(), a, b);
}]>
];
}
def ApplyUnivariateOp : HLFHE_Op<"apply_univariate"> {
let arguments = (ins EncryptedIntegerType:$x);
let results = (outs EncryptedIntegerType:$result);
let builders = [
OpBuilder<(ins "Value": $x), [{
build($_builder, $_state, x.getType(), x);
}]>
];
let regions = (region ApplyUnivariateRegion:$body);
// let assemblyFormat = "$x `:` type($x) $body attr-dict `:` type($result)";
}
def ReturnOp : HLFHE_Op<"apply_univariate_return", [NoSideEffect, ReturnLike, Terminator]> {
let summary = "terminator of apply_univariate block";
let arguments = (ins AnyInteger);
let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>];
}
// Tensor operations
// Dot product
@@ -124,5 +72,4 @@ def Dot : HLFHE_Op<"dot_eint_int", [DeclareOpInterfaceMethods<MemoryEffectsOpInt
return ::mlir::success();
}];
}
#endif