[lworld] RFR: 8351006: [lworld] Refactor LoadNode::Identity of an InlineType into can_see_stored_value [v2]

Christian Hagedorn chagedorn at openjdk.org
Wed Mar 5 12:38:08 UTC 2025


On Sun, 2 Mar 2025 18:27:18 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> This patch moves the logic of `LoadNode::Identity` that tries to look through an `InlineTypeNode` to `can_see_stored_value`. This also fixes 2 issues:
>> 
>> - `Identity` should not return a new node
>> - `LoadUS` from a `short` is not a mismatched access and hence can return a wrong value
>> 
>> Please take a look and leave your reviews, thanks a lot.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   assert non-larval

Nice refactoring!

> LoadUS from a short is not a mismatched access and hence can return a wrong value

Do you have a test case where we get a wrong execution? If so, it would be great to add it as well :-)

src/hotspot/share/opto/memnode.cpp line 1101:

> 1099: }
> 1100: 
> 1101: static Node* see_through_inline_type(PhaseValues* phase, const MemNode* load, Node* base, int offset) {

Is there a specific reason that you made this `static` and not a member function of `MemNode` (then you can use `this` instead of `load`)?

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

PR Review: https://git.openjdk.org/valhalla/pull/1387#pullrequestreview-2660967494
PR Review Comment: https://git.openjdk.org/valhalla/pull/1387#discussion_r1981311529


More information about the valhalla-dev mailing list