aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AMDGPU/SIFrameLowering.cpp13
-rw-r--r--llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp13
2 files changed, 18 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
index 2c67c4a..50a6f02 100644
--- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
@@ -1418,10 +1418,15 @@ void SIFrameLowering::processFunctionBeforeFrameFinalized(
// the debug value instructions. We should instead, update it with the
// correct register value. But not sure the register value alone is
for (MachineInstr &MI : MBB) {
- if (MI.isDebugValue() && MI.getOperand(0).isFI() &&
- !MFI.isFixedObjectIndex(MI.getOperand(0).getIndex()) &&
- SpillFIs[MI.getOperand(0).getIndex()]) {
- MI.getOperand(0).ChangeToRegister(Register(), false /*isDef*/);
+ if (MI.isDebugValue()) {
+ uint32_t StackOperandIdx = MI.isDebugValueList() ? 2 : 0;
+ if (MI.getOperand(StackOperandIdx).isFI() &&
+ !MFI.isFixedObjectIndex(
+ MI.getOperand(StackOperandIdx).getIndex()) &&
+ SpillFIs[MI.getOperand(StackOperandIdx).getIndex()]) {
+ MI.getOperand(StackOperandIdx)
+ .ChangeToRegister(Register(), false /*isDef*/);
+ }
}
}
}
diff --git a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
index 28bba8c..35e5bea 100644
--- a/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+++ b/llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
@@ -418,10 +418,15 @@ bool SILowerSGPRSpills::run(MachineFunction &MF) {
// correct register value. But not sure the register value alone is
// adequate to lower the DIExpression. It should be worked out later.
for (MachineInstr &MI : MBB) {
- if (MI.isDebugValue() && MI.getOperand(0).isFI() &&
- !MFI.isFixedObjectIndex(MI.getOperand(0).getIndex()) &&
- SpillFIs[MI.getOperand(0).getIndex()]) {
- MI.getOperand(0).ChangeToRegister(Register(), false /*isDef*/);
+ if (MI.isDebugValue()) {
+ uint32_t StackOperandIdx = MI.isDebugValueList() ? 2 : 0;
+ if (MI.getOperand(StackOperandIdx).isFI() &&
+ !MFI.isFixedObjectIndex(
+ MI.getOperand(StackOperandIdx).getIndex()) &&
+ SpillFIs[MI.getOperand(StackOperandIdx).getIndex()]) {
+ MI.getOperand(StackOperandIdx)
+ .ChangeToRegister(Register(), false /*isDef*/);
+ }
}
}
}