Optimize Xor

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 17
    • Component/s: hotspot
    • b13
    • generic
    • generic

      1). x ^ x ==> 0
      2). Const ^ x ==> x ^ Const, so that GVN could replace with the pre-existed node.
      3). x ^ y ==> x, if y is constant zero.
      4). x ^ y ==> ~x, if y is constant bit mask value.


      See https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2020-November/041798.html for more detail.

            Assignee:
            Eric Liu
            Reporter:
            Eric Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: