Skip to content

Commit 9f67919

Browse files
committed
[llvm] support save/restore point splitting in shrink-wrap
This patch introduces "-enable-shrink-wrap-into-multiple-points" option, which enables splitting Save and Restore points during ShrinkWrap pass, i.e. insert registers saves and restores as close as possible to their usage. Current algorithm disables Save / Restore point splitting for functions with instructions with FrameIndex operands, with EHPads and with any Stack accesses beacuse it is difficult to prove the safety of it. This patch also add support for multiple Save / Restore points only for RISCV. Now ShrinkWrap produces: - list of SavePoint + Registers - list of RestorePoint + Registers - Prolog (NCD of Save points) - Epilog (NCPD of Restore points)
1 parent ddb2a49 commit 9f67919

File tree

5 files changed

+687
-115
lines changed

5 files changed

+687
-115
lines changed

llvm/include/llvm/CodeGen/TargetFrameLowering.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ class TargetFrameLowering {
199199
return false;
200200
}
201201

202+
/// enableCSRSaveRestorePointsSplit - Returns true if the target support
203+
/// multiple save/restore points in shrink wrapping.
204+
virtual bool enableCSRSaveRestorePointsSplit() const { return false; }
205+
202206
/// Returns true if the stack slot holes in the fixed and callee-save stack
203207
/// area should be used when allocating other stack locations to reduce stack
204208
/// size.

0 commit comments

Comments
 (0)