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

Tobias Hartmann tobias.hartmann at oracle.com
Fri Apr 3 13:41:29 UTC 2020


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