diff options
author | Adam Nemet <anemet@apple.com> | 2016-03-18 00:27:29 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2016-03-18 00:27:29 +0000 |
commit | 53e758fc55687de06d905d34e7cb58a9560093d2 (patch) | |
tree | 5be94538a41fd6dd0f75ff178a9f96c6e1e84e5b /llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | |
parent | 945761b8c29f9cc36372b6485720656371c736bc (diff) | |
download | bcm5719-llvm-53e758fc55687de06d905d34e7cb58a9560093d2.tar.gz bcm5719-llvm-53e758fc55687de06d905d34e7cb58a9560093d2.zip |
[Aarch64] Add pass LoopDataPrefetch for Cyclone
Summary:
This wires up the pass for Cyclone but keeps it off for now because we
need a few more TTIs.
The getPrefetchMinStride value is not very well tuned right now but it
works well with CFP2006/433.milc which motivated this.
Tests will be added as part of the upcoming large-stride prefetching
patch.
Reviewers: t.p.northover
Subscribers: llvm-commits, aemerson, hfinkel, rengolin
Differential Revision: http://reviews.llvm.org/D17943
llvm-svn: 263770
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp index 67b29830d89..791cb900a3f 100644 --- a/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetMachine.cpp @@ -101,6 +101,11 @@ static cl::opt<cl::boolOrDefault> EnableGlobalMerge("aarch64-global-merge", cl::Hidden, cl::desc("Enable the global merge pass")); +static cl::opt<bool> + EnableLoopDataPrefetch("aarch64-loop-data-prefetch", cl::Hidden, + cl::desc("Enable the loop data prefetch pass"), + cl::init(false)); + extern "C" void LLVMInitializeAArch64Target() { // Register the target. RegisterTargetMachine<AArch64leTargetMachine> X(TheAArch64leTarget); @@ -236,6 +241,14 @@ void AArch64PassConfig::addIRPasses() { if (TM->getOptLevel() != CodeGenOpt::None && EnableAtomicTidy) addPass(createCFGSimplificationPass()); + // Run LoopDataPrefetch for Cyclone (the only subtarget that defines a + // non-zero getPrefetchDistance). + // + // Run this before LSR to remove the multiplies involved in computing the + // pointer values N iterations ahead. + if (TM->getOptLevel() != CodeGenOpt::None && EnableLoopDataPrefetch) + addPass(createLoopDataPrefetchPass()); + TargetPassConfig::addIRPasses(); // Match interleaved memory accesses to ldN/stN intrinsics. |