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

[IR Framework] applyIfCPUFeature should take precedence over applyIf

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 20
    • hotspot

      We'd like to support multiple @IR annotations targeting different platforms in IR Framework tests. For instance, consider the following annotations:

      @Test
      @IR(applyIfCPUFeature = {"sse", "true"},
          applyIfAnd = {"SuperWordReductions", "true", "UseSSE", ">= 1",
          "LoopMaxUnroll", ">= 8"},
          counts = {IRNode.MUL_REDUCTION_VF, ">= 1"})
      @IR(applyIfCPUFeature = {"sve", "true"},
          applyIfAnd = {"SuperWordReductions", "true", "UseSVE", ">= 1", "LoopMaxUnroll", ">= 8"},
          counts = {IRNode.MUL_REDUCTION_VF, ">= 1"})

      To co-locate tests from different platforms, we can use applyIfCPUFeature. To guard against failure when the user selects a non-default value for UseSVE/UseSSE, we check the corresponding flag as well in applyIfAnd. But UseSVE does not exist on x64, so the test will fail.

      One solution could be to re-arrange the order of checks in IREncodingPrinter.java, placing applyIf{and,or}CPUFeature before applyIf{,and,or}.

            dskantz Daniel Skantz
            dskantz Daniel Skantz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: