diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-09-09 21:44:23 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-09-09 21:44:23 +0000 |
commit | 93945287b8843dde31a43a02b2ca02435d5609ad (patch) | |
tree | 78b90cd0550a21f25550c15ad60de485508657a9 /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | b4061e8ce4f7cf18a0e2c2417c054a19e50c5cd2 (diff) |
Clear preference when it no longer makes sense.
llvm-svn: 56019
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 6805c8d41c80..5a386dde068a 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -1317,6 +1317,14 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) { } } + // If resulting interval has a preference that no longer fits because of subreg + // coalescing, just clear the preference. + if (ResDstInt->preference && (isExtSubReg || isInsSubReg)) { + const TargetRegisterClass *RC = mri_->getRegClass(ResDstInt->reg); + if (!RC->contains(ResDstInt->preference)) + ResDstInt->preference = 0; + } + DOUT << "\n\t\tJoined. Result = "; ResDstInt->print(DOUT, tri_); DOUT << "\n"; |