From e2032c7d4edc18203d0f7195df4e3469946f84b9 Mon Sep 17 00:00:00 2001 From: Geoffrey Martin-Noble Date: Mon, 3 Jun 2019 14:19:04 -0700 Subject: [PATCH] Replace comments referring to "vector or tensor" with "shaped" where appropriate PiperOrigin-RevId: 251306752 --- mlir/include/mlir/IR/OpBase.td | 2 +- mlir/lib/IR/Operation.cpp | 6 +++--- mlir/test/mlir-tblgen/predicate.td | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td index 16a7ca3..81577bb 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -1061,7 +1061,7 @@ class TCresVTEtIsSameAsOp : And<[ // Type Constraint operands' Element type are all Same At the given `indices`. // We query the operands' types into a list and check they are all the same. // Precondition: -// 1) all operands involved are of vector or tensor type and +// 1) all operands involved are of shaped type and // 2) the indices are not out of range. class TCopVTEtAreSameAt indices> : CPred<"llvm::is_splat(mlir::functional::map(" diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp index 5d50db1..95d474b 100644 --- a/mlir/lib/IR/Operation.cpp +++ b/mlir/lib/IR/Operation.cpp @@ -816,14 +816,14 @@ OpTrait::impl::verifySameOperandsAndResultElementType(Operation *op) { auto type = op->getResult(0)->getType().dyn_cast(); if (!type) - return op->emitOpError("requires vector or tensor type results"); + return op->emitOpError("requires shaped type results"); auto elementType = type.getElementType(); // Verify result element type matches first result's element type. for (auto result : drop_begin(op->getResults(), 1)) { auto resultType = result->getType().dyn_cast(); if (!resultType) - return op->emitOpError("requires vector or tensor type results"); + return op->emitOpError("requires shaped type results"); if (resultType.getElementType() != elementType) return op->emitOpError( "requires the same element type for all operands and results"); @@ -833,7 +833,7 @@ OpTrait::impl::verifySameOperandsAndResultElementType(Operation *op) { for (auto operand : op->getOperands()) { auto operandType = operand->getType().dyn_cast(); if (!operandType) - return op->emitOpError("requires vector or tensor type operands"); + return op->emitOpError("requires shaped type operands"); if (operandType.getElementType() != elementType) return op->emitOpError( "requires the same element type for all operands and results"); diff --git a/mlir/test/mlir-tblgen/predicate.td b/mlir/test/mlir-tblgen/predicate.td index 97a3689..9c37e93 100644 --- a/mlir/test/mlir-tblgen/predicate.td +++ b/mlir/test/mlir-tblgen/predicate.td @@ -37,7 +37,7 @@ def OpC : NS_Op<"op_for_TCopVTEtIs", [ def OpD : NS_Op<"op_for_TCOpVTEtIsSameAs", [ - PredOpTrait<"first operand is a vector or tensor with the same " + PredOpTrait<"first operand is a shaped type with the same " "elemental type as itself", TCopVTEtIsSameAs<0, 0>>]> { let arguments = (ins AnyTensor:$x); @@ -45,11 +45,11 @@ def OpD : NS_Op<"op_for_TCOpVTEtIsSameAs", [ // CHECK-LABEL: OpD::verify // CHECK: if (!((((*this->getOperation()).getNumOperands() > std::max(0,0))) && (((*this->getOperation()).getOperand(0)->getType().isa())) && (((*this->getOperation()).getOperand(0)->getType().isa())) && (((*this->getOperation()).getOperand(0)->getType().cast().getElementType() == (*this->getOperation()).getOperand(0)->getType().cast().getElementType())))) -// CHECK-NEXT: return emitOpError("failed to verify that first operand is a vector or tensor with the same elemental type as itself"); +// CHECK-NEXT: return emitOpError("failed to verify that first operand is a shaped type with the same elemental type as itself"); def OpE : NS_Op<"op_for_TCresVTEtIsSameAsOp", [ - PredOpTrait<"first operand is a vector or tensor with the same " + PredOpTrait<"first operand is a shaped type with the same " "elemental type as first result", TCresVTEtIsSameAsOp<0, 0>>]> { let arguments = (ins AnyTensor:$x); @@ -58,7 +58,7 @@ def OpE : NS_Op<"op_for_TCresVTEtIsSameAsOp", [ // CHECK-LABEL: OpE::verify // CHECK: if (!((((*this->getOperation()).getNumResults() > 0)) && (((*this->getOperation()).getNumOperands() > 0)) && (((*this->getOperation()).getResult(0)->getType().isa())) && (((*this->getOperation()).getOperand(0)->getType().isa())) && (((*this->getOperation()).getResult(0)->getType().cast().getElementType() == (*this->getOperation()).getOperand(0)->getType().cast().getElementType())))) -// CHECK-NEXT: return emitOpError("failed to verify that first operand is a vector or tensor with the same elemental type as first result"); +// CHECK-NEXT: return emitOpError("failed to verify that first operand is a shaped type with the same elemental type as first result"); def OpF : NS_Op<"op_for_int_min_val", []> { -- 2.7.4