public void VisitPhiAssignment(PhiAssignment phi) { writer.Indent(); WriteExpression(phi.Dst); writer.Write(" = "); WriteExpression(phi.Src); writer.Terminate(); }
public override Instruction TransformPhiAssignment(PhiAssignment phi) { // Only rename the defined variable in phi-functions. // The arguments of the phi-function will be renamed // elsewhere. Identifier id = phi.Dst; phi.Dst = NewDef(id, phi.Src, false); return phi; }
public void VisitPhiAssignment(PhiAssignment p) { Identifier idDst = (Identifier) p.Dst; PhiFunction phi = p.Src; for (int i = 0; i < phi.Arguments.Length; ++i) { Identifier id = (Identifier) phi.Arguments[i]; Block pred = stmCur.Block.Pred[i]; if (id != idDst) Merge(webOf[idDst], webOf[id]); } }
public void VisitPhiAssignment(PhiAssignment phi) { throw new NotImplementedException(); }
public void Transform(Statement stm, PhiAssignment phi) { Identifier idDst = (Identifier) phi.Dst; for (int i = 0; i < phi.Src.Arguments.Length; ++i) { Identifier id = (Identifier) phi.Src.Arguments[i]; Block pred = stm.Block.Pred[i]; if (idDst != id) { if (IsLiveAtCopyPoint(idDst, pred)) { int idx = IndexOfInsertedCopy(pred); Identifier idNew = InsertAssignmentNewId(idDst, pred, idx); RenameDominatedIdentifiers(ssaIds[idDst], ssaIds[idNew]); } else if (IsLiveOut(id, stm)) { phi.Src.Arguments[i] = idDst; int idx = IndexOfInsertedCopy(pred); Identifier idNew = InsertAssignment(idDst, id, pred, idx); } } } }
public override Instruction TransformPhiAssignment(PhiAssignment phi) { for (int i = 0; i < phi.Src.Arguments.Length; ++i) { Identifier idSrc = (Identifier) phi.Src.Arguments[i]; ssaIds[idSrc].Uses.Remove(stmDef); wl.Add(idSrc); } return phi; }
private void ProcessPhi(PhiAssignment phi, Queue<Identifier> worklist) { foreach (Identifier id in phi.Src.Arguments) { worklist.Enqueue(id); } }
public void VisitPhiAssignment(PhiAssignment phi) { throw new NotImplementedException(); }
public DataType VisitPhiAssignment(PhiAssignment phi) { phi.Src.Accept(this); phi.Dst.Accept(this); return(handler.EqualTrait(phi.Dst, phi.Src)); }
public override void VisitPhiAssignment(PhiAssignment phi) { phi.Src.Accept(this); phi.Dst.Accept(this); store.MergeClasses(phi.Src.TypeVariable, phi.Dst.TypeVariable); }
public Instruction VisitPhiAssignment(PhiAssignment phi) { throw new NotImplementedException(); }
void InstructionVisitor.VisitPhiAssignment(PhiAssignment phi) { stms.Add(new AbsynLineComment(phi.ToString())); }
public Instruction VisitPhiAssignment(PhiAssignment phi) { return(se.VisitPhiAssignment(phi)); }
public Instruction VisitPhiAssignment(PhiAssignment phi) { throw new NotSupportedException("PhiAssignments shouldn't have been generated yet."); }
public void VisitPhiAssignment(PhiAssignment phi) { d.VisitPhiAssignment(phi); }
public override void VisitPhiAssignment(PhiAssignment phi) { phi.Src.Accept(this); node.definingExpr = phi.Src; }
public void VpPhiWithConstants() { Constant c1 = Constant.Word16(0x4711); Constant c2 = Constant.Word16(0x4711); Identifier r1 = Reg16("r1"); Identifier r2 = Reg16("r2"); Identifier r3 = Reg16("r3"); var stm1 = new Statement(1, new Assignment(r1, c1), null); var stm2 = new Statement(2, new Assignment(r2, c2), null); var proc = new Procedure("foo", arch.CreateFrame()); var ssa = new SsaState(proc, null); var r1Sid = ssa.Identifiers.Add(r1, null, null, false); var r2Sid = ssa.Identifiers.Add(r2, null, null, false); r1Sid.DefStatement = stm1; r2Sid.DefStatement = stm2; var vp = new ValuePropagator(arch, ssa); Instruction instr = new PhiAssignment(r3, new PhiFunction(r1.DataType, r1, r2)); instr = instr.Accept(vp); Assert.AreEqual("r3 = 0x4711", instr.ToString()); }
public void VpPhiWithConstants() { Constant c1 = Constant.Word16(0x4711); Constant c2 = Constant.Word16(0x4711); Identifier r1 = Reg16("r1"); Identifier r2 = Reg16("r2"); Identifier r3 = Reg16("r3"); var stm1 = new Statement(1, new Assignment(r1, c1), null); var stm2 = new Statement(2, new Assignment(r2, c2), null); ssaIds[r1].DefStatement = stm1; ssaIds[r2].DefStatement = stm2; var vp = new ValuePropagator(arch, ssaIds, null); Instruction instr = new PhiAssignment(r3, new PhiFunction(r1.DataType, r1, r2)); instr = instr.Accept(vp); Assert.AreEqual("r3 = 0x4711", instr.ToString()); }
public override void VisitPhiAssignment(PhiAssignment phi) { phi.Src.Accept(this); phi.Dst.Accept(this); store.MergeClasses(phi.Src.TypeVariable, phi.Dst.TypeVariable); }
void InstructionVisitor.VisitPhiAssignment(PhiAssignment phi) { stms.Add(new AbsynLineComment(phi.ToString())); }
public virtual void VisitPhiAssignment(PhiAssignment phi) { phi.Src.Accept(this); phi.Dst.Accept(this); }
public override void VisitPhiAssignment(PhiAssignment phi) { base.VisitPhiAssignment(phi); definitions.Add(phi.Dst); }