diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -991,10 +991,10 @@ } def CmpFOp : Std_Op<"cmpf", - [NoSideEffect, SameTypeOperands, - SameOperandsAndResultShape, TypesMatchWith< + [NoSideEffect, SameTypeOperands, ElementwiseMappable, + TypesMatchWith< "result type has i1 element type and same shape as operands", - "lhs", "result", "getI1SameShape($_self)">, ElementwiseMappable]> { + "lhs", "result", "getI1SameShape($_self)">]> { let summary = "floating-point comparison operation"; let description = [{ The `cmpf` operation compares its two operands according to the float @@ -1075,10 +1075,10 @@ } def CmpIOp : Std_Op<"cmpi", - [NoSideEffect, SameTypeOperands, - SameOperandsAndResultShape, TypesMatchWith< + [NoSideEffect, SameTypeOperands, ElementwiseMappable, + TypesMatchWith< "result type has i1 element type and same shape as operands", - "lhs", "result", "getI1SameShape($_self)">, ElementwiseMappable]> { + "lhs", "result", "getI1SameShape($_self)">]> { let summary = "integer comparison operation"; let description = [{ The `cmpi` operation is a generic comparison for integer-like types. Its two @@ -2799,7 +2799,7 @@ //===----------------------------------------------------------------------===// def SignExtendIOp : Std_Op<"sexti", - [NoSideEffect, SameOperandsAndResultShape, ElementwiseMappable]> { + [NoSideEffect, ElementwiseMappable]> { let summary = "integer sign extension operation"; let description = [{ The integer sign extension operation takes an integer input of @@ -3665,9 +3665,7 @@ // TruncateIOp //===----------------------------------------------------------------------===// -def TruncateIOp : Std_Op<"trunci", [NoSideEffect, - SameOperandsAndResultShape, - ElementwiseMappable]> { +def TruncateIOp : Std_Op<"trunci", [NoSideEffect, ElementwiseMappable]> { let summary = "integer truncation operation"; let description = [{ The integer truncation operation takes an integer input of @@ -3934,9 +3932,7 @@ // ZeroExtendIOp //===----------------------------------------------------------------------===// -def ZeroExtendIOp : Std_Op<"zexti", [NoSideEffect, - SameOperandsAndResultShape, - ElementwiseMappable]> { +def ZeroExtendIOp : Std_Op<"zexti", [NoSideEffect, ElementwiseMappable]> { let summary = "integer zero extension operation"; let description = [{ The integer zero extension operation takes an integer input of diff --git a/mlir/test/IR/invalid-ops.mlir b/mlir/test/IR/invalid-ops.mlir --- a/mlir/test/IR/invalid-ops.mlir +++ b/mlir/test/IR/invalid-ops.mlir @@ -236,7 +236,7 @@ func @func_with_ops() { ^bb0: %c = constant dense<0> : vector<42 x i32> - // expected-error@+1 {{op requires the same shape for all operands and results}} + // expected-error@+1 {{all non-scalar operands/results must have the same shape and base type: found 'vector<41xi1>' and 'vector<42xi32>'}} %r = "std.cmpi"(%c, %c) {predicate = 0} : (vector<42 x i32>, vector<42 x i32>) -> vector<41 x i1> } @@ -514,7 +514,7 @@ // ----- func @cmpf_result_shape_mismatch(%a : vector<42xf32>) { - // expected-error@+1 {{op requires the same shape for all operands and results}} + // expected-error@+1 {{all non-scalar operands/results must have the same shape and base type: found 'vector<41xi1>' and 'vector<42xf32>'}} %r = "std.cmpf"(%a, %a) {predicate = 0} : (vector<42 x f32>, vector<42 x f32>) -> vector<41 x i1> }