Inlining in Graal
Juan José Fumero Alfonso
jjfumero at gmail.com
Thu Nov 14 07:54:09 PST 2013
Hi,
I am working on Inlining with Graal in my backend. Using the Log
information:
-XX:+BootstrapGraal -G:Log=InliningDecisions -XX:+PrintCompilation
I get this:
[thread:1] scope:
[thread:1] scope: Inlining
[thread:1] scope: Inlining.Inlining
[thread:1] scope: Inlining.Inlining.InliningDecisions
* inlining MapEngineOpenCL.kernelComputation at 11: exact
com.edinburgh.parallel.map.MapEngineOpenCL.checkInline(int):int: trivial
(relevance=1.000000, probability=1.000000, bonus=1.000000, nodes=6) *
With this code:
// Testing
public void kernelComputation(int[] input, int[] output) {
for (int i = 0; i < input.length; i++) {
* output[i] = checkInline(input[i]);*
}
}
private int checkInline(int a) {
return 10 + a;
}
So in this case the inlining is working and also the result in my program
is correct. But what I want to do is the following:
public void kernelComputation(T[] input, T[] output) {
for (int i = 0; i < input.length; i++) {
*output[i] = mInterface.f(input[i]);*
}
}
And the method f is defined dynamically by the user:
Integer[] result = Map.apply(data, new MapInterface<Integer>() {
@Override
* public Integer f(Integer data) { return data *
data; }*
}).executeOpenCL();
What I want to do is the inlining of the f method which is defined
dynamically by the user.
[thread:1] scope:
[thread:1] scope: Inlining
[thread:1] scope: Inlining.InliningDecisions
* not inlining MapEngineOpenCL.kernelComputation at 14:
com.edinburgh.parallel.map.MapInterface.f(Object):Object (0 bytes): no type
profile exists*
I do not understand why "no type profile exists". Any idea about this? I am
doing the inlining as Graal shows in the tests
(com.oracle.graal.compiler.test.inlining).
Thank you very much
Juanjo
More information about the graal-dev
mailing list