RFR(S): 8223581: C2 compilation failed with assert(!q->is_MergeMem())
tobias.hartmann at oracle.com
Wed May 22 09:35:32 UTC 2019
please review the following patch:
We hit an assert during parsing with incremental inlining when merging memory edges into a target
block because of a MergeMem that has another MergeMem as input. The root cause is the same as with
8221592 : After the fix for 8059241 , we don't always execute a round of PhaseRemoveUseless /
IGVN after incremental inlining and as a result, MergeMems that feed into other MergeMems are not
cleaned immediately (but they are on the IGVN worklist and will be cleaned up eventually).
To not confuse the parser, we need to remove them eagerly. This is already done in
GraphKit::replace_call() for the non-exceptional memory edge but the implementation misses to also
handle the exceptional case.
Instead of a Node_List, I'm now using a Unique_Node_List to avoid the costly contains() call that
has O(n) complexity.
I've verified the fix by many runs of the api/java_lang JCK tests and testing on relevant tiers.
More information about the hotspot-compiler-dev