[Mlir-commits] [mlir] [mlir][emitc] Update and extend the TOSA -> EmitC test (PR #177339)
Simon Camphausen
llvmlistbot at llvm.org
Thu Jan 22 09:11:41 PST 2026
================
@@ -0,0 +1,42 @@
+module attributes {transform.with_named_sequence} {
+ transform.named_sequence @__transform_main(%module:
+ !transform.any_op{transform.consumed}) {
+ // 1. TOSA --> Linalg
+ %func_h_1 = transform.structured.match ops{["func.func"]} in %module : (!transform.any_op) -> !transform.any_op
+ transform.apply_registered_pass "tosa-to-linalg"
+ to %func_h_1 : (!transform.any_op) -> !transform.any_op
+
+ // 2. Bufferize
+ // As per BufferizationEnums.td, value 1 for `LayoutMapOption` corresponds
+ // to `IdentityLayoutMap`.
+ %module_bufferized = transform.bufferization.one_shot_bufferize %module
+ { bufferize_function_boundaries=true,
+ function_boundary_type_conversion = 1 : i32}
+ : (!transform.any_op) -> !transform.op<"builtin.module">
+
+ // 3. Apply BufferResultsToOutParams - otherwise the following error is raised:
+ // * "error: 'emitc.func' op cannot return array type"
+ // "hoist-static-allocs" is an optional optimization step.
----------------
simon-camp wrote:
That's true, but disabling it here currently leaves dialect conversion artifacts (unrealized casts) in the final output after the `convert-to-emitc` conversion. I'm not sure if we want to document it here though.
https://github.com/llvm/llvm-project/pull/177339
More information about the Mlir-commits
mailing list