use of org.graalvm.compiler.loop.LoopsData in project graal by oracle.
the class LoopsDataTest method testInnerFirst.
@Test
public void testInnerFirst() {
LoopsData loops = getLoopsData();
Set<LoopEx> seen = new HashSet<>();
for (LoopEx loop : reversed(loops.outerFirst())) {
assertFalse(seen.contains(loop), "%s has already been seen", loop);
if (loop.parent() != null) {
assertFalse(seen.contains(loop.parent()), "%s's parent (%s) should not have already been seen", loop, loop.parent());
}
seen.add(loop);
}
}
use of org.graalvm.compiler.loop.LoopsData in project graal by oracle.
the class LoopsDataTest method sanityTests.
@Test
public void sanityTests() {
LoopsData loops = getLoopsData();
Assert.assertEquals(8, loops.outerFirst().size());
Assert.assertEquals(1, loops.outerFirst().get(0).loop().getDepth());
Assert.assertEquals(1, loops.outerFirst().get(1).loop().getDepth());
Assert.assertEquals(2, loops.outerFirst().get(2).loop().getDepth());
Assert.assertEquals(3, loops.outerFirst().get(3).loop().getDepth());
Assert.assertEquals(2, loops.outerFirst().get(4).loop().getDepth());
Assert.assertEquals(2, loops.outerFirst().get(5).loop().getDepth());
Assert.assertEquals(3, loops.outerFirst().get(6).loop().getDepth());
Assert.assertEquals(4, loops.outerFirst().get(7).loop().getDepth());
for (LoopEx loop : loops.loops()) {
if (loop.parent() != null) {
Assert.assertEquals(loop.parent().loop().getDepth() + 1, loop.loop().getDepth());
}
}
}
Aggregations