diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-10-12 09:15:53 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-10-12 09:15:53 +0000 |
commit | 52c7ff70679d31d95db3f9c15fb7192e504942a9 (patch) | |
tree | 68085e56daaa81712e074397ff37d5a8c5db6a2a /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 37a073eab4ae2577d7ab571f412902be89aecbc8 (diff) |
Restrict EXTRACT_SUBREG coalescing to avoid negative performance impact.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 9d43750f1c..67e829efee 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -264,8 +264,13 @@ bool SimpleRegisterCoalescing::JoinCopy(MachineInstr *CopyMI, if (li_->hasInterval(*SR) && RHS.overlaps(li_->getInterval(*SR))) { DOUT << "Interfere with sub-register "; DEBUG(li_->getInterval(*SR).print(DOUT, mri_)); - return true; + return true; // Not coalescable } + } else if (li_->getInterval(repDstReg).getSize() > + li_->getInterval(repSrcReg).getSize()) { + // Be conservative. If both sides are virtual registers, do not coalesce + // if the sub-register live interval is longer. + return false; } } else if (differingRegisterClasses(repSrcReg, repDstReg)) { // If they are not of the same register class, we cannot join them. |