Teach frame lowering to ignore debug values after the terminators.
llvm-svn: 123399
diff --git a/llvm/lib/Target/MBlaze/MBlazeFrameLowering.cpp b/llvm/lib/Target/MBlaze/MBlazeFrameLowering.cpp
index e501621..e763902 100644
--- a/llvm/lib/Target/MBlaze/MBlazeFrameLowering.cpp
+++ b/llvm/lib/Target/MBlaze/MBlazeFrameLowering.cpp
@@ -386,7 +386,7 @@
void MBlazeFrameLowering::emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const {
- MachineBasicBlock::iterator MBBI = prior(MBB.end());
+ MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
MachineFrameInfo *MFI = MF.getFrameInfo();
MBlazeFunctionInfo *MBlazeFI = MF.getInfo<MBlazeFunctionInfo>();
const MBlazeInstrInfo &TII =