The server compiler fails to eliminate redundant membar-volatile instructions
In the attached program thrd05201, the run() method generates the following OptoAssembly:
1b4 B17: # B26 B18 <- B16 B19 Loop: B17-B19 inner stride: 0 post of N282 Freq: 53.358
1b4 + MEMBAR-release
1b4 + OR R_L7,R_L5,R_L2
1b8 + SRA R_L2,0,R_G3 ! int->long
1bc + SLLX R_G3,#32,R_G4
1c0 + OR R_G4,R_G3,R_G3 ! long
1c4 STX R_G3,[R_L4 + #80] ! long Volatile!
1c8 + MEMBAR-volatile
1cc + MEMBAR-volatile
1d0 + LDUW [R_L4 + #72],R_L0 ! ptr
1d4 LDX [R_L0 + #80],R_G3 ! long Volatile!
1d8 NullCheck R_L0
1d8
See also b4336548.run:
054 B5: # B3 <- B2 Loop: B2-B3 inner Freq: 1.89393e-05
054 + MEMBAR-release
054 + STB #0,[R_G4 + #276] ! byte Volatile!
058 + MEMBAR-volatile
05c + MEMBAR-volatile
060 + BA B3
060 MOV #0,R_G1
060
The extra membars may have a performance impact.
In the attached program thrd05201, the run() method generates the following OptoAssembly:
1b4 B17: # B26 B18 <- B16 B19 Loop: B17-B19 inner stride: 0 post of N282 Freq: 53.358
1b4 + MEMBAR-release
1b4 + OR R_L7,R_L5,R_L2
1b8 + SRA R_L2,0,R_G3 ! int->long
1bc + SLLX R_G3,#32,R_G4
1c0 + OR R_G4,R_G3,R_G3 ! long
1c4 STX R_G3,[R_L4 + #80] ! long Volatile!
1c8 + MEMBAR-volatile
1cc + MEMBAR-volatile
1d0 + LDUW [R_L4 + #72],R_L0 ! ptr
1d4 LDX [R_L0 + #80],R_G3 ! long Volatile!
1d8 NullCheck R_L0
1d8
See also b4336548.run:
054 B5: # B3 <- B2 Loop: B2-B3 inner Freq: 1.89393e-05
054 + MEMBAR-release
054 + STB #0,[R_G4 + #276] ! byte Volatile!
058 + MEMBAR-volatile
05c + MEMBAR-volatile
060 + BA B3
060 MOV #0,R_G1
060
The extra membars may have a performance impact.
- duplicates
-
JDK-4904703 Need support for JSR-166 in VM
-
- Resolved
-
- relates to
-
JDK-4336548 [solaris i386] Compiler Safepoints do not work on multiprocessor systems
-
- Closed
-
-
JDK-4432655 read or write to long volatile variable is not atomic.
-
- Closed
-