[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Evan Cheng
evan.cheng at apple.com
Tue Mar 27 18:30:55 PDT 2007
Changes in directory llvm/lib/CodeGen:
LiveIntervalAnalysis.cpp updated: 1.228 -> 1.229
---
Log message:
Fix for PR1279: http://llvm.org/PR1279 . Dead def has a live interval of length 1. Copy coalescing should
not violate that.
---
Diffs of the changes: (+5 -3)
LiveIntervalAnalysis.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.228 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.229
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.228 Mon Mar 26 17:40:42 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Mar 27 20:30:37 2007
@@ -935,9 +935,9 @@
// The instruction which defines the src is only truly dead if there are
// no intermediate uses and there isn't a use beyond the copy.
// FIXME: find the last use, mark is kill and shorten the live range.
- if (SrcEnd > getDefIndex(CopyIdx))
+ if (SrcEnd > getDefIndex(CopyIdx)) {
isDead = false;
- else {
+ } else {
MachineOperand *MOU;
MachineInstr *LastUse= lastRegisterUse(repSrcReg, SrcStart, CopyIdx, MOU);
if (LastUse) {
@@ -947,7 +947,9 @@
isShorten = true;
RemoveStart = getDefIndex(getInstructionIndex(LastUse));
RemoveEnd = SrcEnd;
- }
+ } else if (RemoveStart > 0)
+ // A dead def should have a single cycle interval.
+ ++RemoveStart;
}
}
More information about the llvm-commits
mailing list