use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.
the class BasicTruffleInliningTest method testDontInlineBigWithCallSites.
@Test
public void testDontInlineBigWithCallSites() {
// Do not inline a function if it's size * cappedCallSites is too big
// @formatter:off
TruffleInlining decisions = builder.target("callee", TruffleCompilerOptions.getValue(TruffleInliningMaxCallerSize) / 3).target("caller").calls("callee").calls("callee").calls("callee").buildDecisions(true);
// @formatter:on
assertNotInlined(decisions, "callee");
Assert.assertTrue("Wrong reason for not inlining!", decisions.getCallSites().get(0).getProfile().getFailedReason().startsWith("deepNodeCount * callSites >"));
}
use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.
the class BasicTruffleInliningTest method testInlineBigFunctions.
@Test
public void testInlineBigFunctions() {
// @formatter:off
TruffleInlining decisions = builder.target("callee", TruffleCompilerOptions.getValue(TruffleInliningMaxCallerSize) - 3).target("caller").calls("callee").buildDecisions();
// @formatter:on
assertInlined(decisions, "callee");
}
use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.
the class BasicTruffleInliningTest method testDontInlineBigFunctions.
@Test
public void testDontInlineBigFunctions() {
// @formatter:off
TruffleInlining decisions = builder.target("callee", TruffleCompilerOptions.getValue(TruffleInliningMaxCallerSize)).target("caller").calls("callee").buildDecisions();
// @formatter:on
assertNotInlined(decisions, "callee");
}
use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.
the class BasicTruffleInliningTest method testDoubleRecursiveInline.
@Test
public void testDoubleRecursiveInline() {
TruffleInlining decisions = builder.target("recursive").calls("recursive").calls("recursive").buildDecisions();
int n = TruffleCompilerOptions.getValue(TruffleMaximumRecursiveInlining).intValue();
// sum of geometric
long geometricSum = 2 * (1 - ((long) Math.pow(2, n))) / (1 - 2);
// progression a*r^n is
// (a(1-r^n))/(1-r)
// for 2*2^n it is
// 2*(1-2^n)/(1-2)
Assert.assertEquals(geometricSum, countInlines(decisions, "recursive"));
}
use of org.graalvm.compiler.truffle.runtime.TruffleInlining in project graal by oracle.
the class BasicTruffleInliningTest method testMultipleInline.
@Test
public void testMultipleInline() {
// @formatter:off
TruffleInlining decisions = builder.target("callee").target("caller").calls("callee").calls("callee").buildDecisions();
// @formatter:on
Assert.assertTrue(countInlines(decisions, "callee") == 2);
int inlineCount = 100;
builder.target("callee").target("caller", inlineCount);
for (int i = 0; i < inlineCount; i++) {
builder.calls("callee");
}
Assert.assertEquals(inlineCount, countInlines(builder.buildDecisions(), "callee"));
}
Aggregations