[PowerPC] Loop Data Prefetching for the BG/Q
authorHal Finkel <hfinkel@anl.gov>
Fri, 20 Feb 2015 05:08:21 +0000 (05:08 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 20 Feb 2015 05:08:21 +0000 (05:08 +0000)
commit2c5f9584bacd1f038c59478e3a1096f218357dfb
tree84dbff514569d1790cdf58f3fc27575398def862
parentefbbaefea5d742dca1a92432aea62f669efd446b
[PowerPC] Loop Data Prefetching for the BG/Q

The IBM BG/Q supercomputer's A2 cores have a hardware prefetching unit, the
L1P, but it does not prefetch directly into the A2's L1 cache. Instead, it
prefetches into its own L1P buffer, and the latency to access that buffer is
significantly higher than that to the L1 cache (although smaller than the
latency to the L2 cache). As a result, especially when multiple hardware
threads are not actively busy, explicitly prefetching data into the L1 cache is
advantageous.

I've been using this pass out-of-tree for data prefetching on the BG/Q for well
over a year, and it has worked quite well. It is enabled by default only for
the BG/Q, but can be enabled for other cores as well via a command-line option.

Eventually, we might want to add some TTI interfaces and move this into
Transforms/Scalar (there is nothing particularly target dependent about it,
although only machines like the BG/Q will benefit from its simplistic
strategy).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229966 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/CMakeLists.txt
lib/Target/PowerPC/PPC.h
lib/Target/PowerPC/PPCLoopDataPrefetch.cpp [new file with mode: 0644]
lib/Target/PowerPC/PPCTargetMachine.cpp
test/CodeGen/PowerPC/loop-data-prefetch.ll [new file with mode: 0644]