JDK-8327109 : Refactor data graph cloning used in create_new_if_for_predicate() into separate class
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-03-01
  • Updated: 2024-04-22
  • Resolved: 2024-03-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 23
23 b14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
`create_new_if_for_predicate()` calls `clone_nodes_with_same_ctrl()` which does some data graph cloning by using the following three steps/passes:

1. Collect data nodes to clone by using a node filter
2. Clone the collected nodes (their data inputs still point to the old nodes)
3. Fix the cloned data inputs pointing to the old nodes to the cloned inputs by using an old->new mapping. In this pass, also fix the control inputs of any pinned data from the old uncommon projection to the new one.

This RFE should now extract the data node cloning steps to a separate class in order to reuse that when refactoring and fixing `create_bool_from_template_assertion_predicate()` which is currently hard to understand and contains a bug of endless processing in edge cases (see JDK-8327110).

The extracted data node cloning class should do the following core cloning in two steps:
1. Take a collection of data nodes (the collection step is different in `clone_nodes_with_same_ctrl()` compared to `create_bool_from_template_assertion_predicate()` and can thus not be shared) and clone them. [Same as step 2 above]
2. Fix the cloned data inputs pointing to the old nodes to the cloned inputs by using an old->new mapping. [Same as first part of step 3 above but drop the second part which is specific to `clone_nodes_with_same_ctrl()`]
Comments
Changeset: 7d8561d5 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2024-03-13 13:58:47 +0000 URL: https://git.openjdk.org/jdk/commit/7d8561d56bf064e388417530b9b71755e4ac3f76
13-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18080 Date: 2024-03-01 13:27:38 +0000
01-03-2024