aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
diff options
context:
space:
mode:
authorChristudasan Devadasan <christudasan.devadasan@amd.com>2023-11-16 10:30:03 +0530
committerGitHub <noreply@github.com>2023-11-16 10:30:03 +0530
commitce7fd498ed91344c23f0864bbd5b84d65eaae3ef (patch)
tree0d297ede1e4b78147282db94e2e169eaf97cbabc /llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
parente8fc282ff26b4d1d71a316bf036fc486b420ea19 (diff)
downloadllvm-ce7fd498ed91344c23f0864bbd5b84d65eaae3ef.zip
llvm-ce7fd498ed91344c23f0864bbd5b84d65eaae3ef.tar.gz
llvm-ce7fd498ed91344c23f0864bbd5b84d65eaae3ef.tar.bz2
[AMDGPU] RA inserted scalar instructions can be at the BB top (#72140)
We adjust the insertion point at the BB top for spills/copies during RA to ensure they are placed after the exec restore instructions required for the divergent control flow execution. This is, however, required only for the vector operations. The insertions for scalar registers can still go to the BB top.
Diffstat (limited to 'llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp')
-rw-r--r--llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp b/llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
index 75504ef..4d668c5 100644
--- a/llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
+++ b/llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
@@ -461,7 +461,8 @@ public:
if (EHPad && !RC.hasReload(Reg, RegToSlotIdx[Reg], EHPad)) {
RC.recordReload(Reg, RegToSlotIdx[Reg], EHPad);
- auto EHPadInsertPoint = EHPad->SkipPHIsLabelsAndDebug(EHPad->begin());
+ auto EHPadInsertPoint =
+ EHPad->SkipPHIsLabelsAndDebug(EHPad->begin(), Reg);
insertReloadBefore(Reg, EHPadInsertPoint, EHPad);
LLVM_DEBUG(dbgs() << "...also reload at EHPad "
<< printMBBReference(*EHPad) << "\n");