summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2013-06-21 18:33:11 +0000
committerAndrew Trick <atrick@apple.com>2013-06-21 18:33:11 +0000
commitff197dfcf9ac50a62d21e0c30644e09ca3bb92f5 (patch)
treeaf675abf8b8fbc9fe18254ae39d5fcd8560513dd /lib
parent0db6df0d963a8eee763fd878a72c3153501491c0 (diff)
downloadllvm-ff197dfcf9ac50a62d21e0c30644e09ca3bb92f5.tar.gz
llvm-ff197dfcf9ac50a62d21e0c30644e09ca3bb92f5.tar.bz2
llvm-ff197dfcf9ac50a62d21e0c30644e09ca3bb92f5.tar.xz
Fix a -join-globalcopies bug; handle undef operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index 6e7d90dd65..70a2462880 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -2072,6 +2072,9 @@ static bool isLocalCopy(MachineInstr *Copy, const LiveIntervals *LIS) {
if (!Copy->isCopy())
return false;
+ if (Copy->getOperand(1).isUndef())
+ return false;
+
unsigned SrcReg = Copy->getOperand(1).getReg();
unsigned DstReg = Copy->getOperand(0).getReg();
if (TargetRegisterInfo::isPhysicalRegister(SrcReg)