aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-06-27 01:16:36 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-06-27 01:16:36 +0000
commit75611fb4e6ab253be30ac29a2b15e9bf8c1d146e (patch)
treee8532915968590e930c8aad167116bfd54171a8c /lib/CodeGen/LiveIntervalAnalysis.cpp
parent6032a5ba64cc97f95b0afd65b88fc4febebc62ad (diff)
downloadexternal_llvm-75611fb4e6ab253be30ac29a2b15e9bf8c1d146e.zip
external_llvm-75611fb4e6ab253be30ac29a2b15e9bf8c1d146e.tar.gz
external_llvm-75611fb4e6ab253be30ac29a2b15e9bf8c1d146e.tar.bz2
Fix an obvious bug. Old code only worked for the entry block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 3413452..ebab85f 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -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?");