Teach the SLP Vectorizer that keeping some values live over a callsite can have a cost.

Some types, such as 128-bit vector types on AArch64, don't have any callee-saved registers. So if a value needs to stay live over a callsite, it must be spilled and refilled. This cost is now taken into account.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
James Molloy
2014-08-05 12:30:34 +00:00
parent ff8028c8da
commit 72035e9a8e
5 changed files with 146 additions and 0 deletions
+10
View File
@@ -230,6 +230,11 @@ unsigned TargetTransformInfo::getReductionCost(unsigned Opcode, Type *Ty,
return PrevTTI->getReductionCost(Opcode, Ty, IsPairwise);
}
unsigned TargetTransformInfo::getCostOfKeepingLiveOverCall(ArrayRef<Type*> Tys)
const {
return PrevTTI->getCostOfKeepingLiveOverCall(Tys);
}
namespace {
struct NoTTI final : ImmutablePass, TargetTransformInfo {
@@ -613,6 +618,11 @@ struct NoTTI final : ImmutablePass, TargetTransformInfo {
unsigned getReductionCost(unsigned, Type *, bool) const override {
return 1;
}
unsigned getCostOfKeepingLiveOverCall(ArrayRef<Type*> Tys) const override {
return 0;
}
};
} // end anonymous namespace