[Mlir-commits] [mlir] [mlir][bufferize] Make buffer-results-to-out-params support only functions that are neither public nor extern (PR #162441)

Isaac Nudelman llvmlistbot at llvm.org
Tue Oct 14 18:33:07 PDT 2025


nuudlman wrote:

The documentation of this pass implies that it is used for enforcing calling conventions:

> Some calling conventions prefer to pass output memrefs as "out params". The
conversion to this calling convention must be done as an atomic
transformation of the entire program (hence this is a module pass).

Our internal target uses this pass to enforce a valid calling convention for MLIR, and I believe that many users of EmitC will also be using this as iirc EmitC doesn't support functions that return memrefs. To be clear, **this change completely breaks our downstream target.**

See https://godbolt.org/z/n8bvv4oTa for an example of this change breaking EmitC export (Compiler Explorer doesn't have this change merged, so I removed this pass to be equivalent).

Given that this pass explicitly modifies the calling convention, l don't believe that the reasoning for this change is valid. The presence of a calling convention implies that all functions must abide by its rules, and thus if a platform/target requires out-params, it is perfectly valid to change the function signatures of public or extern functions so that they comply with calling convention. 

Considering that this breaks EmitC, I believe that this should be reverted.

https://github.com/llvm/llvm-project/pull/162441


More information about the Mlir-commits mailing list