Replace comments referring to "vector or tensor" with "shaped" where appropriate
authorGeoffrey Martin-Noble <gcmn@google.com>
Mon, 3 Jun 2019 21:19:04 +0000 (14:19 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Tue, 4 Jun 2019 02:27:19 +0000 (19:27 -0700)
PiperOrigin-RevId: 251306752

mlir/include/mlir/IR/OpBase.td
mlir/lib/IR/Operation.cpp
mlir/test/mlir-tblgen/predicate.td

index 16a7ca3..81577bb 100644 (file)
@@ -1061,7 +1061,7 @@ class TCresVTEtIsSameAsOp<int i, int j> : 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<list<int> indices> :
     CPred<"llvm::is_splat(mlir::functional::map("
index 5d50db1..95d474b 100644 (file)
@@ -816,14 +816,14 @@ OpTrait::impl::verifySameOperandsAndResultElementType(Operation *op) {
 
   auto type = op->getResult(0)->getType().dyn_cast<ShapedType>();
   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<ShapedType>();
     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<ShapedType>();
     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");
index 97a3689..9c37e93 100644 (file)
@@ -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<ShapedType>())) && (((*this->getOperation()).getOperand(0)->getType().isa<ShapedType>())) && (((*this->getOperation()).getOperand(0)->getType().cast<ShapedType>().getElementType() == (*this->getOperation()).getOperand(0)->getType().cast<ShapedType>().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<ShapedType>())) && (((*this->getOperation()).getOperand(0)->getType().isa<ShapedType>())) && (((*this->getOperation()).getResult(0)->getType().cast<ShapedType>().getElementType() == (*this->getOperation()).getOperand(0)->getType().cast<ShapedType>().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", []> {