JDK-8324226 : [IR framework] Support matching nested IR nodes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2024-01-19
  • Updated: 2024-01-22
  • Resolved: 2024-01-22
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
tbdFixed
Related Reports
Relates :  
Description
See this thread https://github.com/openjdk/jdk/pull/17375#discussion_r1456368613

For example, it would be great if we can match `a - b == c` with something like 

```
@IR(counts = {IRNode.CMP_LT[IRNode.ANY, IRNode.SUB_I, IRNode.ANY], "1"}
```

The arguments in the [] are the inputs. IRNode.ANY matches any node. (The zero'th node is ANY because its the region node).
Comments
Thanks. Issues are trying to solve same problem. Left a comment on that issue.
22-01-2024

This would require parsing the entire IR. Then we probably just want to go down the path of JDK-8265198. Not sure if there is enough demand to make this worth pursuing given that the IR framework was designed to work on simple matching patterns.
22-01-2024