Author: evancheng Date: Mon Feb 18 12:56:31 2008 New Revision: 47281 URL: http://llvm.org/viewvc/llvm-project?rev=47281&view=rev Log: - Remove the previous check which broke coalescer-commute3.ll - For now, conservatively ignore copy MI whose source is a physical register. Commuting its def MI can cause a physical register live interval to be live through a loop (since we know it's live coming into the def MI).
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=47281&r1=47280&r2=47281&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original) +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Feb 18 12:56:31 2008 @@ -247,11 +247,11 @@ unsigned CopyIdx = li_->getDefIndex(li_->getInstructionIndex(CopyMI)); - // FIXME: For now, only eliminate the copy by commuting its def is the source - // does not live pass the move. Coalescing those copies may end up may simply - // end up swapping a live interval for another. That and because usually only - // the non-two address operand can be folded can end up pessimizing the code. - if (CopyMI->findRegisterUseOperandIdx(IntA.reg, true) != -1) + // FIXME: For now, only eliminate the copy by commuting its def when the + // source register is a virtual register. We want to guard against cases + // where the copy is a back edge copy and commuting the def lengthen the + // live interval of the source register to the entire loop. + if (TargetRegisterInfo::isPhysicalRegister(IntA.reg)) return false; // BValNo is a value number in B that is defined by a copy from A. 'B3' in _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits