pub enum OptimizeCommandKind {
Show 13 variants
Delete,
DiscardResult,
InlineBranch(bool),
UpdateBranch {
branch: bool,
new_node: Node,
},
UpdateBranchCondition(Condition),
InlineFunction,
RemoveAliasFunction(BlockId),
ChangeWrite(ItemId),
ChangeReads(ItemId, ScoreboardValue),
SetCondition(Condition, Vec<usize>),
Replace(Node),
InsertAfter(Node),
UpdateExecuteRaw(usize, ExecuteRawUpdate),
}
Expand description
Optimizing functions output commands that tell the optimizer what to do, this is done so that there are no troubles with mutability
Variants§
Delete
Deletes a single node
DiscardResult
Converts the FastStoreFromResult node into its command, discarding the result
InlineBranch(bool)
Discards the node and only keeps the branch that matches the bool. (true => pos_branch, false => neg_branch)
UpdateBranch
Updates the specified branch with the new node
UpdateBranchCondition(Condition)
Updates the condition of a branch
InlineFunction
Inlines the function of this function call.
RemoveAliasFunction(BlockId)
Removes all aliases to a function which only redirects to another function The argument specifies the aliased function.
ChangeWrite(ItemId)
Changes the variable this node writes to
ChangeReads(ItemId, ScoreboardValue)
Replaces all variables .0
with .1
SetCondition(Condition, Vec<usize>)
Changes the condition of this branch to a new condition Vec usize contains the exact index of the condition to replace (Vec since conditions can be nested)
Replace(Node)
Replaces the old node completely
InsertAfter(Node)
Inserts this node after
UpdateExecuteRaw(usize, ExecuteRawUpdate)
Modifies a Node::Execute
IMPORTANT: Right now the indices don’t get normalized after a component is deleted
This means that this command should not get used anywhere else other than in the one branch in redundancy_optimizer