aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetTransformImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/TargetTransformImpl.cpp')
-rw-r--r--lib/Target/TargetTransformImpl.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Target/TargetTransformImpl.cpp b/lib/Target/TargetTransformImpl.cpp
index 2df7263..7f9fdfc 100644
--- a/lib/Target/TargetTransformImpl.cpp
+++ b/lib/Target/TargetTransformImpl.cpp
@@ -347,6 +347,25 @@ VectorTargetTransformImpl::getMemoryOpCost(unsigned Opcode, Type *Src,
}
unsigned
+VectorTargetTransformImpl::getIntrinsicInstrCost(Intrinsic::ID, Type *RetTy,
+ ArrayRef<Type*> Tys) const {
+ // assume that we need to scalarize this intrinsic.
+ unsigned ScalarizationCost = 0;
+ unsigned ScalarCalls = 1;
+ if (RetTy->isVectorTy()) {
+ ScalarizationCost = getScalarizationOverhead(RetTy, true, false);
+ ScalarCalls = std::max(ScalarCalls, RetTy->getVectorNumElements());
+ }
+ for (unsigned i = 0, ie = Tys.size(); i != ie; ++i) {
+ if (Tys[i]->isVectorTy()) {
+ ScalarizationCost += getScalarizationOverhead(Tys[i], false, true);
+ ScalarCalls = std::max(ScalarCalls, RetTy->getVectorNumElements());
+ }
+ }
+ return ScalarCalls + ScalarizationCost;
+}
+
+unsigned
VectorTargetTransformImpl::getNumberOfParts(Type *Tp) const {
std::pair<unsigned, MVT> LT = getTypeLegalizationCost(Tp);
return LT.first;