summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-10-12 09:15:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-10-12 09:15:53 +0000
commit11330f7526ef11109ca31aa1abbb4f9a698cd95a (patch)
tree13e31c0a251a38e02fba12a1cda9062748966e82 /llvm/lib
parentf8e28b152a538b22a6150dc3ace1bc0bf8169c93 (diff)
downloadbcm5719-llvm-11330f7526ef11109ca31aa1abbb4f9a698cd95a.tar.gz
bcm5719-llvm-11330f7526ef11109ca31aa1abbb4f9a698cd95a.zip
Restrict EXTRACT_SUBREG coalescing to avoid negative performance impact.
llvm-svn: 42903
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 9d43750f1c6..67e829efee1 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud