Only collect subreg extracting copies for later coalescing.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 10 Jul 2010 22:42:53 +0000 (22:42 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 10 Jul 2010 22:42:53 +0000 (22:42 +0000)
This also avoids fatal copies from physregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108061 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TwoAddressInstructionPass.cpp

index 00dec66dcaf225f0568b50e46c228e63811e0ddc..681473ba79508ebbcac83d41928478f579bb41cc 100644 (file)
@@ -1434,7 +1434,7 @@ bool TwoAddressInstructionPass::EliminateRegSequences() {
       IsImpDef = false;
 
       // Remember COPY sources. These might be candidate for coalescing.
-      if (DefMI->isCopy())
+      if (DefMI->isCopy() && DefMI->getOperand(1).getSubReg())
         RealSrcs.push_back(DefMI->getOperand(1).getReg());
 
       if (!Seen.insert(SrcReg) ||