File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
lib/Conversion/MemRefToEmitC
test/Conversion/MemRefToEmitC Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ struct ConvertMemRefToEmitCPass
3333
3434 // Fallback for other types.
3535 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 {} ;
3939 });
4040
4141 populateMemRefToEmitCTypeConversion (converter);
Original file line number Diff line number Diff line change @@ -43,3 +43,19 @@ func.func @zero_rank() {
4343
4444// expected-error@+1 {{failed to legalize operation 'memref.global'}}
4545memref.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