Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AArch64: Implement OutOfLineCodeSection #5392

Merged
merged 1 commit into from
Jul 27, 2020

Conversation

Akira1Saitoh
Copy link
Contributor

This commit implements OutOfLineCodeSection for aarch64.
Some parts of OutOfLineCodeSection were already implemented.
This commit adds missing parts.

The major parts of OOL section are following:

  1. Take a snapshot of all register states at the merge point and restore
    the states at the end of the cold path.

  2. Take a snapshot of all virtual - real register assignments at the branch
    instruction (*) to the entry label of the cold path and attach it as register
    dependencies at the entry label.

  3. Create a list of all spilled registers in main line and the hot path until
    the branch instruction (*) and attach it as register dependencies (SpilledReg)
    at the entry label.

  4. Protect any spilled register's backing storage if the register is spilled
    in a lower "depth" path and reuse the same backing storage when generating reverse spills.

                |
                | main line
                |
    branch (*)  +-----, entry label
                |     |
    hot path    |     | cold path
                |     |
    merge label +-----'
                |
                | main line
                |
    

There are 2 more things to consider:

  1. Unlatching registers in the hot path whose all remaining uses are out of line.
    We use register's out of line use count to handle this.
    This is the same approach as P codegen.
  2. Adding registers first assigned in the cold path to spilled register list.
    We add those registers to firstTimeLiveOOLRegisterList and
    move them to spilled register list after register assignment for
    the cold path is finished.
    This is the same approach as Z codegen.

Signed-off-by: Akira Saitoh saiaki@jp.ibm.com

@Akira1Saitoh
Copy link
Contributor Author

Ready for review.

This commit implements OutOfLineCodeSection for aarch64.
Some parts of OutOfLineCodeSection were already implemented.
This commit adds missing parts.

The major parts of OOL section are following:
1. Take a snapshot of all register states at the merge point and restore
 the states at the end of the cold path.
2. Take a snapshot of all virtual - real register assignments at the branch
 instruction (*) to the entry label of the cold path and attach it as register
 dependencies at the entry label.
3. Create a list of all spilled registers in main line and the hot path until
 the branch instruction (*) and attach it as register dependencies (SpilledReg)
 at the entry label.
4. Protect any spilled register's backing storage if the register is spilled
 in a lower "depth" path and reuse the same backing storage when generating reverse spills.

                   |
                   | main line
                   |
       branch (*)  +-----, entry label
                   |     |
       hot path    |     | cold path
                   |     |
       merge label +-----'
                   |
                   | main line
                   |

There are 2 more things to consider:
1. Unlatching registers in the hot path whose all remaining uses are out of line.
  We use register's out of line use count to handle this.
  This is the same approach as P codegen.
2. Adding registers first assigned in the cold path to spilled register list.
  We add those registers to `firstTimeLiveOOLRegisterList` and
  move them to spilled register list after register assignment for
  the cold path is finished.
  This is the same approach as Z codegen.

Signed-off-by: Akira Saitoh <saiaki@jp.ibm.com>
@knn-k
Copy link
Contributor

knn-k commented Jul 27, 2020

@genie-omr build aarch64

@knn-k
Copy link
Contributor

knn-k commented Jul 27, 2020

LGTM. Merging.

@knn-k knn-k merged commit 8124c13 into eclipse-omr:master Jul 27, 2020
@Akira1Saitoh Akira1Saitoh deleted the aarch64OOL branch May 7, 2021 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants