TargetTransformInfo: address calculation parameter for gather/scather
Address calculation for gather/scather in vectorized code can incur a
significant cost making vectorization unbeneficial. Add infrastructure to add
cost.
Tests and cost model for targets will be in follow-up commits.
radar://14351991
llvm-svn: 186187
diff --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 35ce794..4b2bf3c 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -206,8 +206,9 @@
return PrevTTI->getNumberOfParts(Tp);
}
-unsigned TargetTransformInfo::getAddressComputationCost(Type *Tp) const {
- return PrevTTI->getAddressComputationCost(Tp);
+unsigned TargetTransformInfo::getAddressComputationCost(Type *Tp,
+ bool IsComplex) const {
+ return PrevTTI->getAddressComputationCost(Tp, IsComplex);
}
namespace {
@@ -559,7 +560,7 @@
return 0;
}
- unsigned getAddressComputationCost(Type *Tp) const {
+ unsigned getAddressComputationCost(Type *Tp, bool) const {
return 0;
}
};