Module cse

Module cse 

Source
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 TreeNode tree by replacing detected common subtrees with the corresponding temporary TreeNode, that column contains the evaluate result of replaced TreeNode tree.
CSEVisitor ๐Ÿ”’
Go through a TreeNode tree and generate identifiers for each subtrees.
Identifier ๐Ÿ”’
Identifier that represents a TreeNode tree.

Enumsยง

FoundCommonNodes
The result of potentially rewriting a list of TreeNodes to eliminate common subtrees.
NodeEvaluation ๐Ÿ”’
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.
VisitRecord ๐Ÿ”’
Record item that used when traversing a TreeNode tree.

Traitsยง

CSEController
The TreeNode specific definition of elimination.
HashNode
Hashes the direct content of an TreeNode without recursing into its children.
NormalizeEq
The NormalizeEq trait extends Eq and Normalizeable to provide a method for comparing normalized nodes in optimizations like Common Subexpression Elimination (CSE).
Normalizeable
The Normalizeable trait defines a method to determine whether a node can be normalized.

Type Aliasesยง

ChildrenList ๐Ÿ”’
CommonNodes ๐Ÿ”’
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.
NodeStats ๐Ÿ”’
A map that contains the evaluation stats of TreeNodes by their identifiers.