United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6636138 UseSuperWord enabled failure
JDK-6636138 : UseSuperWord enabled failure

Details
Type:
Bug
Submit Date:
2007-11-30
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
windows_vista,generic
Sub-Component:
compiler
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u4,6u10
Fixed Versions:
hs15 (b05)

Related Reports
Backport:
Backport:
Duplicate:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
Licensee has reported the following, during efforts to port their current VM to Java 6.

From Licensee:

During our efforts to port our current XXXJVM to Java 6.  During the execution of this
task, I have come across a problem connected with the UseSuperWord option.  I noticed
that this option is disabled by default in the latest version, namely 4 b06.  
Nevertheless, I wanted to draw your attention to the enclosed test case.  The program
runs forever, thus the method initialize_int_arraycopy will occasionally get compiled.
Execution of the compiled code fails on a super word enabled VM.  The erronous code
performs an incorrect value copy, which is later discovered in the method
checkandfail_int_arraycopy.  However, the test case is correctly executed if the
UseSuperWord option is deactivated.  See attached testcase, (arraycopytest.java)

                                    

Comments
EVALUATION

This appears to be a previously unreported problem since it happens in 1.7 as well.  It looks like the memory graph surgery that's performed to group the vectorizable memory operations is losing a couple of the stores in the slices that weren't vectorized.
                                     
2007-12-03
EVALUATION

Yes, it is the memory graph surgery problem. When we group a set of vectorized instruction together, we have to move the sandwitched instructions outside
the group, meaning we have to adjust the memory input/output. This memory graph surgery should be performed based upon data dependence analysis.
I have developed a new superword scheduling algorithm to handle this.
                                     
2009-03-12
EVALUATION

Here is the problem loop (in  arraycopytest.initialize_int_arraycopy)
// initialize the arrays
  for (int i = 0; i < src.length; i++) {
     src[i] = ((i & 0x7fffffff));
     dst[i] = ((src[i]) | 0x80000000);	    
     srcrefconjoint[i] = src[i];
 }

After unrolling, part of the loop looks like:
   src[i] = ((i & 0x7fffffff));
   dst[i] = ((src[i]) | 0x80000000);	    
   srcrefconjoint[i] = src[i]; // (1)   
   src[i+1] = (((i+1) & 0x7fffffff));
   dst[i+1] = ((src[i+1]) | 0x80000000);	    
   srcrefconjoint[i+1] = src[i+1]; // (2)

The load src[i] and src[i+1] in statements (1) and (2). respectively, can be packed together.
In packing them into superword, their memory input should be the same (store). The original
memory surgery wrongly used dst[i] as their memory input. This essentially violate the data
dependence from  the store src[i+1] to the load src[i+1] in statement (2). In this case, it
is safe to use dst[i+1] as their memory state input.
                                     
2009-03-12
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/78af5ae8e731
                                     
2009-03-24



Hardware and Software, Engineered to Work Together