[llvm] r338231 - [RegisterScavenger] Fix debug print
Karl-Johan Karlsson via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 30 01:17:00 PDT 2018
Author: karka
Date: Mon Jul 30 01:17:00 2018
New Revision: 338231
URL: http://llvm.org/viewvc/llvm-project?rev=338231&view=rev
Log:
[RegisterScavenger] Fix debug print
Modified:
llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
Modified: llvm/trunk/lib/CodeGen/RegisterScavenging.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegisterScavenging.cpp?rev=338231&r1=338230&r2=338231&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegisterScavenging.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegisterScavenging.cpp Mon Jul 30 01:17:00 2018
@@ -594,7 +594,8 @@ unsigned RegScavenger::scavengeRegisterB
MachineBasicBlock::iterator ReloadAfter =
RestoreAfter ? std::next(MBBI) : MBBI;
MachineBasicBlock::iterator ReloadBefore = std::next(ReloadAfter);
- LLVM_DEBUG(dbgs() << "Reload before: " << *ReloadBefore << '\n');
+ if (ReloadBefore != MBB.end())
+ LLVM_DEBUG(dbgs() << "Reload before: " << *ReloadBefore << '\n');
ScavengedInfo &Scavenged = spill(Reg, RC, SPAdj, SpillBefore, ReloadBefore);
Scavenged.Restore = &*std::prev(SpillBefore);
LiveUnits.removeReg(Reg);
More information about the llvm-commits
mailing list