Fix an obvious bug. Old code only worked for the entry block.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 27 Jun 2007 01:16:36 +0000 (01:16 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 27 Jun 2007 01:16:36 +0000 (01:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37743 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveIntervalAnalysis.cpp

index 34134520d65460f6b2c36e001e66eeed5fb1b654..ebab85fb48055ca8dce9a9df4ee9743eb108aa1b 100644 (file)
@@ -623,10 +623,11 @@ void LiveIntervals::handleLiveInRegister(MachineBasicBlock *MBB,
   }
 
 exit:
-  // Alias of a live-in register might not be used at all.
-  if (isAlias && end == 0) {
+  // Live-in register might not be used at all.
+  if (end == MIIdx) {
     DOUT << " dead";
-    end = getDefIndex(start) + 1;
+    if (isAlias)
+      end = getDefIndex(MIIdx) + 1;
   }
 
   assert(start < end && "did not find end of interval?");