Commit 1e9b2f8
committed
Add stablehlo.Call operation for invoking named functions
This adds support for the stablehlo.call operation which allows
calling top-level (non-closure) functions with explicit arguments.
Changes:
- internal/optypes/optypes.go: Add Call to OpType enum
- internal/shapeinference/shapeinference.go: Add Call shape inference
- pkg/stablehlo/ops.go: Implement Call function
- pkg/stablehlo/statement.go: Add symbolRef type for function references
The Call operation differs from closure-based operations (Sort/While/If):
- Callee must be a top-level function (Parent == nil)
- Callee must have Return() called before being called
- Arguments are passed explicitly as operands
- Callee is stored as a symbol reference attribute (@function_name)1 parent bf2241b commit 1e9b2f8
5 files changed
Lines changed: 461 additions & 368 deletions
File tree
- internal
- optypes
- shapeinference
- pkg/stablehlo
0 commit comments