MultiplexerNode

An operation which chooses one of its inputs to forward as a result.

In a multiplexer node, the choice of which input to forward is controled by an unsigned integer, as if it was indexing an array of inputs. If the selector's value does not match the index of any input, the result is a poison value.

More...

Members

Functions

opEquals
bool opEquals(const(MultiplexerNode) rhs)

Equivalence <=> structural equality.

opIndex
inout(InEdge)* opIndex(InEdge.ID slot)

See Node.opIndex.

toHash
hash_t toHash()

Semantic hash.

Properties

inEdges
InEdgeIterator!Callable inEdges [@property getter]

Provides an iterator over this node's in-edges.

inputs
inout(UnsafeHashMap!(ulong, OutEdge)) inputs [@property getter]

At least two inputs, one of which will be forwarded as output.

outEdges
OutEdgeIterator!Callable outEdges [@property getter]

Provides an iterator over this node's out-edges.

Static functions

dispose
void dispose(MultiplexerNode* self)

Frees all resources allocated by this node and sets it to an uninitialized state.

initialize
err_t initialize(MultiplexerNode* self, uint n)

Initializes a multiplexer node, must be later disposed.

Variables

output
InEdge output;

Resulting value.

selector
OutEdge selector;

Data dependency used to choose which of the given inputs will be returned.

Mixed In Members

From mixin NodeInheritance

opPostMove
void opPostMove(const(This) old)

Post-move adjusts in-edge slots' owner pointer.

Detailed Description

The behavior of this node could be emulated by a value-carrying branch into an extended basic block. However, this node does not need control flow edges at all. Thus, its semantics are slightly different: whereas a control flow branch disallows the execution of operations in its unchosen branches (but the compiler can still move them out of the branch if that preserves program semantics), a mux node is allowed to compute all of its options before choosing which one to forward (but doesn't need to, e.g. if the selector is a constant).

See Also