Enum TVMFFISEqHashKind#

Enum Documentation#

enum TVMFFISEqHashKind#

Optional meta-data for structural eq/hash.

This meta-data is only useful when we want to leverage the information to perform richer semantics aware structural comparison and hash. It can be safely ignored if such information is not needed.

The meta-data record comparison method in tree node and DAG node.

x = VarNode()
v0 = AddNode(x, 1)
v1 = AddNode(x, 1)
v2 = AddNode(v0, v0)
v3 = AddNode(v1, v0)

Consider the construct sequence of AddNode below, if AddNode is treated as a tree node, then v2 and v3 structural equals to each other, but if AddNode is treated as a DAG node, then v2 and v3 does not structural equals to each other.

Values:

enumerator kTVMFFISEqHashKindUnsupported#

Do not support structural eq/hash.

enumerator kTVMFFISEqHashKindTreeNode#

The object be compared as a tree node.

enumerator kTVMFFISEqHashKindFreeVar#

The object is treated as a free variable that can be mapped to another free variable in the definition region.

enumerator kTVMFFISEqHashKindDAGNode#

The field should be compared as a DAG node.

enumerator kTVMFFISEqHashKindConstTreeNode#

The object is treated as a constant tree node.

Same as tree node, but the object does not contain free var as any of its nested children.

That means we can use pointer equality for equality.

enumerator kTVMFFISEqHashKindUniqueInstance#

One can simply use pointer equality for equality.

This is useful for “singleton”-style object that can is only an unique copy of each value.