New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8229897: [lworld] C1 should avoid allocation when reading a field from a flattened field #167
Conversation
|
@fparain This change now passes all automated pre-integration checks, type
There are currently no new commits on the
|
Thanks Tobias! Fred |
/integrate |
Please review this patch which removes temporary heap allocations when reading a field from a flattened field.
During the HIR graph construction, C1 detects sequences of consecutive getfield bytecodes involving flattened fields and optimizes them with a single LoadField or NewInlineTypeInstance directly to the offset of the last nested field.
Performance improvement on a simple benchmark
Without the optimization:
Benchmark Mode Samples Score Score error Units
o.s.MyBenchmark.testGetfieldChain1 avgt 200 8.696 0.024 ns/op
o.s.MyBenchmark.testGetfieldChain2 avgt 200 8.969 0.027 ns/op
With the optimization:
Benchmark Mode Samples Score Score error Units
o.s.MyBenchmark.testGetfieldChain1 avgt 200 2.134 0.019 ns/op
o.s.MyBenchmark.testGetfieldChain2 avgt 200 5.150 0.017 ns/op
Tested with Mach5, tiers 1 to 3.
Thank you,
Fred
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/valhalla pull/167/head:pull/167
$ git checkout pull/167