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

Code quality: Useless branch in some G1 pre-barrier shapes

XMLWordPrintable

      While this issue manifests with G1, I believe this is an optimizer glitch that should be eliminated by optimizers themselves. In some variants, we end up generating:

          0x00007f82e135007a: movsbl 0x310(%r15),%r9d
          0x00007f82e1350082: test %r9d,%r9d
      ╭ 0x00007f82e1350085: jne 0x00007f82e1350087
       ↘ 0x00007f82e1350087: mov %rax,%r10

      ...and then also kill %r9.

      Reproducer:
       http://cr.openjdk.java.net/~shade/8145612/G1UselessBranch.java
       http://cr.openjdk.java.net/~shade/8145612/benchmarks.jar

      perfasm for G1:
       http://cr.openjdk.java.net/~shade/8145612/g1.perfasm

      perfasm for Parallel:
       http://cr.openjdk.java.net/~shade/8145612/parallel.perfasm

            Unassigned Unassigned
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: