File tree 2 files changed +19
-3
lines changed
lib/Conversion/MemRefToEmitC
test/Conversion/MemRefToEmitC 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ struct ConvertMemRefToEmitCPass
33
33
34
34
// Fallback for other types.
35
35
converter.addConversion ([](Type type) -> std::optional<Type> {
36
- if (isa<MemRefType> (type))
37
- return {} ;
38
- return type ;
36
+ if (emitc::isSupportedEmitCType (type))
37
+ return type ;
38
+ return {} ;
39
39
});
40
40
41
41
populateMemRefToEmitCTypeConversion (converter);
Original file line number Diff line number Diff line change @@ -43,3 +43,19 @@ func.func @zero_rank() {
43
43
44
44
// expected-error@+1 {{failed to legalize operation 'memref.global'}}
45
45
memref.global " nested" constant @nested_global : memref <3 x7 xf32 >
46
+
47
+ // -----
48
+
49
+ func.func @unsupported_type_f16 () {
50
+ // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
51
+ %0 = memref.alloca () : memref <4 xf16 >
52
+ return
53
+ }
54
+
55
+ // -----
56
+
57
+ func.func @unsupported_type_i4 () {
58
+ // expected-error@+1 {{failed to legalize operation 'memref.alloca'}}
59
+ %0 = memref.alloca () : memref <4 xi4 >
60
+ return
61
+ }
You can’t perform that action at this time.
0 commit comments