JDK-8078563 : Restrict reduction optimization
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: x86
  • Submitted: 2015-04-23
  • Updated: 2017-10-03
  • Resolved: 2015-05-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b66Fixed
Related Reports
Relates :  
Relates :  
Description
Reduction vector optimization could be expensive for simple expressions because it uses several additional instructions per vector. For example, simple test shows that only int[] multiply has benefit from this optimization (see below). We need to restrict reduction optimization only to cases when it is beneficial.


On SB (AVX1):

java -XX:-SuperWordReductions -XX:-TieredCompilation -Xbatch -XX:CompileCommand=exclude,Reduction::main Reduction
Warmup ...
 Warmup is done in 1160 msec
sum int:    121
sum long:   120
sum float:  362
sum double: 353
mul int:    356
mul long:   357
mul float:  593
mul double: 588

java -XX:+SuperWordReductions -XX:-TieredCompilation -Xbatch -XX:CompileCommand=exclude,Reduction::main Reduction
Warmup ...
 Warmup is done in 1216 msec
sum int:    123
sum long:   119
sum float:  436
sum double: 407
mul int:    204
mul long:   349
mul float:  669
mul double: 639


On NHM (AVX2):

java -XX:-SuperWordReductions -XX:-TieredCompilation -Xbatch -XX:CompileCommand=exclude,Reduction::main Reduction
Warmup ...
 Warmup is done in 1408 msec
sum int:    139
sum long:   139
sum float:  412
sum double: 412
mul int:    412
mul long:   412
mul float:  686
mul double: 686

java -XX:+SuperWordReductions -XX:-TieredCompilation -Xbatch -XX:CompileCommand=exclude,Reduction::main Reduction
Warmup ...
 Warmup is done in 1340 msec
sum int:    123
sum long:   139
sum float:  412
sum double: 412
mul int:    209
mul long:   412
mul float:  686
mul double: 687