aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-05-20 08:10:37 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-05-20 08:10:37 +0000
commitb0a6f62c9b2e75fc509d84310a9795ffacbc6796 (patch)
treedb8cef12c8f3cbf2cb705d2bfbe773a8d1a5cf2b /lib/CodeGen/LiveIntervalAnalysis.cpp
parent6e7b322d36fc9e571cd54cb4b9c6043346a97e3a (diff)
Don't spill dead def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 8b25344b47..2558b09ad6 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1562,7 +1562,9 @@ addIntervalsForSpills(const LiveInterval &li,
if (!Folded) {
LiveRange *LR = &nI.ranges[nI.ranges.size()-1];
bool isKill = LR->end == getStoreIndex(index);
- vrm.addSpillPoint(VReg, isKill, MI);
+ if (!MI->registerDefIsDead(nI.reg))
+ // No need to spill a dead def.
+ vrm.addSpillPoint(VReg, isKill, MI);
if (isKill)
AddedKill.insert(&nI);
}