summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2016-01-21 18:28:36 +0000
committerAdam Nemet <anemet@apple.com>2016-01-21 18:28:36 +0000
commitaf761104babba61fb7dc07620a9e89f41f5aabf7 (patch)
treede81c50196ebed654842beed6c2424f5984a05f5 /llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp
parentfcdb19904c5da82ee72ce2dc76510e936fcc0bf3 (diff)
downloadbcm5719-llvm-af761104babba61fb7dc07620a9e89f41f5aabf7.tar.gz
bcm5719-llvm-af761104babba61fb7dc07620a9e89f41f5aabf7.zip
[TTI] Add getCacheLineSize
Summary: And use it in PPCLoopDataPrefetch.cpp. @hfinkel, please let me know if your preference would be to preserve the ppc-loop-prefetch-cache-line option in order to be able to override the value of TTI::getCacheLineSize for PPC. Reviewers: hfinkel Subscribers: hulx2000, mcrosier, mssimpso, hfinkel, llvm-commits Differential Revision: http://reviews.llvm.org/D16306 llvm-svn: 258419
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp b/llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp
index e3a35d5df35..c113ae5f52c 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp
@@ -50,10 +50,6 @@ static cl::opt<unsigned>
PrefDist("ppc-loop-prefetch-distance", cl::Hidden, cl::init(300),
cl::desc("The loop prefetch distance"));
-static cl::opt<unsigned>
-CacheLineSize("ppc-loop-prefetch-cache-line", cl::Hidden, cl::init(64),
- cl::desc("The loop prefetch cache line size"));
-
namespace llvm {
void initializePPCLoopDataPrefetchPass(PassRegistry&);
}
@@ -110,6 +106,8 @@ bool PPCLoopDataPrefetch::runOnFunction(Function &F) {
AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
+ assert(TTI->getCacheLineSize() && "Cache line size is not set for target");
+
bool MadeChange = false;
for (auto I = LI->begin(), IE = LI->end(); I != IE; ++I)
@@ -193,7 +191,7 @@ bool PPCLoopDataPrefetch::runOnLoop(Loop *L) {
if (const SCEVConstant *ConstPtrDiff =
dyn_cast<SCEVConstant>(PtrDiff)) {
int64_t PD = std::abs(ConstPtrDiff->getValue()->getSExtValue());
- if (PD < (int64_t) CacheLineSize) {
+ if (PD < (int64_t) TTI->getCacheLineSize()) {
DupPref = true;
break;
}
OpenPOWER on IntegriCloud