JDK-8307768 : Constant fold IfNode's based on domination information
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-05-09
  • Updated: 2023-06-12
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
Improve reasoning at branches so that the compiler can be more efficient at eliminating conditional jumps. This helps eliminate branches in a more rigorous manner, such as in these complex cases:

- x < y and y < z -> x < z
- x < z and y < z -> Phi(x, y) < z
- 0 < x < y and 0 < x + k < y with k > 0 -> 0 < x + i < y for all 0 <= i <= k

A possible approach is to use a truth table, representing the relationships between the variables in each control node, this table can be filled in walking down the dominator path, and be used to eliminate conditional branches which cannot be inferred from constant bounds only. This concept can be found at [Go's prove pass](https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/prove.go). I think this can be done pessimistically and optimistically along with IterGVN if the cost seems reasonable.
Comments
Thanks for checking, Roland.
10-05-2023

I don't expect JDK-8275202 to address these ones.
10-05-2023

This might be fixed by JDK-8275202 [~roland] is working on.
10-05-2023