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

Reassociate loop invariants involved in Cmps and Add/Subs

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 23
    • 23
    • hotspot
    • b19
    • generic
    • generic

    Description

      Following the ideas of https://bugs.openjdk.org/browse/JDK-8250808, we can reassociate expressions involving Cmps and Add/Subs

      ```
      // Apply the same transformations to == and !=
      inv1 == (x + inv2) => ( inv1 - inv2 ) == x
      inv1 == (x - inv2) => ( inv1 + inv2 ) == x
      inv1 == (inv2 - x) => (-inv1 + inv2 ) == x
      ```

      This can only be done for `==` and `!=`, or else we can break comparisons if there are overflows.

      Attachments

        Issue Links

          Activity

            People

              jcao Joshua Cao
              jcao Joshua Cao
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: