We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d58a20 commit 6a8411fCopy full SHA for 6a8411f
llvm/lib/Target/AIE/AIEBaseFrameLowering.cpp
@@ -219,8 +219,10 @@ bool AIEBaseFrameLowering::spillCalleeSavedRegisters(
219
ArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const {
220
MachineFunction *MF = MBB.getParent();
221
auto *TII = static_cast<const AIEBaseInstrInfo *>(STI.getInstrInfo());
222
- MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
223
- DebugLoc DL = MBBI->getDebugLoc();
+ DebugLoc DL;
+ if (auto MBBI = MBB.getLastNonDebugInstr(); MBBI != MBB.end())
224
+ DL = MBBI->getDebugLoc(); // MBBI is valid
225
+
226
GPRTOCSGPRMap.clear();
227
for (const CalleeSavedInfo &Info : CSI) {
228
if (Info.isSpilledToReg()) {
0 commit comments