@@ -38,14 +38,15 @@ func.func @main() {
38
38
%5 = arith.constant 5 : index
39
39
40
40
%alloca = memref.alloca () : memref <1 xf32 >
41
- %alloc = memref.alloc (%4 ) : memref <?x4 xf32 >
41
+ %alloca_4 = memref.alloca () : memref <4 x4 xf32 >
42
+ %alloca_4_dyn = memref.cast %alloca_4 : memref <4 x4 xf32 > to memref <?x4 xf32 >
42
43
43
44
// Offset is out-of-bounds
44
45
// CHECK: ERROR: Runtime op verification failed
45
46
// CHECK-NEXT: "memref.subview"
46
47
// CHECK-NEXT: ^ subview is out-of-bounds of the base memref
47
48
// CHECK-NEXT: Location: loc({{.*}})
48
- func.call @subview_dynamic_rank_reduce (%alloc , %5 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
49
+ func.call @subview_dynamic_rank_reduce (%alloca_4_dyn , %5 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
49
50
50
51
// Offset is out-of-bounds
51
52
// CHECK: ERROR: Runtime op verification failed
@@ -66,23 +67,23 @@ func.func @main() {
66
67
// CHECK-NEXT: "memref.subview"
67
68
// CHECK-NEXT: ^ subview is out-of-bounds of the base memref
68
69
// CHECK-NEXT: Location: loc({{.*}})
69
- func.call @subview_dynamic (%alloc , %0 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
70
+ func.call @subview_dynamic (%alloca_4_dyn , %0 , %5 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
70
71
71
72
// Stride is out-of-bounds
72
73
// CHECK: ERROR: Runtime op verification failed
73
74
// CHECK-NEXT: "memref.subview"
74
75
// CHECK-NEXT: ^ subview is out-of-bounds of the base memref
75
76
// CHECK-NEXT: Location: loc({{.*}})
76
- func.call @subview_dynamic (%alloc , %0 , %4 , %4 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
77
+ func.call @subview_dynamic (%alloca_4_dyn , %0 , %4 , %4 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
77
78
78
79
// CHECK-NOT: ERROR: Runtime op verification failed
79
80
func.call @subview (%alloca , %0 ) : (memref <1 xf32 >, index ) -> ()
80
81
81
82
// CHECK-NOT: ERROR: Runtime op verification failed
82
- func.call @subview_dynamic (%alloc , %0 , %4 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
83
+ func.call @subview_dynamic (%alloca_4_dyn , %0 , %4 , %1 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
83
84
84
85
// CHECK-NOT: ERROR: Runtime op verification failed
85
- func.call @subview_dynamic_rank_reduce (%alloc , %0 , %1 , %0 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
86
+ func.call @subview_dynamic_rank_reduce (%alloca_4_dyn , %0 , %1 , %0 ) : (memref <?x4 xf32 >, index , index , index ) -> ()
86
87
87
88
88
89
return
0 commit comments