From 07b594de46fa4a7d9593fd81fc53b3df32afa5c1 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 13 Nov 2018 13:45:47 -0800 Subject: [PATCH] Pull duplicated build() in subclasses into root UnaryOp PiperOrigin-RevId: 221326369 --- mlir/include/mlir/IR/op_base.td | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mlir/include/mlir/IR/op_base.td b/mlir/include/mlir/IR/op_base.td index 0c6b45b6adf7..581782ff524d 100644 --- a/mlir/include/mlir/IR/op_base.td +++ b/mlir/include/mlir/IR/op_base.td @@ -162,4 +162,11 @@ class BinaryOp props> : class UnaryOp props> : Op, Operands<[Tensor]>, Results<[Tensor]> { + let builder = [{ + static void build(Builder *builder, OperationState *result, + SSAValue *arg) { + result->addOperands({arg}); + result->types.push_back(arg->getType()); + } + }]; }