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

Coalesce 'XYZ, test, jump' instruction sequences

XMLWordPrintable

      It was noticed in https://bugs.openjdk.org/browse/JDK-8311597 that in the following instruction sequence:

          or ebp, 0xa
          test ebp, ebp
          jl 0x1b5ee511261

      The `test ebp, ebp` is redundant, because the same flags are already set by the 'or' instruction.

      We could coalesce these instructions together into just:

          or ebp, 0xa
          jl 0x1b5ee511261

      The 'jl' instruction needs the SF and OF flags, which are set by the 'or' instruction. The `test ebp, ebp` does not modify the result register, just sets the flags, so it is not needed.

            jvernee Jorn Vernee
            jvernee Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: