[][src]Struct souper_ir::ast::Phi

pub struct Phi {
    pub block: BlockId,
    pub values: Vec<Operand>,
}

A phi node.

If a phi's block has n predecessors, then the length of values must be n.

All phi nodes associated with a particular block will have their ith value selected when control flow comes from block's ith predecessor. For example, given:

%bb = block 3
%a = phi %bb, 1, 2, 3
%b = phi %bb, 4, 5, 6
%c = phi %bb, 7, 8, 9

If the basic block %bb has three control-flow predecessors. If it is entered via its first predecessor, then %a == 1, %b == 4, and %c == 7. If it is entered via its second predecessor, then %a == 2, %b == 5, and %c == 8. Finally, if it is entered via its third predecessor, then %a == 3, %b == 6, and %c == 9.

Fields

block: BlockId

The basic block that this phi node is contained within.

values: Vec<Operand>

The potential values for this phi node.

Trait Implementations

impl Clone for Phi[src]

impl Debug for Phi[src]

impl From<Phi> for AssignmentRhs[src]

impl Parse for Phi[src]

impl Peek for Phi[src]

Auto Trait Implementations

impl RefUnwindSafe for Phi

impl Send for Phi

impl Sync for Phi

impl Unpin for Phi

impl UnwindSafe for Phi

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.