JDK-8352635 : Improve inferencing of Float16 operations with constant inputs
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: generic
  • Submitted: 2025-03-21
  • Updated: 2025-07-21
  • Resolved: 2025-06-26
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 26
26 b05Fixed
Related Reports
Causes :  
Causes :  
Causes :  
Duplicate :  
Relates :  
Description
Currently, we do not infer Float16-specific IR for the following source pattern.

SRC = Float16.valueOf(src[i]);
RES = Float16.max(SRC, Float16.NaN)

The reason is that the current scheme to detect Float16 operations for some of the operations is based on generic pattern matching. In the above case, the second argument gets constant folded to a Float constant, thus bypassing the existing pattern, which expects the inputs to be ConvHF2F.


Comments
Changeset: a49ecb26 Branch: master Author: Jatin Bhateja <jbhateja@openjdk.org> Date: 2025-06-26 15:42:43 +0000 URL: https://git.openjdk.org/jdk/commit/a49ecb26c5ff2f949851937f3bb036d7946a103e
26-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/24179 Date: 2025-03-23 19:16:22 +0000
11-05-2025

Here is the link to draft PR https://github.com/openjdk/jdk/pull/24179
23-03-2025