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

Create generalizations for existing LShift ideal transforms

XMLWordPrintable

    • b14
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      Making a report for: https://github.com/openjdk/jdk/pull/12734

      I would like to generalize two ideal transforms for bitwise shifts. Left shift nodes perform the transformations `(x >> C1) << C2 => x & (-1 << C2)` and `((x >> C1) & Y) << C2 => x & (Y << C2)`, but only when the case where `C1 == C2`. However, it is possible to use both of these rules to improve cases where the constants aren't equal, by removing one of the shifts and replacing it with a bitwise and. This transformation is profitable because typically more bitwise ands can be dispatched per cycle than bit shifts. In addition, the strength reduction from a shift to a bitwise and can allow more profitable transformations to occur. These patterns are found throughout the JDK, mainly around strings and OW2 ASM.


            redestad Claes Redestad
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: