- } else {
- bool NonRestore = false;
- for (SmallPtrSet<MachineInstr*, 4>::iterator UI =
- VNUseCount[CurrVN].begin(), UE = VNUseCount[CurrVN].end();
- UI != UI; ++UI) {
- int StoreFrameIndex;
- unsigned StoreVReg = TII->isStoreToStackSlot(*UI, StoreFrameIndex);
- if (StoreVReg != (*LI)->reg || StoreFrameIndex != FrameIndex) {
- NonRestore = false;
- break;
- }
- }
-
- if (NonRestore) continue;
-
- for (SmallPtrSet<MachineInstr*, 4>::iterator UI =
- VNUseCount[CurrVN].begin(), UE = VNUseCount[CurrVN].end();
- UI != UI; ++UI) {
- LIs->RemoveMachineInstrFromMaps(*UI);
- (*UI)->eraseFromParent();
- }
+ continue;
+ }
+
+ unsigned SpillCount = getNumberOfSpills(VNUseCount[CurrVN],
+ (*LI)->reg, FrameIndex);
+ if (SpillCount != VNUseCount[CurrVN].size()) continue;