Replace comments referring to "vector or tensor" with "shaped" where appropriate

PiperOrigin-RevId: 251306752
This commit is contained in:
Geoffrey Martin-Noble 2019-06-03 14:19:04 -07:00 committed by Mehdi Amini
parent 93d522c696
commit e2032c7d4e
3 changed files with 8 additions and 8 deletions

View 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("

View 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");

View 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", []> {