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

Avoid, when possible, branch exit in middle of loops

XMLWordPrintable

    • sparc
    • generic

      Performance can be gained by replacing the "branch always"
      at the end of a loop with a conditional branch, thus
      avoiding a branch for exiting in the middle of loop.

      For example:

              bge,pn %xcc, endLoop
              nop
              mov %g4, %o3
              ba,pt %icc, beginLoop
              nop
      endLoop:

      can be transformed into:

              mov %g4, %o3
              bl,pt %xcc, beginLoop
              nop

      since there is no harm in executing the "mov" in the
      case when the branch is not taken (the loop is exiting).

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: