RFR: 8266746: C1: Replace UnsafeGetRaw with UnsafeGetObject when setting up OSR entry block [v3]

Dean Long dlong at openjdk.java.net
Wed May 26 05:42:20 UTC 2021


On Thu, 20 May 2021 02:44:10 GMT, Yi Yang <yyang at openjdk.org> wrote:

>> After JDK-8150921, most Unsafe{Get,Put}Raw intrinsic methods can be replaced by Unsafe{Get,Put}Object.
>> 
>> There is the only one occurrence where c1 refers UnsafeGetRaw among GraphBuilder::setup_osr_entry_block()
>> 
>> https://github.com/openjdk/jdk/blob/74fecc070a6462e6a2d061525b53a63de15339f9/src/hotspot/share/c1/c1_GraphBuilder.cpp#L3143-L3157
>> 
>> We can replace UnsafeGetRaw with UnsafeGetObject when setting up OSR entry block. After that, Unsafe{Get,Put}Raw can be completely removed  because no one refers to them.
>> 
>> (This patch actually does two things:
>> 1. `Replace UnsafeGetRaw with UnsafeGetObject when setting up OSR entry block` This is the only occurrence where c1 refers UnsafeGetRaw
>> 2. `Cleanup unused Unsafe{Get,Put}Raw code`
>> They are related so I put it together, but I still want to hear your suggestions, I will separate them into two patches if you think it is more reasonable)
>> 
>> Thanks!
>> Yang
>
> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   many nit

It looks like when JDK-8150921 was done, some micro-benchmarks were run, and @shipilev noticed a regression in C1 with constant null handling:
http://cr.openjdk.java.net/~shade/8150921/notes.txt
Looking over the code review:
https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2016-May/022767.html
I don't see any references to benchmark testing that would check for any regressions in the InlineUnsafeOps + OptimizeUnsafes optimization that 8150921 mostly bypassed. @vidmik 
Now this PR proposes to remove this mostly dead code.  I'm OK with that, since blindly reviving it risks hitting bitrot, but for compleness, perhaps we should file 2 followup RFEs:
1) investigate constant null C1 regression
2) measure if the dead InlineUnsafeOps + OptimizeUnsafes optimization is worth reviving in a later release (with sufficient bake time)

-------------

Changes requested by dlong (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3917



More information about the hotspot-gc-dev mailing list