Class PhiNodeManager

    • Method Detail

      • update

        public void update()
      • insertTrivialPhiNodes

        public boolean insertTrivialPhiNodes()
        Phi node Insertion Algorithm from Cytron et al 91, P24-5,

        Special Java case: If a variable is not defined along all paths of entry to a node, a Phi node is not needed.

      • prependTrivialPhiNode

        public void prependTrivialPhiNode​(Local local,
                                          Block frontierBlock)
        Inserts a trivial Phi node with the appropriate number of arguments.
      • trimExceptionalPhiNodes

        public void trimExceptionalPhiNodes()
        Exceptional Phi nodes have a huge number of arguments and control flow predecessors by default. Since it is useless trying to keep the number of arguments and control flow predecessors in synch, we might as well trim out all redundant arguments and eliminate a huge number of copy statements when we get out of SSA form in the process.
      • dominates

        public boolean dominates​(Unit champ,
                                 Unit challenger)
        Returns true if champ dominates challenger. Note that false doesn't necessarily mean that challenger dominates champ.
      • doEliminatePhiNodes

        public boolean doEliminatePhiNodes()
        Eliminate Phi nodes in block by naively replacing them with shimple assignment statements in the control flow predecessors. Returns true if new locals were added to the body during the process, false otherwise.
      • getUnitToBlockMap

        public static Map<Unit,​Block> getUnitToBlockMap​(BlockGraph blocks)
        Convenience function that maps units to blocks. Should probably be in BlockGraph.