EDSC: support call instructions
Introduce support for binding MLIR functions as constant expressions. Standard constant operation supports functions as possible constant values. Provide C APIs to look up existing named functions in an MLIR module and expose them to the Python bindings. Provide Python bindings to declare a function in an MLIR module without defining it and to add a definition given a function declaration. These declarations are useful when attempting to link MLIR modules with, e.g., the standard library. Introduce EDSC support for direct and indirect calls to other MLIR functions. Internally, an indirect call is always emitted to leverage existing support for delayed construction of MLIR Values using EDSC Exprs. If the expression is bound to a constant function (looked up or declared beforehand), MLIR constant folding will be able to replace an indirect call by a direct call. Currently, only zero- and one-result functions are supported since we don't have support for multi-valued expressions in EDSC. Expose function calling interface to Python bindings on expressions by defining a `__call__` function accepting a variable number of arguments. PiperOrigin-RevId: 234959444
Loading
Please sign in to comment