[llvm-commits] [llvm] r106878 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Bill Wendling isanbard at gmail.com
Fri Jun 25 13:42:55 PDT 2010


Author: void
Date: Fri Jun 25 15:42:55 2010
New Revision: 106878

URL: http://llvm.org/viewvc/llvm-project?rev=106878&view=rev
Log:
We should remove the live range from the destination register only if *all* defs
are dead, not just the def of this register. I.e., a register could be dead, but
it's subreg isn't.

Testcase to follow with a subsequent patch.

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=106878&r1=106877&r2=106878&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Jun 25 15:42:55 2010
@@ -1892,8 +1892,8 @@
         if (li_->hasInterval(SrcReg)) {
           LiveInterval &RegInt = li_->getInterval(SrcReg);
           // If def of this move instruction is dead, remove its live range
-          // from the dstination register's live interval.
-          if (MI->registerDefIsDead(DstReg)) {
+          // from the destination register's live interval.
+          if (MI->allDefsAreDead()) {
             if (!ShortenDeadCopySrcLiveRange(RegInt, MI))
               ShortenDeadCopyLiveRange(RegInt, MI);
           } else {





More information about the llvm-commits mailing list