private void ClassifyInductionVariable(List <Node> scc) { RegionConstantFinder rc = new RegionConstantFinder(scc, ssaIds); Block header = null; foreach (Node n in scc) { if (header == null) // || header.RpoNumber > n.info.DefStatement.Block.RpoNumber) { header = n.info.DefStatement.Block; } } bool fInductionVariable = true; foreach (Node n in scc) { if (!rc.IsInductiveOperation(n.info.DefStatement)) { fInductionVariable = false; break; } } if (!fInductionVariable) { header = null; } /* * int x = 0; * foreach (Identifier id in scc) * { * if (fInductionVariable) * { * x += id.Number; * } * } */ }
private void ClassifyInductionVariable(List<Node> scc) { RegionConstantFinder rc = new RegionConstantFinder(scc, ssaIds); Block header = null; foreach (Node n in scc) { if (header == null) // || header.RpoNumber > n.info.DefStatement.Block.RpoNumber) header = n.info.DefStatement.Block; } bool fInductionVariable = true; foreach (Node n in scc) { if (!rc.IsInductiveOperation(n.info.DefStatement)) { fInductionVariable = false; break; } } if (!fInductionVariable) { header = null; } /* int x = 0; foreach (Identifier id in scc) { if (fInductionVariable) { x += id.Number; } } */ }