Don't spill dead def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-05-20 08:10:37 +00:00
parent 6e7b322d36
commit b0a6f62c9b
2 changed files with 58 additions and 1 deletions

View File

@@ -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);
}