<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I’d like to add SW prefetching capability for our ARM64 micro-architectures.  My immediate goal is to add support for constant large-strided accesses (>= 2KB) that are problematic for the HW prefetcher to handle.</div><div class=""><br class=""></div><div class="">The direct motivation is 433.milc in SPECfp 2006.  The benchmark iterates through very small matrices and multiplies them with a vector.  However the matrix is part of a large structure so the stride is large and as a result, we miss in L1 on every new matrix.</div><div class=""><br class=""></div><div class="">My plan is to take Hal’s PowerPC prefetching pass[1] and make it available for other targets on an opt-in basis.  Specifically, move the pass under  lib/Transform/Scalar and add a TTI interface to query the target parameters.  The  information a target would have to provide to opt in are: the stride threshold, cache line size and how many iterations ahead the prefetching should occur for a given loop.</div><div class=""><br class=""></div><div class="">For OOO architectures, the latter is pretty hard to estimate.  You pretty much have to compute II in the software pipelining sense.  I think that I will just use the instruction count to estimate a ResII with possibly checking that there are no recurrences in the loop other than the short ones for the induction variable.</div><div class=""><br class=""></div><div class="">This may err on the side of issuing the prefetches earlier than necessary but hopefully not too early to cause any cache thrashing.</div><div class=""><br class=""></div><div class="">The current pass operates on LLMV IR so besides having SCEVs to work with, we can also check recurrences across memory.</div><div class=""><br class=""></div><div class="">Please let me know if you have any comments.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Adam</div><div class=""><br class=""></div><div class="">[1] <a href="http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150216/260805.html" class="">http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150216/260805.html</a></div><div class=""><br class=""></div></body></html>