@@ -39,38 +39,50 @@ func.func @main() {
39
39
%alloca_4 = memref.alloca () : memref <4 x4 xf32 >
40
40
%alloca_4_dyn = memref.cast %alloca_4 : memref <4 x4 xf32 > to memref <?x4 xf32 >
41
41
42
- // Offset is out-of-bounds
42
+ // Offset is out-of-bounds and slice runs out-of-bounds
43
43
// CHECK: ERROR: Runtime op verification failed
44
- // CHECK-NEXT: "memref.subview"
45
- // CHECK-NEXT: ^ subview is out-of-bounds of the base memref
44
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 1, 1>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1>, static_strides = array<i64: -9223372036854775808, 1>}> : (memref<?x4xf32>, index, index, index) -> memref<?xf32, strided<[?], offset: ?>>
45
+ // CHECK-NEXT: ^ offset 0 is out-of-bounds
46
+ // CHECK-NEXT: Location: loc({{.*}})
47
+ // CHECK: ERROR: Runtime op verification failed
48
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 1, 1>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 1>, static_strides = array<i64: -9223372036854775808, 1>}> : (memref<?x4xf32>, index, index, index) -> memref<?xf32, strided<[?], offset: ?>>
49
+ // CHECK-NEXT: ^ subview runs out-of-bounds along dimension 0
46
50
// CHECK-NEXT: Location: loc({{.*}})
47
51
func.call @subview_dynamic_rank_reduce (%alloca_4_dyn , %5 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
48
52
49
- // Offset is out-of-bounds
53
+ // Offset is out-of-bounds and slice runs out-of-bounds
54
+ // CHECK: ERROR: Runtime op verification failed
55
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808>, static_sizes = array<i64: 1>, static_strides = array<i64: 1>}> : (memref<1xf32>, index) -> memref<1xf32, strided<[1], offset: ?>>
56
+ // CHECK-NEXT: ^ offset 0 is out-of-bounds
57
+ // CHECK-NEXT: Location: loc({{.*}})
50
58
// CHECK: ERROR: Runtime op verification failed
51
- // CHECK-NEXT: "memref.subview"
52
- // CHECK-NEXT: ^ subview is out-of-bounds of the base memref
59
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808>, static_sizes = array<i64: 1>, static_strides = array<i64: 1>}> : (memref<1xf32>, index) -> memref<1xf32, strided<[1], offset: ?>>
60
+ // CHECK-NEXT: ^ subview runs out-of-bounds along dimension 0
53
61
// CHECK-NEXT: Location: loc({{.*}})
54
62
func.call @subview (%alloca , %1 ) : (memref <1 xf32 >, index ) -> ()
55
63
56
- // Offset is out-of-bounds
64
+ // Offset is out-of-bounds and slice runs out-of-bounds
65
+ // CHECK: ERROR: Runtime op verification failed
66
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808>, static_sizes = array<i64: 1>, static_strides = array<i64: 1>}> : (memref<1xf32>, index) -> memref<1xf32, strided<[1], offset: ?>>
67
+ // CHECK-NEXT: ^ offset 0 is out-of-bounds
68
+ // CHECK-NEXT: Location: loc({{.*}})
57
69
// CHECK: ERROR: Runtime op verification failed
58
- // CHECK-NEXT: "memref.subview"
59
- // CHECK-NEXT: ^ subview is out-of-bounds of the base memref
70
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 0, 0>, static_offsets = array<i64: -9223372036854775808>, static_sizes = array<i64: 1>, static_strides = array<i64: 1>}> : (memref<1xf32>, index) -> memref<1xf32, strided<[1], offset: ?>>
71
+ // CHECK-NEXT: ^ subview runs out-of-bounds along dimension 0
60
72
// CHECK-NEXT: Location: loc({{.*}})
61
73
func.call @subview (%alloca , %n1 ) : (memref <1 xf32 >, index ) -> ()
62
74
63
- // Size is out-of-bounds
75
+ // Slice runs out-of-bounds due to size
64
76
// CHECK: ERROR: Runtime op verification failed
65
- // CHECK-NEXT: "memref.subview"
66
- // CHECK-NEXT: ^ subview is out-of-bounds of the base memref
77
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 1, 1>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 4>, static_strides = array<i64: -9223372036854775808, 1>}> : (memref<?x4xf32>, index, index, index) -> memref<?x4xf32, strided<[?, 1], offset: ?>>
78
+ // CHECK-NEXT: ^ subview runs out-of-bounds along dimension 0
67
79
// CHECK-NEXT: Location: loc({{.*}})
68
80
func.call @subview_dynamic (%alloca_4_dyn , %0 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
69
81
70
- // Stride is out-of-bounds
82
+ // Slice runs out-of-bounds due to stride
71
83
// CHECK: ERROR: Runtime op verification failed
72
- // CHECK-NEXT: "memref.subview"
73
- // CHECK-NEXT: ^ subview is out-of-bounds of the base memref
84
+ // CHECK-NEXT: "memref.subview"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) <{operandSegmentSizes = array<i32: 1, 1, 1, 1>, static_offsets = array<i64: -9223372036854775808, 0>, static_sizes = array<i64: -9223372036854775808, 4>, static_strides = array<i64: -9223372036854775808, 1>}> : (memref<?x4xf32>, index, index, index) -> memref<?x4xf32, strided<[?, 1], offset: ?>>
85
+ // CHECK-NEXT: ^ subview runs out-of-bounds along dimension 0
74
86
// CHECK-NEXT: Location: loc({{.*}})
75
87
func.call @subview_dynamic (%alloca_4_dyn , %0 , %4 , %4 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
76
88
0 commit comments