app.cfg.createNode(1);
new BasicBlockEdge(app.cfg, 0, 2);
System.out.println("15000 dummy loops");
for (int dummyloop = 0; dummyloop < 15000; dummyloop++) {
HavlakLoopFinder finder = new HavlakLoopFinder(app.cfg, app.lsg);
finder.findLoops();
}
System.out.println("Constructing CFG...");
int n = 2;
for (int parlooptrees = 0; parlooptrees < 10; parlooptrees++) {
app.cfg.createNode(n + 1);
app.buildConnect(2, n + 1);
n = n + 1;
for (int i = 0; i < 100; i++) {
int top = n;
n = app.buildStraight(n, 1);
for (int j = 0; j < 25; j++) {
n = app.buildBaseLoop(n);
}
int bottom = app.buildStraight(n, 1);
app.buildConnect(n, top);
n = bottom;
}
app.buildConnect(n, 1);
}
app.getMem();
System.out.format("Performing Loop Recognition\n1 Iteration\n");
HavlakLoopFinder finder = new HavlakLoopFinder(app.cfg, app.lsg);
finder.findLoops();
app.getMem();
System.out.println("Another 50 iterations...");
for (int i = 0; i < 50; i++) {
System.out.format(".");
HavlakLoopFinder finder2 = new HavlakLoopFinder(app.cfg, new LSG());
finder2.findLoops();
}
System.out.println("");
app.getMem();
System.out.println("# of loops: " + app.lsg.getNumLoops() +