pub struct PhiInstruction {
pub out: Value,
pub entries: Vec<PhiEntry>,
}Expand description
A phi node that picks its value based on the BasicBlock that came immediately before.
For more information, see https://en.wikipedia.org/wiki/Static_single-assignment_form
§Example
ⓘ
if cond {
result = "heads";
} else {
result = "tails";
}would translate to the following SSA graph:
ⓘ
bb1: {
branch if cond { bb2 } else { bb3 };
}
bb2: {
let result.v1 = "heads";
branch bb4;
}
bb3: {
let result.v2 = "tails";
branch bb4;
}
bb4: {
let result.v3 = phi [bb2: result.v1] [bb3: result.v2];
}Fields§
§out: ValueThe out value for the phi instruction
entries: Vec<PhiEntry>The set of block-value pairs for the phi instruction
Trait Implementations§
Source§impl Clone for PhiInstruction
impl Clone for PhiInstruction
Source§fn clone(&self) -> PhiInstruction
fn clone(&self) -> PhiInstruction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PhiInstruction
impl Debug for PhiInstruction
Source§impl PartialEq for PhiInstruction
impl PartialEq for PhiInstruction
impl StructuralPartialEq for PhiInstruction
Auto Trait Implementations§
impl Freeze for PhiInstruction
impl RefUnwindSafe for PhiInstruction
impl Send for PhiInstruction
impl Sync for PhiInstruction
impl Unpin for PhiInstruction
impl UnsafeUnpin for PhiInstruction
impl UnwindSafe for PhiInstruction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more