8386769: [lworld] C2 parts of JDK-8350865 - Part. 2 - #32146
8386769: [lworld] C2 parts of JDK-8350865 - Part. 2#32146marc-chevalier wants to merge 25 commits into
Conversation
…ality', 'JDK-8386769.do_aload', 'JDK-8386769.inline_unsafe_flat_access', 'JDK-8386769.intrinsics', 'JDK-8386769.null_free_atomic_array_test', 'JDK-8386769.phaseX', 'JDK-8386769.replay', 'JDK-8386769.subtypenode', 'JDK-8386769.test-flat-in-arrays-folding' and 'JDK-8386769.test-lworld' into JDK-8386769
|
👋 Welcome back mchevalier! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
|
|
@marc-chevalier The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
This PR replaces the Valhalla draft PR openjdk/valhalla#2653, which was already reviewed by @TobiHartmann but was not integrated due to the code freeze immediately before the Valhalla mainline integration.
PhaseIterGVN::add_users_of_use_to_worklist / PhaseCCP::push_cast
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/opto/phaseX.cpp#L2819
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/opto/phaseX.cpp#L3236
I think that is needed, it's not trivial to make fail without it, but reading code, it must be useful.
ciTypeFlow::StateVector::do_aload
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/ci/ciTypeFlow.cpp#L603
I've did that, I think.
ciReplay.cpp
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/ci/ciReplay.cpp#L517
For that, I just check objArray, not only refArray. Getting from a objArray does the dispatch. It shouldn't be harder than that.
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/ci/ciReplay.cpp#L1143-L1145
This one is less direct. So now, I dump the flatness of the array as
reforflat, and the nullability (nullableornull-free). After that, if the array is flat, I add atomicity (atomicornon-atomic). On parsing, I get all these pieces into a anArrayPropertiesgiven to theoopFactory::new_*Array.TestIntrinsics.java
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestIntrinsics.java#L2038-L2040
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestIntrinsics.java#L2056-L2058
That was already done, it seems:
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/opto/library_call.cpp#L4907-L4910
TestFlatInArraysFolding.java
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestFlatInArraysFolding.java#L81
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestFlatInArraysFolding.java#L168
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestFlatInArraysFolding.java#L285
Since the important part is that classes are more of less flattable on a setting, I've tried to replace
FlatArrayElementMaxSizewithFlatArrayElementMaxOops.TestBasicFunctionality.java
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestBasicFunctionality.java#L578-L581
It looks like it works now, but it should be 3, not 2. I've commented why, and I think it's behaving as it should.
TestLWorld.java
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestLWorld.java#L4646
I've quadruplicated the test for different kind of factories. I've also made sure the flatness hypotheses are still matched with nullable arrays, so I needed to shrink the classes.
SubTypeCheckNode::sub
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/opto/subtypenode.cpp#L50
I think it's good actually. We are already using that inside
Compile::static_subtype_check, called a bit lower, but we just need a bit of preparation. We could put that in a method of the type system, but for which benefit? I suggest we keep it as it is for nowParse::array_store
We could, but we didn't do. It would only matter when the array element has no null-free layout (atomic or non-atomic), but the array is not provably non-flat, which means, there is a nullable layout. That seems unlikely at the very least, or rather impossible in the current state of things.
The experimental patch, for record
At least, we can remove the last parametert of
inline_array_null_guardsince we are not doing this change.GraphKit::null_free_atomic_array_test
https://github.com/openjdk/valhalla/blob/53ef1bfa0951e5cc1eeb064026eb0d73329e7c5e/src/hotspot/share/opto/graphKit.cpp#L3985
It's a comment from a time with less testing. Let's not add one more
LibraryCallKit::inline_unsafe_flat_access
This seems to be a bigger piece. I've filed JDK-8388444 for now.
Thanks,
Marc
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32146/head:pull/32146$ git checkout pull/32146Update a local copy of the PR:
$ git checkout pull/32146$ git pull https://git.openjdk.org/jdk.git pull/32146/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32146View PR using the GUI difftool:
$ git pr show -t 32146Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32146.diff
Using Webrev
Link to Webrev Comment