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

split_thru_phi leaves behind Phi of AddP which produces inefficient code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • hs10
    • 7
    • hotspot
    • None
    • b13
    • sparc
    • solaris_9

        split_thru_phi and friends will attempt to push memory operations up through phis by pushing all their inputs up first. If a memory op isn't pushed through then we are left with patterns like (Phi (AddP base #8) (AddP base2 #8)). These cause the computation of address to occur as a Phi instead of being folded into the addressing mode, which tend to keep an extra register live and will keep us from using implicit null checks on the memory operations. For example you get this code:

        53a B91: # B170 B92 <- B90 Freq: 6700.85
        53a INC [EBP + #8] ! Field java/util/AbstractList.modCount
        53d TEST EAX,EAX
        53f Jeq B170 P=0.000001 C=-1.000000
        53f
        545 B92: # B94 B93 <- B91 Freq: 6700.84
        545 MOV EDI,[EBP + #12] ! Field java/util/ArrayList.size
        548 LEA EDX,[EAX + #8]
        54b MOV EBX,[EDX]

        instead of this:

        53a B91: # B170 B92 <- B90 Freq: 6700.85
        53a INC [EBP + #8] ! Field java/util/AbstractList.modCount
        53d MOV EBX,[ECX + #8]
        540 NullCheck ECX
        540
        540 B92: # B94 B93 <- B91 Freq: 6700.84
        540 MOV EDI,[EBP + #12] ! Field java/util/ArrayList.size

              never Tom Rodriguez
              never Tom Rodriguez
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: