summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-04-21 20:57:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-04-21 20:57:54 +0000
commite3dd8550c6c65d02b067ec96ac12a560dabd4452 (patch)
tree7bb16bfe2aeabb359aa753205572c7f05710805e /lib
parent708e474c2ff2922786a9ea6562772d2f271dec28 (diff)
downloadllvm-e3dd8550c6c65d02b067ec96ac12a560dabd4452.tar.gz
llvm-e3dd8550c6c65d02b067ec96ac12a560dabd4452.tar.bz2
llvm-e3dd8550c6c65d02b067ec96ac12a560dabd4452.tar.xz
Do not try to optimize a copy that has already been marked for deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 78011ed67f..543278b467 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -804,7 +804,8 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg,
CopySrcReg == SrcReg && CopyDstReg != UseDstReg) {
// If the use is a copy and it won't be coalesced away, and its source
// is defined by a trivial computation, try to rematerialize it instead.
- if (ReMaterializeTrivialDef(li_->getInterval(SrcReg), CopyDstReg,
+ if (!JoinedCopies.count(UseMI) &&
+ ReMaterializeTrivialDef(li_->getInterval(SrcReg), CopyDstReg,
CopyDstSubIdx, UseMI))
continue;
}