-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(mir): use proper operand queries (#943)
## Summary In the MIR-using passes, replace raw indexing into the tree with proper operand queries. This makes more of the processing node-layout agnostic, which is a preparation for reworking the MIR. ## Details * rename `unaryOperand` to `operand`. It's shorter, and gets the same meaning across * add `mnkView` to the `SingleInputNodes` set -- it was previously missing * allow using values of `NodePosition` and `OpValue` index-types as the arguments to `operand`. Requiring a `Operation` index-type value only introduced noise * replace raw single-operand lookup (indexing into the tree with `i - 1`) with usage of `operand` Querying the second operand of a `mnkPathArray` is still done via the raw-indexing approach (`i - 2`), as usage of `operand(tree, i, 1)` would still be rather inefficient.
- Loading branch information
Showing
4 changed files
with
37 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters