summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-01-23 05:48:59 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-01-23 05:48:59 +0000
commit9db227999a108f0da1db7cea0c7523908f6599c4 (patch)
tree7695b6a41d4e60551c15034a6f8bad3492d91be7 /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
parentf347c3615bd2909cf37a94f97952fed580db2363 (diff)
downloadbcm5719-llvm-9db227999a108f0da1db7cea0c7523908f6599c4.tar.gz
bcm5719-llvm-9db227999a108f0da1db7cea0c7523908f6599c4.zip
Only check if coalescing is worthwhile when the result is targeting a more restrictive register class.
llvm-svn: 62837
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-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 f0b0d58d135..f3ffc69cccb 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -1290,8 +1290,13 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
}
}
+ // If we are joining two virtual registers and the resulting register
+ // class is more restrictive (fewer register, smaller size). Check if it's
+ // worth doing the merge.
if (!SrcIsPhys && !DstIsPhys &&
- !isWinToJoinCrossClass(LargeReg, SmallReg, Limit)) {
+ (isExtSubReg || DstRC->isASubClass()) &&
+ !isWinToJoinCrossClass(LargeReg, SmallReg,
+ allocatableRCRegs_[NewRC].count())) {
DOUT << "\tSrc/Dest are different register classes.\n";
// Allow the coalescer to try again in case either side gets coalesced to
// a physical register that's compatible with the other side. e.g.
OpenPOWER on IntegriCloud