AArch64: Implement OutOfLineCodeSection #5392
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Take a snapshot of all register states at the merge point and restore
the states at the end of the cold path.
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.
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.
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.
There are 2 more things to consider:
We use register's out of line use count to handle this.
This is the same approach as P codegen.
We add those registers to
firstTimeLiveOOLRegisterList
andmove 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