forked from OSchip/llvm-project
[mlir] Add convenience builders for EqualOp and NotEqualOp.
The result type is always I1. This additional builder allows to omit the result type. Differential Revision: https://reviews.llvm.org/D102905
This commit is contained in:
parent
ebd25fde5e
commit
7eb85cdb10
|
@ -166,6 +166,11 @@ def EqualOp : Complex_Op<"eq",
|
|||
|
||||
let arguments = (ins Complex<AnyFloat>:$lhs, Complex<AnyFloat>:$rhs);
|
||||
let results = (outs I1:$result);
|
||||
let builders = [
|
||||
OpBuilder<(ins "Value":$lhs, "Value":$rhs), [{
|
||||
build($_builder, $_state, IntegerType::get(lhs.getContext(), 1), lhs,
|
||||
rhs);
|
||||
}]>];
|
||||
|
||||
let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($lhs)";
|
||||
}
|
||||
|
@ -205,6 +210,11 @@ def NotEqualOp : Complex_Op<"neq",
|
|||
|
||||
let arguments = (ins Complex<AnyFloat>:$lhs, Complex<AnyFloat>:$rhs);
|
||||
let results = (outs I1:$result);
|
||||
let builders = [
|
||||
OpBuilder<(ins "Value":$lhs, "Value":$rhs), [{
|
||||
build($_builder, $_state, IntegerType::get(lhs.getContext(), 1), lhs,
|
||||
rhs);
|
||||
}]>];
|
||||
|
||||
let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($lhs)";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue