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

suboptimal loop exit comparison for big immediate value

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • 20
    • hotspot
    • aarch64
    • generic

    Description

      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.



      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: