summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-03-28 01:30:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-03-28 01:30:37 +0000
commitb41697c0068301fea6a51787d99c2874e666b960 (patch)
tree563bdd4932ab985d6213d984962a92b306699d1c /llvm/lib/CodeGen
parentae0f8dcd617d7dabac7c2424bb625f6f9f090c82 (diff)
downloadbcm5719-llvm-b41697c0068301fea6a51787d99c2874e666b960.tar.gz
bcm5719-llvm-b41697c0068301fea6a51787d99c2874e666b960.zip
Fix for PR1279. Dead def has a live interval of length 1. Copy coalescing should
not violate that. llvm-svn: 35396
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 38ada30ad74..eb3ac31998a 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -935,9 +935,9 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
// 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 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
isShorten = true;
RemoveStart = getDefIndex(getInstructionIndex(LastUse));
RemoveEnd = SrcEnd;
- }
+ } else if (RemoveStart > 0)
+ // A dead def should have a single cycle interval.
+ ++RemoveStart;
}
}
OpenPOWER on IntegriCloud