Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
slyubomirsky committed Feb 13, 2023
1 parent 613b840 commit 7ebc082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion relax_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ For each expression, we define how it affects the program's visible state and th
1. First `cond` is evaluated. Let the result be `r` (per `StructInfo` checking, it must be a `Bool` scalar).
2. If `r` is true, evaluate the `true_branch` and return its result.
3. If `r` is false, evaluate the `false_branch` and return its result.
11. The node `ExternFunc(global_symbol)` is evaluated by looking up the global symbol name and returning the `PackedFunc` if it exists (it is an error if it does not.) Note that if a TIR `PrimFunc` in the `IRModule` has a global symbol attribute registered, it can be called as an `ExternFunc` using that global symbol as well.
11. The node `ExternFunc(global_symbol)` is evaluated by looking up the global symbol name and returning the `PackedFunc` if it exists (it is an error if it does not). Note that if a TIR `PrimFunc` in the `IRModule` has a global symbol attribute registered, it can be called as an `ExternFunc` using that global symbol as well.
12. The node `Call(op, [arg1, arg2, ..., argn])` is evaluated as follows:
1. If `op` is an `Op` node, then evaluate `arg1`, `arg2`, …, `argn` in that order and call the results `a1`, `a2`, …, `an`. It is up to the compiler implementation to decide how operators should be implemented (some may have an associated `PackedFunc` and others may be built into the executor implementation). The operator may mutate its arguments. It is also up to the operator implementation as to whether the result is newly allocated or aliases another value. «(TODO: Once we have operators for logical and AND and OR, we should also define short-circuiting semantics for those.)»
2. Otherwise, first evaluate `op` (it must evaluate to a closure or `PackedFunc`). Next, we evaluate `arg1`, `arg2`, …, `argn` in that order and call the results `a1`, `a2`, …, `an`.
Expand Down

0 comments on commit 7ebc082

Please sign in to comment.