Get rid of redundant verifier, which is implied by the type traits.
authorRasmus Munk Larsen <rmlarsen@google.com>
Wed, 29 May 2019 16:59:21 +0000 (09:59 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 2 Jun 2019 03:07:01 +0000 (20:07 -0700)
--

PiperOrigin-RevId: 250511694

mlir/include/mlir/StandardOps/Ops.td
mlir/lib/StandardOps/Ops.cpp

index e825e89..d5a8831 100644 (file)
@@ -583,6 +583,7 @@ def RankOp : Std_Op<"rank", [NoSideEffect]> {
 
   let arguments = (ins AnyTensor);
   let results = (outs Index);
+  let verifier = ?;
 
   let builders = [OpBuilder<
     "Builder *builder, OperationState *result, Value *tensor", [{
index 7c73d5b..d82ccdf 100644 (file)
@@ -1806,14 +1806,6 @@ static ParseResult parseRankOp(OpAsmParser *parser, OperationState *result) {
                  parser->addTypeToList(indexType, result->types));
 }
 
-static LogicalResult verify(RankOp op) {
-  auto type = op.getOperand()->getType();
-  if (!type.isa<TensorType>()) {
-    return op.emitOpError("requires an operand that is a tensor");
-  }
-  return success();
-}
-
 OpFoldResult RankOp::fold(ArrayRef<Attribute> operands) {
   // Constant fold rank when the rank of the tensor is known.
   auto type = getOperand()->getType();