@@ -39,38 +39,50 @@ func.func @main() {
3939 %alloca_4 = memref.alloca () : memref <4 x4 xf32 >
4040 %alloca_4_dyn = memref.cast %alloca_4 : memref <4 x4 xf32 > to memref <?x4 xf32 >
4141
42- // Offset is out-of-bounds
42+ // Offset is out-of-bounds and slice runs out-of-bounds
4343 // 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
4650 // CHECK-NEXT: Location: loc({{.*}})
4751 func.call @subview_dynamic_rank_reduce (%alloca_4_dyn , %5 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
4852
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({{.*}})
5058 // 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
5361 // CHECK-NEXT: Location: loc({{.*}})
5462 func.call @subview (%alloca , %1 ) : (memref <1 xf32 >, index ) -> ()
5563
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({{.*}})
5769 // 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
6072 // CHECK-NEXT: Location: loc({{.*}})
6173 func.call @subview (%alloca , %n1 ) : (memref <1 xf32 >, index ) -> ()
6274
63- // Size is out-of-bounds
75+ // Slice runs out-of-bounds due to size
6476 // 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
6779 // CHECK-NEXT: Location: loc({{.*}})
6880 func.call @subview_dynamic (%alloca_4_dyn , %0 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
6981
70- // Stride is out-of-bounds
82+ // Slice runs out-of-bounds due to stride
7183 // 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
7486 // CHECK-NEXT: Location: loc({{.*}})
7587 func.call @subview_dynamic (%alloca_4_dyn , %0 , %4 , %4 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
7688
0 commit comments