iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.48k stars 553 forks source link

Replace func.func/call with util.func/call. #16187

Open benvanik opened 5 months ago

benvanik commented 5 months ago

Finally time. We need functions that support tied operands and inlining control as today func.func has no good way to do it. We don't need shape/size-aware operands/results as IPO takes care of that in general and we don't want to require result sizes to be computable by callers.

When we have our own version we can control inlining; today the inliner control is handled by the func dialect so we can't do alwaysinline/noinline, can't avoid inlining into different device-scoped contexts, and can't add our own cost modeling for whether inlining is profitable.

We don't support function addresses today so we can ignore those ops and just bring over func.func/func.call as util.func/util.call.

benvanik commented 4 months ago

Most of the func.func->util.func changes landed as part of #16411. There's still work to do to make use of the new util.func tied operand feature and enable IPO to work with it but that will come later.