RFR(S): 8141137: C2 fails rematerializing nodes using flag registers.

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Tue Nov 3 14:36:28 UTC 2015


This change fixes an issue with rematerializing nodes that have a single
RegFlags input.

Please review this change. I please need a sponsor.

We see assert(false, "attempted to spill a non-spillable item") running jck tests with the ppc64 port.
This assertion in get_spillcopy_wide() is reached from split_Rematerialize() that inserts a SpillCopy
of kind InputToRematerialization into the prolonged live range. In the opt build this results
in a not compilable method.

In our case, 'def' is a node consuming a condition register defined by 'in'.  Get_spillcopy_wide()
aborts because condition registers (Op_RegFlags) can not be spilled.

As register allocation can not spill condition registers, it will rematerialize 'in' later on, too.
So actually, the SpillCopy in the prolonged live range is not needed.

As a fix, we skip adding the SpillCopy in case split_Rematerialze handles an operation consuming a condition register.
We only do so, if the 'in' can be rematerialized, too.  Else we assert and stop the compilation as before.

Also, this change adds code in rematerialize () that avoids that this pattern causes several live ranges to be stretched.

(I like a lot the detailed naming of the SpillCopy nodes!)

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20151103/75acdd87/attachment.html>

More information about the hotspot-compiler-dev mailing list