Skip to content

Commit

Permalink
Only check if coalescing is worthwhile when the result is targeting a…
Browse files Browse the repository at this point in the history
… more restrictive register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62837 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Evan Cheng committed Jan 23, 2009
1 parent 3e2351f commit c16d37e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/CodeGen/SimpleRegisterCoalescing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c16d37e

Please sign in to comment.