Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2217895 | 8 | Vladimir Kozlov | P4 | Resolved | Fixed | b15 |
JDK-2217894 | 7u4 | Vladimir Kozlov | P4 | Closed | Fixed | b02 |
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
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
- backported by
-
JDK-2217895 Optimize use of CMOVE instructions
- Resolved
-
JDK-2217894 Optimize use of CMOVE instructions
- Closed
- relates to
-
JDK-6890673 Eliminate allocations immediately after EA
- Closed
-
JDK-8034833 Strange performance behaviour of cmov vs branch on x86
- Open