RFR: 8304948: [vectorapi] C2 crashes when expanding VectorBox [v2]
Quan Anh Mai
qamai at openjdk.org
Fri Apr 21 18:23:47 UTC 2023
On Thu, 20 Apr 2023 05:22:35 GMT, Eric Liu <eliu at openjdk.org> wrote:
>> But that phi will have an incorrect input, because the return value of this call is used as an input of the transformed phi that uses this node?
>
>> But that phi will have an incorrect input, because the return value of this call is used as an input of the transformed phi that uses this node?
>
> the return value of this call is Phi1. Phi1 is used as an input of Phi2 which is used by Phi1 as well.
>
> The Phi cycle is not an incorrect shape, it's a normal case generated by some simple cases, e.g., I have a test case in this patch.
> When expanding VectorBox node, the purpose is to traverse the first input of VectorBox to locate Proj, and replace Proj with some other nodes. The first input of VectorBox can be a graph, contains Phi (maybe Phi cycle) and Proj.
>
> The process finding and replacing Proj is not in local graph, it creates a new graph at the same time. Return this visited node here is used to maintain that cycle. Besides Proj, nodes in graph should not be changed.
I do still not fully grasp it though. When `expand_vbox_helper` is called on `Phi1`, it creates `NewPhi1`, then it calls `expand_vbox_helper` on `Phi2`, a `NewPhi2` is created, then `expand_vbox_helper` is invoked again on `Phi1`, which it shortcircuits to return `Phi1`, which will be attached as an input of `NewPhi2`, at this step should the second invocation on `Phi1` returns `NewPhi1` instead?
Thanks a lot.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13489#discussion_r1174052778
More information about the hotspot-compiler-dev
mailing list