Пример #1
0
        private void joinRegs(Register reg, DNode value)
        {
            if (value == null || stack_.reg(reg) == value)
            {
                return;
            }
            if (stack_.reg(reg) == null)
            {
                stack_.set(reg, value);
                return;
            }

            DPhi  phi;
            DNode node = stack_.reg(reg);

            if (node.type != NodeType.Phi || node.block != this)
            {
                phi = new DPhi(node);
                stack_.set(reg, phi);
                add(phi);
            }
            else
            {
                phi = (DPhi)node;
            }
            phi.addInput(value);
        }
Пример #2
0
        public override void visit(DPhi phi)
        {
            // Convert a phi into a move on each incoming edge. Declare the
            // temporary name in the dominator.
            NodeBlock idom = graph_[phi.block.lir.idom.id];

            DTempName name = new DTempName(graph_.tempName());
            idom.prepend(name);

            for (int i = 0; i < phi.numOperands; i++)
            {
                DNode input = phi.getOperand(i);
                DStore store = new DStore(name, input);
                NodeBlock pred = graph_[phi.block.lir.getPredecessor(i).id];
                pred.prepend(store);
            }

            phi.replaceAllUsesWith(name);
        }
Пример #3
0
        public override void visit(DPhi phi)
        {
            // Convert a phi into a move on each incoming edge. Declare the
            // temporary name in the dominator.
            var idom = graph_[phi.block.lir.idom.id];

            var name = new DTempName(graph_.tempName());

            idom.prepend(name);

            for (var i = 0; i < phi.numOperands; i++)
            {
                var input = phi.getOperand(i);
                var store = new DStore(name, input);
                var pred  = graph_[phi.block.lir.getPredecessor(i).id];
                pred.prepend(store);
            }

            phi.replaceAllUsesWith(name);
        }
Пример #4
0
 public virtual void visit(DPhi phi)
 {
 }
Пример #5
0
        private void joinRegs(Register reg, DNode value)
        {
            if (value == null || stack_.reg(reg) == value)
                return;
            if (stack_.reg(reg) == null)
            {
                stack_.set(reg, value);
                return;
            }

            DPhi phi;
            DNode node = stack_.reg(reg);
            if (node.type != NodeType.Phi || node.block != this)
            {
                phi = new DPhi(node);
                stack_.set(reg, phi);
                add(phi);
            }
            else 
            {
                phi = (DPhi)node;
            }
            phi.addInput(value);
        }
Пример #6
0
 public virtual void visit(DPhi phi) { }