[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Thu Dec 18 02:54:01 PST 2003
Changes in directory llvm/lib/CodeGen:
LiveIntervals.cpp updated: 1.9 -> 1.10
---
Log message:
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.
---
Diffs of the changes: (+4 -1)
Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.9 llvm/lib/CodeGen/LiveIntervals.cpp:1.10
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.9 Thu Dec 18 02:48:47 2003
+++ llvm/lib/CodeGen/LiveIntervals.cpp Thu Dec 18 02:53:43 2003
@@ -152,11 +152,14 @@
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) {
More information about the llvm-commits
mailing list