aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2003-12-18 08:53:43 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2003-12-18 08:53:43 +0000
commit43f692f90f6b27304570e1b1807542dff4b8e847 (patch)
treedd511ab62149628670033a81b60bcef44027c29c /lib/CodeGen/LiveIntervalAnalysis.cpp
parentdd2cc65f34f9b7bfda1cd0c42becedfc361d46f8 (diff)
When a variable is killed and redifined in a basic block only one
killing instruction is tracked. This causes the LiveIntervals to create bogus intervals. The workaound is to add a range to the interval from the redefinition to the end of the basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 564d9cd384..e5171ad5c4 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -152,11 +152,14 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock* mbb,
for (int i = 0, e = vi.Kills.size(); i != e; ++i) {
MachineBasicBlock* killerBlock = vi.Kills[i].first;
MachineInstr* killerInstr = vi.Kills[i].second;
- killedInDefiningBasicBlock |= mbb == killerBlock;
unsigned start = (mbb == killerBlock ?
instrIndex :
getInstructionIndex(killerBlock->front()));
unsigned end = getInstructionIndex(killerInstr) + 1;
+ if (start < end) {
+ killedInDefiningBasicBlock |= mbb == killerBlock;
+ interval->addRange(start, end);
+ }
}
if (!killedInDefiningBasicBlock) {