RFR(S): 8241041: C2: "assert((Value(phase) == t) || (t != TypeInt::CC_GT && t != TypeInt::CC_EQ)) failed: missing Value() optimization" still happens after fix for 8239335
Roland Westrelin
rwestrel at redhat.com
Tue Mar 24 09:57:17 UTC 2020
http://cr.openjdk.java.net/~roland/8241041/webrev.00/
See the test case: at parse time, the type of the cloned object is not
accurate. The clone() intrinsic creates an Allocate node and a
CheckCastPP. The type of the CheckCastPP is AbstractClass. As
compilation proceeds the type of the allocation becomes known
(ConcreteSubClass1). The klass input to the Allocate node improves but
not the type of the CheckCastPP. Expanding the SubTypeCheck to a
LoadKlass + a CmpP can constant fold this pattern. The SubTypeCheck
can't because the current logic is based on the type of its inputs (so
AbstractClass in this case). Adding special handling for the pattern
where the SubTypeCheck input is an Allocate node fixes this.
Roland.
More information about the hotspot-compiler-dev
mailing list