diff options
| author | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2017-06-19 23:17:36 +0000 |
|---|---|---|
| committer | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2017-06-19 23:17:36 +0000 |
| commit | 50c2f251f54935471464e2d1850858b633f46c38 (patch) | |
| tree | 660fbbecbba128fe2ec75568e37676bb5c5bba8b /llvm | |
| parent | 9565c75b29826f48a0923e401a885f391b6c1dc3 (diff) | |
| download | bcm5719-llvm-50c2f251f54935471464e2d1850858b633f46c38.tar.gz bcm5719-llvm-50c2f251f54935471464e2d1850858b633f46c38.zip | |
[AMDGPU] Add infer address spaces pass before SROA
It adds it for the target after inlining but before SROA where
we can get most out of it.
Differential Revision: https://reviews.llvm.org/D34366
llvm-svn: 305759
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 8 | ||||
| -rw-r--r-- | llvm/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index b644eba536f..04fe9f68980 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -342,6 +342,14 @@ void AMDGPUTargetMachine::adjustPassManager(PassManagerBuilder &Builder) { PM.add(createAMDGPUExternalAAWrapperPass()); } }); + + Builder.addExtension( + PassManagerBuilder::EP_CGSCCOptimizerLate, + [](const PassManagerBuilder &, legacy::PassManagerBase &PM) { + // Add infer address spaces pass to the opt pipeline after inlining + // but before SROA to increase SROA opportunities. + PM.add(createInferAddressSpacesPass()); + }); } //===----------------------------------------------------------------------===// diff --git a/llvm/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll b/llvm/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll new file mode 100644 index 00000000000..912b5ea949d --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll @@ -0,0 +1,10 @@ +; RUN: opt -mtriple=amdgcn--amdhsa -disable-output -disable-verify -debug-pass=Structure -O2 %s 2>&1 | FileCheck -check-prefix=GCN %s + +; GCN: Function Integration/Inlining +; GCN: FunctionPass Manager +; GCN: Infer address spaces +; GCN: SROA + +define void @empty() { + ret void +} |

