diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2016-05-02 18:02:24 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2016-05-02 18:02:24 +0000 |
| commit | 341e293d67541115a7eeb235e94ad5e1e82f6c73 (patch) | |
| tree | 533c3581c4a28e5d12225929ff58ec63bc87aa86 /llvm | |
| parent | 456177b98fa3d807007ccfe671aae02691480e5a (diff) | |
| download | bcm5719-llvm-341e293d67541115a7eeb235e94ad5e1e82f6c73.tar.gz bcm5719-llvm-341e293d67541115a7eeb235e94ad5e1e82f6c73.zip | |
AMDGPU/SI: Fix bug in SIInstrInfo::insertWaitStates() uncovered by r268260
We can't use MI->getDebugLoc() when MI is an iterator that could be
MBB.end().
llvm-svn: 268265
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp index eb17ffedff6..f5cd065a593 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -806,6 +806,7 @@ unsigned SIInstrInfo::calculateLDSSpillAddress(MachineBasicBlock &MBB, void SIInstrInfo::insertWaitStates(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, int Count) const { + DebugLoc DL = MBB.findDebugLoc(MI); while (Count > 0) { int Arg; if (Count >= 8) @@ -813,7 +814,7 @@ void SIInstrInfo::insertWaitStates(MachineBasicBlock &MBB, else Arg = Count - 1; Count -= 8; - BuildMI(MBB, MI, MI->getDebugLoc(), get(AMDGPU::S_NOP)) + BuildMI(MBB, MI, DL, get(AMDGPU::S_NOP)) .addImm(Arg); } } |

