aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
diff options
context:
space:
mode:
authorElizaveta Noskova <159026035+enoskova-sc@users.noreply.github.com>2025-08-12 16:34:29 +0300
committerGitHub <noreply@github.com>2025-08-12 16:34:29 +0300
commitbbde6be841b22667179c6e75682c40e1484a4bf2 (patch)
tree247974ba5dc1ade8beafbd4aadbb6a4d907d2036 /llvm/tools/llvm-reduce/ReducerWorkItem.cpp
parentef5e65d27b940a2a2ce1d4ff20c38105d52d23b6 (diff)
downloadllvm-bbde6be841b22667179c6e75682c40e1484a4bf2.zip
llvm-bbde6be841b22667179c6e75682c40e1484a4bf2.tar.gz
llvm-bbde6be841b22667179c6e75682c40e1484a4bf2.tar.bz2
[llvm] Support multiple save/restore points in mir (#119357)
Currently mir supports only one save and one restore point specification: ``` savePoint: '%bb.1' restorePoint: '%bb.2' ``` This patch provide possibility to have multiple save and multiple restore points in mir: ``` savePoints: - point: '%bb.1' restorePoints: - point: '%bb.2' ``` Shrink-Wrap points split Part 3. RFC: https://discourse.llvm.org/t/shrink-wrap-save-restore-points-splitting/83581 Part 1: https://github.com/llvm/llvm-project/pull/117862 Part 2: https://github.com/llvm/llvm-project/pull/119355 Part 4: https://github.com/llvm/llvm-project/pull/119358 Part 5: https://github.com/llvm/llvm-project/pull/119359
Diffstat (limited to 'llvm/tools/llvm-reduce/ReducerWorkItem.cpp')
-rw-r--r--llvm/tools/llvm-reduce/ReducerWorkItem.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
index 3f84e8f..248714f 100644
--- a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
+++ b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
@@ -92,11 +92,17 @@ static void cloneFrameInfo(
DstMFI.setCVBytesOfCalleeSavedRegisters(
SrcMFI.getCVBytesOfCalleeSavedRegisters());
- if (MachineBasicBlock *SavePt = SrcMFI.getSavePoint())
- DstMFI.setSavePoint(Src2DstMBB.find(SavePt)->second);
- if (MachineBasicBlock *RestorePt = SrcMFI.getRestorePoint())
- DstMFI.setRestorePoint(Src2DstMBB.find(RestorePt)->second);
+ assert(SrcMFI.getSavePoints().size() < 2 &&
+ "Multiple restore points not yet supported!");
+ DstMFI.setSavePoints(MachineFrameInfo::constructSaveRestorePoints(
+ SrcMFI.getSavePoints(), Src2DstMBB));
+
+ assert(SrcMFI.getRestorePoints().size() < 2 &&
+ "Multiple restore points not yet supported!");
+
+ DstMFI.setRestorePoints(MachineFrameInfo::constructSaveRestorePoints(
+ SrcMFI.getRestorePoints(), Src2DstMBB));
auto CopyObjectProperties = [](MachineFrameInfo &DstMFI,
const MachineFrameInfo &SrcMFI, int FI) {