Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Document LoadFunction #1016

Merged
merged 4 commits into from
May 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions specification/hugr.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ source node, to an incoming port of the target node.

#### Static edges (`Const` and `Function`)

A Static edge represents dataflow that is statically knowable - i.e.
the source is a compile-time constant defined in the program. Hence, the types on these edges
are classical. Only a few nodes may be
sources (`FuncDefn`, `FuncDecl` and `Const`) and targets (`Call` and `LoadConstant`) of
these edges; see [operations](#node-operations).
A Static edge represents dataflow that is statically knowable - i.e. the source
is a compile-time constant defined in the program. Hence, the types on these
edges are classical. Only a few nodes may be sources (`FuncDefn`, `FuncDecl` and
`Const`) and targets (`Call`, `LoadConstant`, and `LoadFunction`) of these
edges; see [operations](#node-operations).

#### `Order` edges

Expand Down Expand Up @@ -289,6 +289,10 @@ the following basic dataflow operations are available (in addition to the
- `LoadConstant<T>`: has an incoming `Const<T>` edge, where `T` is a `CopyableType`, and a
`Value<T>` output, used to load a static constant into the local
dataflow graph.
- `LoadFunction`: has an incoming `Function` edge and a `Value<FunctionType>`
output. The `LoadFunction` node specifies any type arguments to the function
in the node weight, and the `FunctionType` in the output edge matches the
(type-instantiated) function in the incoming `Function` edge.
- `identity<T>`: pass-through, no operation is performed.
- `DFG`: A nested dataflow graph.
These nodes are parents in the hierarchy.
Expand Down Expand Up @@ -2011,7 +2015,8 @@ including `Module`.
| `AliasDefn` | 0, 0 | 0, 0 | 0, 0 | 0, 0 | 0, 0 | 1, 0 | |
| `AliasDecl` | 0, 0 | 0, 0 | 0, 0 | 0, 0 | 0, 0 | 1, 0 | |
| `Const` | 0, 0 | 0, 0 | 0, ✱ | 0, 0 | 0, 0 | 1, 0 | |
| `LoadConstant` | 0, 1 | +, ✱ | 1, 0 | 0, 0 | 0, 0 | 1, 0 | |
| `LoadConstant` | 0, 1 | +, ✱ | 0, 0 | 1, 0 | 0, 0 | 1, 0 | |
| `LoadFunction` | 0, 1 | +, ✱ | 1, 0 | 0, 0 | 0, 0 | 1, 0 | |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but I think the + indicating "at least one incoming Order edge" for LoadConstant and LoadFunction may be outdated and should be .

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the same thing, will fix.

doug-q marked this conversation as resolved.
Show resolved Hide resolved
| `Input` | 0, ✱ | 0, ✱ | 0, 0 | 0, 0 | 0, 0 | 1, 0 | |
| `Output` | ✱, 0 | ✱, 0 | 0, 0 | 0, 0 | 0, 0 | 1, 0 | |
| `Call` | ✱, ✱ | ✱, ✱ | 0, 0 | 1, 0 | 0, 0 | 1, 0 | |
Expand Down