diff options
author | James Molloy <james.molloy@arm.com> | 2014-08-05 12:30:34 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2014-08-05 12:30:34 +0000 |
commit | 2b8933c3545102c0bab2e6070ffdc856024a7567 (patch) | |
tree | c45747841b1eda06906a72382cbe2ccd98e4c03f /llvm/lib/Analysis/TargetTransformInfo.cpp | |
parent | ca4ea1ce595867f2bdcf204064193c36eb242937 (diff) | |
download | bcm5719-llvm-2b8933c3545102c0bab2e6070ffdc856024a7567.tar.gz bcm5719-llvm-2b8933c3545102c0bab2e6070ffdc856024a7567.zip |
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.
llvm-svn: 214859
Diffstat (limited to 'llvm/lib/Analysis/TargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/TargetTransformInfo.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp index 888b5cef2f8..7ac22303deb 100644 --- a/llvm/lib/Analysis/TargetTransformInfo.cpp +++ b/llvm/lib/Analysis/TargetTransformInfo.cpp @@ -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 |