[Mlir-commits] [mlir] 2116ead - [mlir] Remove traits that require vector type support from ops in Complex dialect.
Adrian Kuegel
llvmlistbot at llvm.org
Sun Jun 13 23:30:41 PDT 2021
Author: Adrian Kuegel
Date: 2021-06-14T08:30:22+02:00
New Revision: 2116eadf0994942fa99778d9b9d4315bc106f35f
URL: https://github.com/llvm/llvm-project/commit/2116eadf0994942fa99778d9b9d4315bc106f35f
DIFF: https://github.com/llvm/llvm-project/commit/2116eadf0994942fa99778d9b9d4315bc106f35f.diff
LOG: [mlir] Remove traits that require vector type support from ops in Complex dialect.
Actually, no vector types are supported so far. We should add the traits once
the vector types are supported (e.g. ElementwiseMappable.traits).
Instead add Elementwise trait to each op.
Differential Revision: https://reviews.llvm.org/D104103
Added:
Modified:
mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
index 1f71a97aab4ae..63b21b86ad79b 100644
--- a/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
+++ b/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
@@ -10,7 +10,6 @@
#define COMPLEX_OPS
include "mlir/Dialect/Complex/IR/ComplexBase.td"
-include "mlir/Interfaces/VectorInterfaces.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
class Complex_Op<string mnemonic, list<OpTrait> traits = []>
@@ -21,8 +20,7 @@ class Complex_Op<string mnemonic, list<OpTrait> traits = []>
// one result, all of which must be complex numbers of the same type.
class ComplexArithmeticOp<string mnemonic, list<OpTrait> traits = []> :
Complex_Op<mnemonic, traits # [NoSideEffect, SameOperandsAndResultType,
- DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
- ElementwiseMappable.traits> {
+ Elementwise]> {
let arguments = (ins Complex<AnyFloat>:$lhs, Complex<AnyFloat>:$rhs);
let results = (outs Complex<AnyFloat>:$result);
let assemblyFormat = "$lhs `,` $rhs attr-dict `:` type($result)";
@@ -33,7 +31,7 @@ class ComplexArithmeticOp<string mnemonic, list<OpTrait> traits = []> :
// floating-point element type. These operations take one operand and return
// one result; the operand must be a complex number.
class ComplexUnaryOp<string mnemonic, list<OpTrait> traits = []> :
- Complex_Op<mnemonic, traits # [NoSideEffect]> {
+ Complex_Op<mnemonic, traits # [NoSideEffect, Elementwise]> {
let arguments = (ins Complex<AnyFloat>:$complex);
let assemblyFormat = "$complex attr-dict `:` type($complex)";
let verifier = ?;
@@ -131,9 +129,7 @@ def DivOp : ComplexArithmeticOp<"div"> {
//===----------------------------------------------------------------------===//
def EqualOp : Complex_Op<"eq",
- [NoSideEffect, AllTypesMatch<["lhs", "rhs"]>,
- DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
- ElementwiseMappable.traits> {
+ [NoSideEffect, AllTypesMatch<["lhs", "rhs"]>, Elementwise]> {
let summary = "computes whether two complex values are equal";
let description = [{
The `eq` op takes two complex numbers and returns whether they are equal.
@@ -219,9 +215,7 @@ def MulOp : ComplexArithmeticOp<"mul"> {
//===----------------------------------------------------------------------===//
def NotEqualOp : Complex_Op<"neq",
- [NoSideEffect, AllTypesMatch<["lhs", "rhs"]>,
- DeclareOpInterfaceMethods<VectorUnrollOpInterface>] #
- ElementwiseMappable.traits> {
+ [NoSideEffect, AllTypesMatch<["lhs", "rhs"]>, Elementwise]> {
let summary = "computes whether two complex values are not equal";
let description = [{
The `neq` op takes two complex numbers and returns whether they are not
More information about the Mlir-commits
mailing list