// 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("
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");
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");
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);
// 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);
// 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", []> {