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

Server compiler emits redundant membar-volatile instructions

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • hotspot
    • None
    • generic
    • generic

      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.

            azeemj Azeem Jiva
            rasbold Chuck Rasbold
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: