JDK-8270071 : Add whitelist matching as opposed to blacklist matching with failOn
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-07-08
  • Updated: 2021-08-19
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
Description
An @IR rule can specify a blacklist with the failOn attribute. An idea would be to add the opposite of a whitelist attribute, for example, an attribute "accept" which fails when a non-whitelisted node is found. 

To avoid having to list all common nodes that are always present (like ParmNodes, ProjNode or the RootNode), one could also think about adding a skeleton pattern which matches all these nodes which the user can then feed into "accept":

@Test
@Arguments({Argument.RANDOM_EACH, Argument.RANDOM_EACH})
@IR(accept = {IRNode.SKELETON, IRNode.SUB})
public int simpleTwo(int a, int b) {
       return a - b;
}

The IRNode.SKELETON could also be applied by default such that the user does not need to specify it explicitly. The challenge will be to find a good skeleton to avoid false positives while not being too conservative by adding a lot of nodes.