# Lib.PhiNode module

Classes for φ nodes in a RiscV CFG `CFG` under SSA Form: `PhiNode` for a statement of the form temp_x = φ(temp_0, …, temp_n). These particular kinds of statements are expected to be in the field b._phis for a `Block` b.

class Lib.PhiNode.PhiNode(var: DataLocation, srcs: Dict[ Label , Operand ])

  Bases: `Statement`

  A φ node is a renaming in the CFG, of the form temp_x = φ(temp_0, …, temp_n). The field var contains the variable temp_x. The field srcs relies for each precedent block in the CFG, identified with its label, the variable temp_i of the φ node.

  var: DataLocation
  srcs: Dict[ Label , Operand ]
  defined()

    Return the variable defined by the φ node.

  used() → Dict[ Label , Operand ]

    Return the dictionnary associating for each previous block the corresponding variable.

  rename(renamer: Renamer ) → None

    Rename the variable defined by the φ node with a fresh name.

  rename_from(renamer: Renamer, label: Label ) → None

    Rename the variable associated to the block identified by label.

  printIns(stream)

    Print the statement on the given output. Should never be called on the base class.