suboptimal loop exit comparison for big immediate value

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 20
    • Component/s: hotspot
    • aarch64
    • generic

      if strip-mining is not on( eg. ParallelGC), LoopOpts leaves alone the loop boundary if it is an immediate value. It's up to assembler to generate it.

      if the value is big, some ISAs may not be able to encode it directly in comparison instruction. As a result, c2 has to use one scratch register and multiple instructions to load it. Even it's an immediate, this happens on every loop iteration.

      c2 may consider to hoist the immediate load out of loop and use a temp. hopefully, register allocation will pick it up. In the worst case, we still can re-materialize it like current code.



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

              Created:
              Updated: