1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[LoopDataPrefetch] If prefetch distance is not set, skip pass

This lets select sub-targets enable this pass.  The patch implements the
idea from the recent llvm-dev thread:
http://thread.gmane.org/gmane.comp.compilers.llvm.devel/94925

The goal is to enable the LoopDataPrefetch pass for the Cyclone
sub-target only within Aarch64.

Positive and negative tests will be included in an upcoming patch that
enables selective prefetching of large-strided accesses on Cyclone.

llvm-svn: 262844
This commit is contained in:
Adam Nemet 2016-03-07 18:35:42 +00:00
parent dcbfbce154
commit 9244a6e185

View File

@ -99,9 +99,12 @@ bool LoopDataPrefetch::runOnFunction(Function &F) {
AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
// If PrefetchDistance is not set, don't run the pass. This gives an
// opportunity for targets to run this pass for selected subtargets only
// (whose TTI sets PrefetchDistance).
if (TTI->getPrefetchDistance() == 0)
return false;
assert(TTI->getCacheLineSize() && "Cache line size is not set for target");
assert(TTI->getPrefetchDistance() &&
"Prefetch distance is not set for target");
bool MadeChange = false;