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

Optimize use of CMOVE instructions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • hs23
    • 8-pool
    • hotspot
    • None
    • b06
    • generic
    • generic
    • Not verified

        Performance testing of 6890673 implementation showed a regression in scimark.Monte:

          Benchmark Samples Mean Stdev %Diff P Significant
            Monte 20 411.60 1.49 -14.91 0.000 Yes

        By analyzing generated code I found that it is caused by generated CMOVE instruction:

        338 movl RBX, R10 # spill
        33b decl RBX # int
        33d testl R10, R10
        340 movl R10, RBX # spill
        343 cmovle R10, RDX # signed, int

        instead of branch and increment with infrequent code (movl R10, #16) moved from hot path by BlockLayoutByFrequency optimization:

        298 B44: # B56 B45 <- B43 Freq: 69040
        298 testl R10, R10
        29b je B56 P=0.058864 C=8749.000000
        29b
        2a1 B45: # B46 <- B44 Freq: 64976.1
        2a1 decl R10 # int
        2a4
        2a4 B46: # B58 B47 <- B45 B56 Freq: 69040

        ...

        34a B56: # B46 <- B44 Freq: 4063.96
        34a movl R10, #16 # int
        350 jmp B46

              kvn Vladimir Kozlov
              kvn Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: