[15] RFR(S): 8241997: Scalar replacement of cloned array is broken after JDK-8238759

Nils Eliasson nils.eliasson at oracle.com
Fri Apr 3 15:29:07 UTC 2020


Hi,

Nice find - but not all changes in macro.cpp seems related to what was 
caused by JDK-8238759. What are the additional changes in 
PhaseMacroExpand::process_users_of_allocation and 
PhaseMacroExpand::can_eliminate_allocation motivated by?

Regards,
Nils


On 2020-04-03 15:41, Tobias Hartmann wrote:
> Hi,
>
> please review the following patch:
> https://bugs.openjdk.java.net/browse/JDK-8241997
> http://cr.openjdk.java.net/~thartmann/8241997/webrev.00/
>
> When merging the fix for JDK-8238759 [1] into the Valhalla repo, we've noticed that some of our test
> started to fail because their C2 IR matching rules detected that cloned, non-escaping array
> allocations are no longer scalar replaced (for example, [2]).
>
> The problem is that the scalar replacement code still expects ArrayCopyNode::Dest to be an AddPNode.
> I've verified that my fix re-enables scalar replacement. The related Valhalla tests now pass.
>
> Thanks,
> Tobias
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8238759
> [2]
> http://hg.openjdk.java.net/valhalla/valhalla/file/00010b44d679/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestArrays.java#l672



More information about the hotspot-compiler-dev mailing list