From c8b028daa462e51703815def156e2a3219aa41be Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 20 May 2008 08:10:37 +0000 Subject: Don't spill dead def. llvm-svn: 51305 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp') diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 8b25344b477..2558b09ad60 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/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); } -- cgit v1.2.3