From 48828bb402974dd9560b1b0c3c9eb01cc0ce8551 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Fri, 22 Jun 2012 19:51:41 +0000 Subject: [PATCH] Fix a crash in --debug code. Don't try to print out the live range of a physreg. llvm-svn: 159021 --- llvm/lib/CodeGen/RegisterCoalescer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp index 7ef525d9f3c6..19b6ffcb51b3 100644 --- a/llvm/lib/CodeGen/RegisterCoalescer.cpp +++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp @@ -1053,8 +1053,12 @@ bool RegisterCoalescer::joinCopy(MachineInstr *CopyMI, bool &Again) { // Update regalloc hint. TRI->UpdateRegAllocHint(CP.getSrcReg(), CP.getDstReg(), *MF); - DEBUG(dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI) - << ' ' << LIS->getInterval(CP.getDstReg()) << '\n'); + DEBUG({ + dbgs() << "\tJoined. Result = " << PrintReg(CP.getDstReg(), TRI); + if (!CP.isPhys()) + dbgs() << LIS->getInterval(CP.getDstReg()); + dbgs() << '\n'; + }); ++numJoins; return true;