On Fri, 20 Mar 2026 06:59:59 GMT, Emanuel Peter <[email protected]> wrote:

>> The prototype 
>> https://github.com/erifan/jdk/pull/new/JDK-8380424-miss-identity-opt
>> 
>> Hi @eme64, the code for adding all nodes to the IGVN worklist is here. I 
>> personally think it's better to handle this issue separately, so I've 
>> separated it from this PR for now. If you think combining them would be more 
>> appropriate, I'd be happy to add the relevant changes to this PR.
>> 
>> To be honest, the above changes don't fundamentally solve this 
>> Ideal/Identity missing problem; they only address it at this point (boxing 
>> elimination). Of course, given the special nature of the VectorAPI (which is 
>> greatly impacted by inlining and boxing), I think this approach is 
>> reasonable.
>> 
>> And I'm also considering whether there is a more thorough solution, such as 
>> adding all nodes to the worklist and performing a full IGVN run in 
>> `PhaseRemoveUseLess`. Of course, the most important thing here is how to 
>> balance compilation time and performance.
>
> @erifan Yes, please do it separately, probably before this PR, right?
> 
> Right, there are two parts to this - they can be separate tasks:
> - After boxing elimination, we should make sure that all vector nodes (better 
> all nodes) are put on the worklist. This has some cost, but I think it is 
> acceptable. We could also make this conditional: only do it if you find any 
> vectors in the graph.
> - We need to improve notification during IGVN, so that IGVN optimizations 
> that traverse more than a single hop always get triggered. We can verify that 
> with `VerifyIterativeGVN`.

@eme64  I hope this PR can be merged into the mainline first, so I can easily 
write a stress test using this optimization. I noticed that [phaseX.cpp 
line2053](https://github.com/openjdk/jdk/blob/7e943e7d41ee8175660e236c4b7fe39604fdae2f/src/hotspot/share/opto/phaseX.cpp#L2053)
 mentioned a similar issue with `AndV`, but I tested 
[VectorLogicalOpIdentityTest.java](https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/compiler/vectorapi/VectorLogicalOpIdentityTest.java)
 100 times and it passed every time. You added this comment, do you remember 
which test failed then?

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

PR Comment: https://git.openjdk.org/jdk/pull/28313#issuecomment-4096206000

Reply via email to