JDK-8327110 : Refactor create_bool_from_template_assertion_predicate() to separate class and fix identical cloning cases used for Loop Unswitching and Split If
  • 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-04-04
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 b17Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
`create_bool_from_template_assertion_predicate()` is currently hard to understand and does many things simultaneously. For the complete fix for assertion predicates (JDK-8288981), we need to adapt the algorithm which is difficult. 

On top of that, the current algorithm to do the DFS walk contains a bug which could lead to an endless DFS processing. The DFS implementation does not use a visited set. This means that we could visit a node twice and repeat previous work. In some edge cases (see attached EndlessDFS.java), we could spend a very long time in the DFS walk. The test case contains many diamonds which creates an exponential explosion of different paths which are all visited by the current DFS implementation. This is also fixed in the refactored code of this algorithm.

While the refactoring fixes the endless DFS problem, we do not replace all uses of `create_bool_from_template_assertion_predicate()`, yet. Loop Unswitching and Split If use `create_bool_from_template_assertion_predicate()` for pure cloning while the remaining cases also require a transformation of the OpaqueLoop* nodes. These remaining cases and the complete removal of `create_bool_from_template_assertion_predicate()` is done separately in JDK-8327111 which will then also completely fix the endless DFS problem.


Comments
Changeset: f26e4308 Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2024-04-04 06:04:49 +0000 URL: https://git.openjdk.org/jdk/commit/f26e4308992d989d71e7fbfaa3feb95f0ea17c06
04-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18293 Date: 2024-03-14 07:10:30 +0000
14-03-2024