File tree Expand file tree Collapse file tree 5 files changed +14
-7
lines changed Expand file tree Collapse file tree 5 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -1394,7 +1394,7 @@ def Arith_IndexCastUIOp
1394
1394
1395
1395
// Bitcast can convert between memrefs of signless integers and floats.
1396
1396
def BitcastTypeConstraint : TypeConstraint<Or<[
1397
- SignlessIntegerOrFloatLike .predicate,
1397
+ SignlessInteger.predicate, FloatLike .predicate,
1398
1398
MemRefOf<[AnySignlessInteger, AnyFloat]>.predicate]>,
1399
1399
"signless-integer-or-float-like or memref of signless-integer or float">;
1400
1400
Original file line number Diff line number Diff line change @@ -75,8 +75,10 @@ def Tensor_BitcastOp : Tensor_Op<"bitcast", [
75
75
```
76
76
}];
77
77
78
- let arguments = (ins AnyTensor:$source);
79
- let results = (outs AnyTensor:$dest);
78
+ let arguments = (ins TensorOf<[AnySignlessInteger, AnyUnsignedInteger,
79
+ AnySignedInteger, AnyFloat]>:$source);
80
+ let results = (outs TensorOf<[AnySignlessInteger, AnyUnsignedInteger,
81
+ AnySignedInteger, AnyFloat]>:$dest);
80
82
let assemblyFormat = "$source attr-dict `:` type($source) `to` type($dest)";
81
83
82
84
let hasCanonicalizer = 1;
Original file line number Diff line number Diff line change @@ -908,6 +908,11 @@ def BoolLike : TypeOrContainer<I1, "bool-like">;
908
908
909
909
def BoolLikeOfAnyRank : TypeOrContainerOfAnyRank<I1, "bool-like">;
910
910
911
+ // Type constraint for signless-integer-like types: signless integers,
912
+ // vectors of signless integers or tensors of signless integers.
913
+ def SignlessInteger : TypeOrValueSemanticsContainer<
914
+ AnySignlessInteger, "signless-integer">;
915
+
911
916
// Type constraint for signless-integer-like types: signless integers, indices,
912
917
// vectors of signless integers or indices, tensors of signless integers.
913
918
def SignlessIntegerLike : TypeOrValueSemanticsContainer<
Original file line number Diff line number Diff line change @@ -857,15 +857,15 @@ func.func @select_tensor_encoding(
857
857
// -----
858
858
859
859
func.func @bitcast_index_0 (%arg0 : i64 ) -> index {
860
- // expected-error @+1 {{'arith.bitcast' op operand type 'i64' and result type 'index' are cast incompatible }}
860
+ // expected-error @+1 {{'arith.bitcast' op result #0 must be signless-integer-or-float-like or memref of signless-integer or float, but got 'index' }}
861
861
%0 = arith.bitcast %arg0 : i64 to index
862
862
return %0 : index
863
863
}
864
864
865
865
// -----
866
866
867
867
func.func @bitcast_index_1 (%arg0 : index ) -> i64 {
868
- // expected-error @+1 {{'arith.bitcast' op operand type 'index' and result type 'i64' are cast incompatible }}
868
+ // expected-error @+1 {{'arith.bitcast' op operand #0 must be signless-integer-or-float-like or memref of signless-integer or float, but got 'index' }}
869
869
%0 = arith.bitcast %arg0 : index to i64
870
870
return %0 : i64
871
871
}
Original file line number Diff line number Diff line change @@ -811,15 +811,15 @@ func.func @unpack_static_inner_tile_size_and_dynamic_output_shape(
811
811
// -----
812
812
813
813
func.func @bitcast_index_0 (%arg0 : tensor <?xi64 >) -> tensor <?xindex > {
814
- // expected-error @+1 {{'tensor.bitcast' op operand type ' tensor<?xi64>' and result type 'tensor<?xindex>' are cast incompatible }}
814
+ // expected-error @+1 {{'tensor.bitcast' op result #0 must be tensor of signless integer or unsigned integer or signed integer or floating-point values, but got 'tensor<?xindex>'}}
815
815
%0 = tensor.bitcast %arg0 : tensor <?xi64 > to tensor <?xindex >
816
816
return %0 : tensor <?xindex >
817
817
}
818
818
819
819
// -----
820
820
821
821
func.func @bitcast_index_1 (%arg0 : tensor <?xindex >) -> tensor <?xi64 > {
822
- // expected-error @+1 {{'tensor.bitcast' op operand type ' tensor<?xindex>' and result type 'tensor<?xi64>' are cast incompatible }}
822
+ // expected-error @+1 {{'tensor.bitcast' op operand #0 must be tensor of signless integer or unsigned integer or signed integer or floating-point values, but got 'tensor<?xindex>' }}
823
823
%0 = tensor.bitcast %arg0 : tensor <?xindex > to tensor <?xi64 >
824
824
return %0 : tensor <?xi64 >
825
825
}
You can’t perform that action at this time.
0 commit comments