Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8294279

[IR Framework] Generalize check precondition language

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 20
    • hotspot

      Currently, pre-conditions to apply IR checks to a test can be expressed using the following constructs:

      applyIf = {FLAG, VALUE}
      applyIfNot = {FLAG, VALUE}
      applyIfAnd = {FLAG1, VALUE1, FLAG2, VALUE2, ...}
      applyIfOr = {FLAG1, VALUE1, FLAG2, VALUE2, ...}
      applyIfCPUFeature = {CPU_FEATURE, VALUE}
      applyIfCPUFeatureAnd = {CPU_FEATURE, VALUE1, CPU_FEATURE, VALUE2, ...}
      applyIfCPUFeatureOr = {CPU_FEATURE, VALUE1, CPU_FEATURE, VALUE2, ...}

      It would be more powerful, and simpler for the user, to provide a single construct

      applyIf = "EXPR"

      where EXPR is a general logical expression allowing the user to mix CPU feature conditions, flags, os conditions, etc. For example:

      @IR(applyIf "vm.compiler2.enabled & (vm.cpu.features ~= '.*avx2.*' | vm.cpu.features ~= ".*sve.*) & vm.opt.LoopMaxUnroll > 0", ...

      As hinted in the example, pre-conditions could use the same language used by jtreg to express test requirements ("@requires"). The jtreg parser itself (https://github.com/openjdk/jtreg/blob/master/src/share/classes/com/sun/javatest/regtest/config/Expr.java) could perhaps be reused by the test IR framework.

            Unassigned Unassigned
            rcastanedalo Roberto Castaneda Lozano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: