Dead Node Elimination context class.
This class keeps track of all the nodes and outputs that are alive. In contrast to all other nodes, a simple node is considered alive if already a single of its outputs is alive. For this reason, this class keeps separately track of simple nodes and therefore avoids to store all its outputs (and instead stores the node itself). By marking the entire node as alive, we also avoid that we reiterate through all inputs of this node again in the future. The following example illustrates the issue:
o1 ... oN = Node2 i1 ... iN p1 ... pN = Node1 o1 ... oN
When we mark o1 as alive, we actually mark the entire Node2 as alive. This means that when we try to mark o2 alive in the future, we can immediately stop marking instead of reiterating through i1 ... iN again. Thus, by marking the entire simple node instead of just its outputs, we reduce the runtime for marking Node2 from O(oN x iN) to O(oN + iN).
Definition at line 36 of file DeadNodeElimination.cpp.