pub struct PhiNode {
pub var: LcnfVarId,
pub operands: Vec<PhiOperand>,
pub vn: ValueNumber,
}Expand description
A phi-node synthesized at a case join point.
In SSA, every join point needs a phi-node for variables with different values in different branches. In GVN, phi-nodes get value numbers too.
Fields§
§var: LcnfVarIdThe variable introduced by this phi.
operands: Vec<PhiOperand>The operands from each incoming branch.
vn: ValueNumberThe value number assigned to this phi-node.
Implementations§
Source§impl PhiNode
impl PhiNode
pub fn new(var: LcnfVarId, operands: Vec<PhiOperand>, vn: ValueNumber) -> Self
Sourcepub fn is_trivial(&self) -> bool
pub fn is_trivial(&self) -> bool
Return true if all operands have the same value number (trivial phi).
Sourcepub fn trivial_vn(&self) -> Option<ValueNumber>
pub fn trivial_vn(&self) -> Option<ValueNumber>
If trivial, return the single unique value number.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhiNode
impl RefUnwindSafe for PhiNode
impl Send for PhiNode
impl Sync for PhiNode
impl Unpin for PhiNode
impl UnsafeUnpin for PhiNode
impl UnwindSafe for PhiNode
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