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

C1 RangeCheckEliminator support constant array and NewMultiArray

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 17
    • 17
    • hotspot
    • b16
    • generic
    • generic

    Description

      C1 is missing range check elimination opportunities for constant array and NewMultiArray with compile-time constant length.

      With attached range_check.java, before and after fix

      multi new array
      before
      __bci__use__tid____instr____________________________________
        0 1 i2 800
      . 3 2 a3 new int array [i2]
        6 1 i4 600
        9 2 i5 2
      . 10 3 a6 new multi array [i4, i5] [[I
        16 1 i7 20
      . 18 1 a8 a6[i7] (L) [rc] // not optimized


      after
      __bci__use__tid____instr____________________________________
        0 0 i2 800
      . 3 0 a3 new int array [i2]
        6 0 i4 600
        9 0 i5 2
      . 10 0 a6 new multi array [i4, i5] [[I
        16 0 i7 20
      . 18 0 a10 a6[i7] (L) // optimized



      multi_constant_array_rc
      before:
      __bci__use__tid____instr____________________________________
        0 2 a6 <array 0x00007f7bb80367a0>
        3 2 i7 2
      . 4 2 a8 a6[i7] (L) [rc] // not optimized
        5 4 i9 3
      . 7 1 i10 a8[i9] (I) [rc]

      after:
      __bci__use__tid____instr____________________________________
        0 0 a6 <array 0x00007fece802e760>
        3 0 i7 2
        4 0 i9 3
      . 4 0 a10 a6[i7] (L) // optimized
      . 7 0 i12 a10[i9] (I) [rc]
        8 0 i13 5
        
      constant_array_rc
      before:
      __bci__use__tid____instr____________________________________
        0 3 a5 <array 0x00007f7bb80367a0>
        3 3 i6 1
      . 5 1 i7 a5[i6] (I) [rc] // not optimized
        6 1 i8 5
        7 1 i9 i7 + i8
      . 8 0 i10 a5[i6] := i9 (I)

      after:
      __bci__use__tid____instr____________________________________
        0 0 a5 <array 0x00007fece802e760>
        3 0 i6 1
        5 0 i8 15
      . 5 0 i9 a5[i6] (I) // optimized
        6 0 i10 5
        7 0 i11 i9 + i10
      . 8 0 i14 a5[i6] := i11 (I)

      Attachments

        Issue Links

          Activity

            People

              hshi Hui Shi
              hshi Hui Shi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: