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

C2: vectorization is sometimes skipped on loops where it would succeed

XMLWordPrintable

    • b08

      This showed up with some panama benchmarks.
      The following code snippet is not vectorized because vectorization is not even attempted after range check eliminations has eliminated all tests in the main loop body:

          public static void test1(byte[] dest, long[] src) {
              for (int i = 0; i < src.length; i++) {
                  if ((i < 0) || (8 > sizeBytes - i)) {
                      throw new IndexOutOfBoundsException();
                  }
                  UNSAFE.putLongUnaligned(dest, UNSAFE.ARRAY_BYTE_BASE_OFFSET + i * 8, src[i]);
              }
          }

            roland Roland Westrelin
            roland Roland Westrelin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: