[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)
commite5aaf3f2cd144b978367086876f24dbe283d0f38
tree6e304e10ae52513a1e43ab49c49998cd1df1c663
parented563c27fefc196c31a7ee4eec380dc636ce4b00
[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).

llvm-svn: 229966
llvm/lib/Target/PowerPC/CMakeLists.txt
llvm/lib/Target/PowerPC/PPC.h
llvm/lib/Target/PowerPC/PPCLoopDataPrefetch.cpp [new file with mode: 0644]
llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/test/CodeGen/PowerPC/loop-data-prefetch.ll [new file with mode: 0644]