diff --git a/mlir/include/mlir/Dialect/Math/IR/MathOps.td b/mlir/include/mlir/Dialect/Math/IR/MathOps.td --- a/mlir/include/mlir/Dialect/Math/IR/MathOps.td +++ b/mlir/include/mlir/Dialect/Math/IR/MathOps.td @@ -13,11 +13,11 @@ include "mlir/Interfaces/VectorInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" -class MathOp traits = []> +class Math_Op traits = []> : Op; -class FloatUnaryOp traits = []> : - MathOp traits = []> : + Math_Op, SameOperandsAndResultType] # ElementwiseMappable.traits> { let arguments = (ins FloatLike:$operand); @@ -27,8 +27,8 @@ let assemblyFormat = "$operand attr-dict `:` type($result)"; } -class FloatBinaryOp traits = []> : - MathOp traits = []> : + Math_Op, SameOperandsAndResultType] # ElementwiseMappable.traits> { let arguments = (ins FloatLike:$lhs, FloatLike:$rhs); @@ -41,7 +41,7 @@ // AtanOp //===----------------------------------------------------------------------===// -def AtanOp : FloatUnaryOp<"atan">{ +def Math_AtanOp : Math_FloatUnaryOp<"atan">{ let summary = "arcus tangent of the given value"; let description = [{ Syntax: @@ -74,7 +74,7 @@ // Atan2Op //===----------------------------------------------------------------------===// -def Atan2Op : FloatBinaryOp<"atan2">{ +def Math_Atan2Op : Math_FloatBinaryOp<"atan2">{ let summary = "2-argument arcus tangent of the given values"; let description = [{ Syntax: @@ -114,7 +114,7 @@ // CosOp //===----------------------------------------------------------------------===// -def CosOp : FloatUnaryOp<"cos"> { +def Math_CosOp : Math_FloatUnaryOp<"cos"> { let summary = "cosine of the specified value"; let description = [{ Syntax: @@ -147,7 +147,7 @@ // SinOp //===----------------------------------------------------------------------===// -def SinOp : FloatUnaryOp<"sin"> { +def Math_SinOp : Math_FloatUnaryOp<"sin"> { let summary = "sine of the specified value"; let description = [{ Syntax: @@ -181,7 +181,7 @@ // ExpOp //===----------------------------------------------------------------------===// -def ExpOp : FloatUnaryOp<"exp"> { +def Math_ExpOp : Math_FloatUnaryOp<"exp"> { let summary = "base-e exponential of the specified value"; let description = [{ Syntax: @@ -213,7 +213,7 @@ // Exp2Op //===----------------------------------------------------------------------===// -def Exp2Op : FloatUnaryOp<"exp2"> { +def Math_Exp2Op : Math_FloatUnaryOp<"exp2"> { let summary = "base-2 exponential of the specified value"; let description = [{ @@ -246,7 +246,7 @@ // ExpM1Op //===----------------------------------------------------------------------===// -def ExpM1Op : FloatUnaryOp<"expm1"> { +def Math_ExpM1Op : Math_FloatUnaryOp<"expm1"> { let summary = "base-e exponential of the specified value minus 1"; let description = [{ Syntax: @@ -280,7 +280,7 @@ // LogOp //===----------------------------------------------------------------------===// -def LogOp : FloatUnaryOp<"log"> { +def Math_LogOp : Math_FloatUnaryOp<"log"> { let summary = "base-e logarithm of the specified value"; let description = [{ @@ -299,7 +299,7 @@ // Log10Op //===----------------------------------------------------------------------===// -def Log10Op : FloatUnaryOp<"log10"> { +def Math_Log10Op : Math_FloatUnaryOp<"log10"> { let summary = "base-10 logarithm of the specified value"; let description = [{ @@ -318,7 +318,7 @@ // Log1pOp //===----------------------------------------------------------------------===// -def Log1pOp : FloatUnaryOp<"log1p"> { +def Math_Log1pOp : Math_FloatUnaryOp<"log1p"> { let summary = "Computes the natural logarithm of one plus the given value"; let description = [{ @@ -339,7 +339,7 @@ // Log2Op //===----------------------------------------------------------------------===// -def Log2Op : FloatUnaryOp<"log2"> { +def Math_Log2Op : Math_FloatUnaryOp<"log2"> { let summary = "base-2 logarithm of the specified value"; let description = [{ @@ -358,7 +358,7 @@ // PowFOp //===----------------------------------------------------------------------===// -def PowFOp : FloatBinaryOp<"powf"> { +def Math_PowFOp : Math_FloatBinaryOp<"powf"> { let summary = "floating point raised to the power of operation"; let description = [{ Syntax: @@ -391,7 +391,7 @@ // RsqrtOp //===----------------------------------------------------------------------===// -def RsqrtOp : FloatUnaryOp<"rsqrt"> { +def Math_RsqrtOp : Math_FloatUnaryOp<"rsqrt"> { let summary = "reciprocal of sqrt (1 / sqrt of the specified value)"; let description = [{ The `rsqrt` operation computes the reciprocal of the square root. It takes @@ -405,7 +405,7 @@ // SqrtOp //===----------------------------------------------------------------------===// -def SqrtOp : FloatUnaryOp<"sqrt"> { +def Math_SqrtOp : Math_FloatUnaryOp<"sqrt"> { let summary = "sqrt of the specified value"; let description = [{ The `sqrt` operation computes the square root. It takes one operand and @@ -430,7 +430,7 @@ // TanhOp //===----------------------------------------------------------------------===// -def TanhOp : FloatUnaryOp<"tanh"> { +def Math_TanhOp : Math_FloatUnaryOp<"tanh"> { let summary = "hyperbolic tangent of the specified value"; let description = [{ Syntax: