pub struct PhiInstruction {
pub out: Variable,
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: VariableThe out variable 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 · 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 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