Exemplo n.º 1
0
		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);
		}
Exemplo n.º 2
0
		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);
					}
				}
			}
		}
Exemplo n.º 3
0
		public SsaLivenessAnalysis2(Procedure proc, SsaIdentifierCollection ssa)
		{
			this.ssa = ssa;
            visitedBlocks = new Dictionary<Block, Block>();
			interference = new InterferenceGraph();
		}
Exemplo n.º 4
0
		public void IgCreate()
		{
			InterferenceGraph ig = new InterferenceGraph();
		}