C2: missing transformation for chain of shifts/multiplications by constants

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 25
    • Affects Version/s: 25
    • Component/s: hotspot
    • b16

      I noticed that:

          private static int test1(int i) {
              return ((i * 1024) * 1024);
          }

      is compiled down to:

      (LShiftI (LShiftI Parm #10) #10)

      when it could be:

      (LShiftI Parm #20)

      I suppose there are other missing similar transformations with shift variants and multiplication.

            Assignee:
            Marc Chevalier
            Reporter:
            Roland Westrelin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: