|
@@ -3355,6 +3355,7 @@ int BoUpSLP::getSpillCost() const {
|
|
|
});
|
|
|
|
|
|
// Now find the sequence of instructions between PrevInst and Inst.
|
|
|
+ unsigned NumCalls = 0;
|
|
|
BasicBlock::reverse_iterator InstIt = ++Inst->getIterator().getReverse(),
|
|
|
PrevInstIt =
|
|
|
PrevInst->getIterator().getReverse();
|
|
@@ -3367,16 +3368,19 @@ int BoUpSLP::getSpillCost() const {
|
|
|
// Debug informations don't impact spill cost.
|
|
|
if ((isa<CallInst>(&*PrevInstIt) &&
|
|
|
!isa<DbgInfoIntrinsic>(&*PrevInstIt)) &&
|
|
|
- &*PrevInstIt != PrevInst) {
|
|
|
- SmallVector<Type*, 4> V;
|
|
|
- for (auto *II : LiveValues)
|
|
|
- V.push_back(VectorType::get(II->getType(), BundleWidth));
|
|
|
- Cost += TTI->getCostOfKeepingLiveOverCall(V);
|
|
|
- }
|
|
|
+ &*PrevInstIt != PrevInst)
|
|
|
+ NumCalls++;
|
|
|
|
|
|
++PrevInstIt;
|
|
|
}
|
|
|
|
|
|
+ if (NumCalls) {
|
|
|
+ SmallVector<Type*, 4> V;
|
|
|
+ for (auto *II : LiveValues)
|
|
|
+ V.push_back(VectorType::get(II->getType(), BundleWidth));
|
|
|
+ Cost += NumCalls * TTI->getCostOfKeepingLiveOverCall(V);
|
|
|
+ }
|
|
|
+
|
|
|
PrevInst = Inst;
|
|
|
}
|
|
|
|