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 | 3ef2d60e95f320fe2377d62b1f460cae44f5fdbe (patch) | |
tree | d072c00fd51e75653024900482d81d7f8690e519 /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | a009d2ef54fa8dc1c963ac6612d6c6f0a8d7712e (diff) |
Clear preference when it no longer makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 6805c8d41c..5a386dde06 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/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"; |