Expand description
Common Subexpression Elimination logic implemented in CSE can be controlled with
a CSEController, that defines how to eliminate common subtrees from a particular
TreeNode tree.
Structsยง
- CSE
- The main entry point of Common Subexpression Elimination.
- CSERewriter ๐
- Rewrite a
TreeNodetree by replacing detected common subtrees with the corresponding temporaryTreeNode, that column contains the evaluate result of replacedTreeNodetree. - CSEVisitor ๐
- Go through a
TreeNodetree and generate identifiers for each subtrees. - Identifier ๐
- Identifier that represents a
TreeNodetree.
Enumsยง
- Found
Common Nodes - The result of potentially rewriting a list of
TreeNodes to eliminate common subtrees. - Node
Evaluation ๐ - How many times a node is evaluated. A node can be considered common if evaluated surely at least 2 times or surely only once but also conditionally.
- Visit
Record ๐ - Record item that used when traversing a
TreeNodetree.
Traitsยง
- CSEController
- The
TreeNodespecific definition of elimination. - Hash
Node - Hashes the direct content of an
TreeNodewithout recursing into its children. - Normalize
Eq - The
NormalizeEqtrait extendsEqandNormalizeableto provide a method for comparing normalized nodes in optimizations like Common Subexpression Elimination (CSE). - Normalizeable
- The
Normalizeabletrait defines a method to determine whether a node can be normalized.
Type Aliasesยง
- Children
List ๐ - Common
Nodes ๐ - A map that contains the common
TreeNodes and their alias by their identifiers, extracted during the second, rewriting traversal. - IdArray ๐
- A cache that contains the postorder index and the identifier of
TreeNodes by the preorder index of the nodes. - Node
Stats ๐ - A map that contains the evaluation stats of
TreeNodes by their identifiers.