Rewrite instruction operands in AdjustCopiesBackFrom. Fixes PR11861.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149097 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames
2012-01-27 00:05:42 +00:00
parent 660a4d9e0a
commit 3b0714d993
2 changed files with 27 additions and 4 deletions

View File

@@ -553,10 +553,12 @@ bool RegisterCoalescer::AdjustCopiesBackFrom(const CoalescerPair &CP,
if (UIdx != -1) {
ValLREndInst->getOperand(UIdx).setIsKill(false);
}
// If the copy instruction was killing the destination register before the
// merge, find the last use and trim the live range. That will also add the
// isKill marker.
// Rewrite the copy. If the copy instruction was killing the destination
// register before the merge, find the last use and trim the live range. That
// will also add the isKill marker.
CopyMI->substituteRegister(IntA.reg, IntB.reg, CP.getSubIdx(),
*TRI);
if (ALR->end == CopyIdx)
LIS->shrinkToUses(&IntA);