summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/AArch64')
-rw-r--r--llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp12
-rw-r--r--llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
index 5803e07dbcf..aee298998f3 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -25,6 +25,12 @@ static cl::opt<unsigned> CyclonePrefetchDistance(
cl::desc("Number of instructions to prefetch ahead for Cyclone"),
cl::init(280), cl::Hidden);
+// The HW prefetcher handles accesses with strides up to 2KB.
+static cl::opt<unsigned> CycloneMinPrefetchStride(
+ "cyclone-min-prefetch-stride",
+ cl::desc("Min stride to add prefetches for Cyclone"),
+ cl::init(2048), cl::Hidden);
+
/// \brief Calculate the cost of materializing a 64-bit value. This helper
/// method might only calculate a fraction of a larger immediate. Therefore it
/// is valid to return a cost of ZERO.
@@ -590,3 +596,9 @@ unsigned AArch64TTIImpl::getPrefetchDistance() {
return CyclonePrefetchDistance;
return BaseT::getPrefetchDistance();
}
+
+unsigned AArch64TTIImpl::getMinPrefetchStride() {
+ if (ST->isCyclone())
+ return CycloneMinPrefetchStride;
+ return BaseT::getMinPrefetchStride();
+}
diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
index ad711f511e5..a54db00e7d3 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
+++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
@@ -131,6 +131,8 @@ public:
unsigned getCacheLineSize();
unsigned getPrefetchDistance();
+
+ unsigned getMinPrefetchStride();
/// @}
};
OpenPOWER on IntegriCloud