public void IgAddEdge() { var ig = new InterferenceGraph(); var id1 = new Identifier("id1", PrimitiveType.Word32, null); var id2 = new Identifier("id2", PrimitiveType.Word32, null); ig.Add(id1, id2); Assert.IsTrue(ig.Interfere(id1, id2), "id1 inteferes with id2", null); Assert.IsTrue(ig.Interfere(id2, id1), "id2 inteferes with id1", null); }
public SsaLivenessAnalysis(SsaState ssa) { this.ssaIds = ssa.Identifiers; this.visited = new HashSet <Block>(); this.records = new Dictionary <Block, Record>(); this.defined = new Dictionary <Statement, List <Identifier> >(); this.interference = new InterferenceGraph(); BuildRecords(ssa.Procedure.ControlGraph.Blocks); BuildDefinedMap(ssaIds); BuildInterferenceGraph(ssaIds); }
public void BuildInterferenceGraph(SsaIdentifierCollection ssaIds) { interference = new InterferenceGraph(); foreach (SsaIdentifier v in ssaIds) { visited = new HashSet <Block>(); foreach (Statement s in v.Uses) { PhiFunction phi = GetPhiFunction(s); if (phi != null) { var p = phi.Arguments.First(e => e.Value == v.Identifier).Block; LiveOutAtBlock(p, v); } else { int i = s.Block.Statements.IndexOf(s); LiveInAtStatement(s.Block, i, v); } } } }
public void BuildInterferenceGraph(SsaIdentifierCollection ssaIds) { interference = new InterferenceGraph(); foreach (SsaIdentifier v in ssaIds) { visited = new HashSet<Block>(); foreach (Statement s in v.Uses) { PhiFunction phi = GetPhiFunction(s); if (phi != null) { int i = Array.IndexOf(phi.Arguments, v.Identifier); Block p = s.Block.Pred[i]; LiveOutAtBlock(p, v); } else { int i = s.Block.Statements.IndexOf(s); LiveInAtStatement(s.Block, i, v); } } } }
public SsaLivenessAnalysis2(Procedure proc, SsaIdentifierCollection ssa) { this.ssa = ssa; visitedBlocks = new Dictionary<Block, Block>(); interference = new InterferenceGraph(); }
public SsaLivenessAnalysis2(SsaState ssa) { this.ssa = ssa.Identifiers; visitedBlocks = new Dictionary <Block, Block>(); interference = new InterferenceGraph(); }
public SsaLivenessAnalysis2(Procedure proc, SsaIdentifierCollection ssa) { this.ssa = ssa; visitedBlocks = new Dictionary <Block, Block>(); interference = new InterferenceGraph(); }
public void IgCreate() { InterferenceGraph ig = new InterferenceGraph(); }