diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-12-10 20:59:45 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-12-10 20:59:45 +0000 |
commit | 6fd78ec8a216f659ce7c0c9912bb81e29595fed9 (patch) | |
tree | 29ed77c01d9572f6695922cc6d5251d03b2dc0b3 /lib/CodeGen | |
parent | e4a70cd19c41ac098d81bf2f8d8f9fee3efb3c49 (diff) |
It's not safe to coalesce a move where src and dst registers have different subregister indices. e.g.:
%reg16404:1<def> = MOV8rr %reg16412:2<kill>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 94f17cec9b..5ebe557d1a 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -1317,7 +1317,13 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) { "coalesced to another register.\n"); return false; // Not coalescable. } - } else if (!tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)){ + } else if (tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { + if (SrcSubIdx && DstSubIdx && SrcSubIdx != DstSubIdx) { + // e.g. %reg16404:1<def> = MOV8rr %reg16412:2<kill> + Again = true; + return false; // Not coalescable. + } + } else { llvm_unreachable("Unrecognized copy instruction!"); } |