While working on JDK-8293541 in Valhalla, I've noticed that we are missing try_clean_mem_phi() calls which prevents further optimizations due to not removing a diamond if-region.
The problem is that such a memory phi, which could be optimized by try_clean_mem_phi(), is currently only simplified if the region has exactly one phi. However, in certain IGVN worklist orders we get the following:
1) region is processed which multiple phis
2) the second last phi is removed from the region, only leaving the memory phi to be optimized
3) the memory phi does not make it to the worklist again
A solution could be to either readd the region to the IGVN list or to always transform a memory phi with try_clean_mem_phi() if a region forms a proper diamond.
The problem is that such a memory phi, which could be optimized by try_clean_mem_phi(), is currently only simplified if the region has exactly one phi. However, in certain IGVN worklist orders we get the following:
1) region is processed which multiple phis
2) the second last phi is removed from the region, only leaving the memory phi to be optimized
3) the memory phi does not make it to the worklist again
A solution could be to either readd the region to the IGVN list or to always transform a memory phi with try_clean_mem_phi() if a region forms a proper diamond.
- relates to
-
JDK-8293541 [lworld] IR verification fails for TestLWorld::test109_sharp and test110_sharp
- Resolved