RFR: 8328480: C2: SubTypeCheckNode in checkcast should use the klass constant of a unique concrete sub class [v2]
Christian Hagedorn
chagedorn at openjdk.org
Fri Apr 12 10:05:15 UTC 2024
On Thu, 11 Apr 2024 07:53:46 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> I could not find a test that shows a benefit by doing the improved check with code from `try_improve()` inside `SubTypeCheckNode::Value()`. The original patch only showed a win for mainline when we have two identical `SubTypeCheckNodes` such that they can common up with an improved constant. But this cannot be achieved when having the code in `SubTypeCheckNode::Value()`.
>>
>> I therefore suggest to revert back to the original version to directly plug in a better constant, if we find one with `try_improve()`, and just skip the other non-constant cases with `LoadKlass` etc.
>>
>> For the Valhalla bug, I can do the more sophisticated fix to improve `SubTypeCheckNode::Value()` with code from `try_improve()` but it does not seem worth for mainline. What do you think?
>
> Sounds good. Thanks for giving it a try.
> Since you mention fixing this in valhalla, do you expect it makes a difference there but not in mainline?
Ok great! I had another look at Valhalla and I think the constant improvement fix is all that is needed. I reverted the last commit to go back to the original patch.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18515#discussion_r1562334305
More information about the hotspot-compiler-dev
mailing list